Browse Source

Tidying

master
unknown 12 years ago
parent
commit
a70c5fceaf

+ 1
- 1
externals/dmdirc-util

@@ -1 +1 @@
1
-Subproject commit fbd836e534e10f036625cb65cc1f468758a15027
1
+Subproject commit 2fda4cc84251409dac5a32781636f88fb6d8ecbe

+ 94
- 53
nbproject/build-impl.xml View File

@@ -20,10 +20,10 @@ is divided into following sections:
20 20
 
21 21
         -->
22 22
 <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="charliebravo-impl">
23
-    <fail message="Please build using Ant 1.7.1 or higher.">
23
+    <fail message="Please build using Ant 1.8.0 or higher.">
24 24
         <condition>
25 25
             <not>
26
-                <antversion atleast="1.7.1"/>
26
+                <antversion atleast="1.8.0"/>
27 27
             </not>
28 28
         </condition>
29 29
     </fail>
@@ -77,8 +77,14 @@ is divided into following sections:
77 77
                 <isset property="main.class.available"/>
78 78
             </and>
79 79
         </condition>
80
+        <condition property="do.archive">
81
+            <not>
82
+                <istrue value="${jar.archive.disabled}"/>
83
+            </not>
84
+        </condition>
80 85
         <condition property="do.mkdist">
81 86
             <and>
87
+                <isset property="do.archive"/>
82 88
                 <isset property="libs.CopyLibs.classpath"/>
83 89
                 <not>
84 90
                     <istrue value="${mkdist.disabled}"/>
@@ -91,41 +97,42 @@ is divided into following sections:
91 97
                 <isset property="do.mkdist"/>
92 98
             </and>
93 99
         </condition>
94
-        <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
95
-            <and>
96
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
97
-                <istrue value="${splashscreen.available}"/>
98
-            </and>
99
-        </condition>
100
-        <condition property="do.archive">
101
-            <not>
102
-                <istrue value="${jar.archive.disabled}"/>
103
-            </not>
104
-        </condition>
105 100
         <condition property="do.archive+manifest.available">
106 101
             <and>
107 102
                 <isset property="manifest.available"/>
108 103
                 <istrue value="${do.archive}"/>
109 104
             </and>
110 105
         </condition>
111
-        <condition property="do.archive+manifest.available+main.class">
106
+        <condition property="do.archive+main.class.available">
112 107
             <and>
113
-                <istrue value="${manifest.available+main.class}"/>
108
+                <isset property="main.class.available"/>
114 109
                 <istrue value="${do.archive}"/>
115 110
             </and>
116 111
         </condition>
117
-        <condition property="do.archive+manifest.available+main.class+mkdist.available">
112
+        <condition property="do.archive+splashscreen.available">
118 113
             <and>
119
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
114
+                <isset property="splashscreen.available"/>
120 115
                 <istrue value="${do.archive}"/>
121 116
             </and>
122 117
         </condition>
123
-        <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
118
+        <condition property="do.archive+manifest.available+main.class">
124 119
             <and>
125
-                <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
120
+                <istrue value="${manifest.available+main.class}"/>
126 121
                 <istrue value="${do.archive}"/>
127 122
             </and>
128 123
         </condition>
124
+        <condition property="manifest.available-mkdist.available">
125
+            <or>
126
+                <istrue value="${manifest.available}"/>
127
+                <isset property="do.mkdist"/>
128
+            </or>
129
+        </condition>
130
+        <condition property="manifest.available+main.class-mkdist.available">
131
+            <or>
132
+                <istrue value="${manifest.available+main.class}"/>
133
+                <isset property="do.mkdist"/>
134
+            </or>
135
+        </condition>
129 136
         <condition property="have.tests">
130 137
             <or>
131 138
                 <available file="${test.src.dir}"/>
@@ -185,8 +192,18 @@ is divided into following sections:
185 192
         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
186 193
             <length length="0" string="${endorsed.classpath}" when="greater"/>
187 194
         </condition>
188
-        <property name="javac.fork" value="false"/>
195
+        <condition else="false" property="jdkBug6558476">
196
+            <and>
197
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
198
+                <not>
199
+                    <os family="unix"/>
200
+                </not>
201
+            </and>
202
+        </condition>
203
+        <property name="javac.fork" value="${jdkBug6558476}"/>
189 204
         <property name="jar.index" value="false"/>
205
+        <property name="jar.index.metainf" value="${jar.index}"/>
206
+        <property name="copylibs.rebase" value="true"/>
190 207
         <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
191 208
     </target>
192 209
     <target name="-post-init">
@@ -319,7 +336,9 @@ is divided into following sections:
319 336
                 <delete>
320 337
                     <files includesfile="${javac.includesfile.binary}"/>
321 338
                 </delete>
322
-                <delete file="${javac.includesfile.binary}"/>
339
+                <delete>
340
+                    <fileset file="${javac.includesfile.binary}"/>
341
+                </delete>
323 342
             </sequential>
324 343
         </macrodef>
325 344
     </target>
@@ -346,6 +365,7 @@ is divided into following sections:
346 365
                     <formatter type="brief" usefile="false"/>
347 366
                     <formatter type="xml"/>
348 367
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
368
+                    <jvmarg value="-ea"/>
349 369
                     <jvmarg line="${run.jvmargs}"/>
350 370
                 </junit>
351 371
             </sequential>
@@ -375,6 +395,7 @@ is divided into following sections:
375 395
                 <property environment="env"/>
376 396
                 <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
377 397
                 <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
398
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
378 399
                     <jvmarg value="${profiler.info.jvmargs.agent}"/>
379 400
                     <jvmarg line="${profiler.info.jvmargs}"/>
380 401
                     <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -489,6 +510,7 @@ is divided into following sections:
489 510
     </target>
490 511
     <target name="-init-macrodef-copylibs">
491 512
         <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
513
+            <attribute default="${manifest.file}" name="manifest"/>
492 514
             <element name="customize" optional="true"/>
493 515
             <sequential>
494 516
                 <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
@@ -504,7 +526,7 @@ is divided into following sections:
504 526
                     </chainedmapper>
505 527
                 </pathconvert>
506 528
                 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
507
-                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
529
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
508 530
                     <fileset dir="${build.classes.dir}"/>
509 531
                     <manifest>
510 532
                         <attribute name="Class-Path" value="${jar.classpath}"/>
@@ -638,10 +660,10 @@ is divided into following sections:
638 660
         <!-- Empty placeholder for easier customization. -->
639 661
         <!-- You can override this target in the ../build.xml file. -->
640 662
     </target>
641
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
663
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
642 664
         <j2seproject1:jar/>
643 665
     </target>
644
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
666
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
645 667
         <j2seproject1:jar manifest="${manifest.file}"/>
646 668
     </target>
647 669
     <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
@@ -650,44 +672,53 @@ is divided into following sections:
650 672
                 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
651 673
             </j2seproject1:manifest>
652 674
         </j2seproject1:jar>
653
-        <echo>To run this application from the command line without Ant, try:</echo>
675
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
654 676
         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
655 677
         <property location="${dist.jar}" name="dist.jar.resolved"/>
656 678
         <pathconvert property="run.classpath.with.dist.jar">
657 679
             <path path="${run.classpath}"/>
658 680
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
659 681
         </pathconvert>
660
-        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
682
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
661 683
     </target>
662
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
684
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
685
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
686
+        <touch file="${tmp.manifest.file}" verbose="false"/>
687
+    </target>
688
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
689
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
690
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
691
+    </target>
692
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
693
+        <manifest file="${tmp.manifest.file}" mode="update">
694
+            <attribute name="Main-Class" value="${main.class}"/>
695
+        </manifest>
696
+    </target>
697
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
663 698
         <basename file="${application.splash}" property="splashscreen.basename"/>
664 699
         <mkdir dir="${build.classes.dir}/META-INF"/>
665 700
         <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
666
-        <j2seproject3:copylibs>
667
-            <customize>
668
-                <attribute name="Main-Class" value="${main.class}"/>
669
-                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
670
-            </customize>
671
-        </j2seproject3:copylibs>
672
-        <echo>To run this application from the command line without Ant, try:</echo>
673
-        <property location="${dist.jar}" name="dist.jar.resolved"/>
674
-        <echo>java -jar "${dist.jar.resolved}"</echo>
701
+        <manifest file="${tmp.manifest.file}" mode="update">
702
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
703
+        </manifest>
675 704
     </target>
676
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
677
-        <j2seproject3:copylibs>
678
-            <customize>
679
-                <attribute name="Main-Class" value="${main.class}"/>
680
-            </customize>
681
-        </j2seproject3:copylibs>
682
-        <echo>To run this application from the command line without Ant, try:</echo>
705
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
706
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
707
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
683 708
         <property location="${dist.jar}" name="dist.jar.resolved"/>
684
-        <echo>java -jar "${dist.jar.resolved}"</echo>
709
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
710
+    </target>
711
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
712
+        <delete>
713
+            <fileset file="${tmp.manifest.file}"/>
714
+        </delete>
685 715
     </target>
716
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
686 717
     <target name="-post-jar">
687 718
         <!-- Empty placeholder for easier customization. -->
688 719
         <!-- You can override this target in the ../build.xml file. -->
689 720
     </target>
690
-    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
721
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
691 722
     <!--
692 723
                 =================
693 724
                 EXECUTION SECTION
@@ -825,31 +856,41 @@ is divided into following sections:
825 856
             -->
826 857
     <target depends="init" if="have.sources" name="-javadoc-build">
827 858
         <mkdir dir="${dist.javadoc.dir}"/>
859
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
860
+            <and>
861
+                <isset property="endorsed.classpath.cmd.line.arg"/>
862
+                <not>
863
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
864
+                </not>
865
+            </and>
866
+        </condition>
828 867
         <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
829 868
             <classpath>
830 869
                 <path path="${javac.classpath}"/>
831 870
             </classpath>
832
-            <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
871
+            <fileset dir="${src.src.dir}" excludes="*.java,${excludes}" includes="${includes}">
833 872
                 <filename name="**/*.java"/>
834 873
             </fileset>
835
-            <fileset dir="${src.src5.dir}" excludes="${excludes}" includes="${includes}">
874
+            <fileset dir="${src.src5.dir}" excludes="*.java,${excludes}" includes="${includes}">
836 875
                 <filename name="**/*.java"/>
837 876
             </fileset>
838
-            <fileset dir="${src.src4.dir}" excludes="${excludes}" includes="${includes}">
877
+            <fileset dir="${src.src4.dir}" excludes="*.java,${excludes}" includes="${includes}">
839 878
                 <filename name="**/*.java"/>
840 879
             </fileset>
841
-            <fileset dir="${src.src2.dir}" excludes="${excludes}" includes="${includes}">
880
+            <fileset dir="${src.src2.dir}" excludes="*.java,${excludes}" includes="${includes}">
842 881
                 <filename name="**/*.java"/>
843 882
             </fileset>
844
-            <fileset dir="${src.src3.dir}" excludes="${excludes}" includes="${includes}">
883
+            <fileset dir="${src.src3.dir}" excludes="*.java,${excludes}" includes="${includes}">
845 884
                 <filename name="**/*.java"/>
846 885
             </fileset>
847
-            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
886
+            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
848 887
                 <filename name="**/*.java"/>
849 888
             </fileset>
850 889
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
851 890
                 <include name="**/*.java"/>
891
+                <exclude name="*.java"/>
852 892
             </fileset>
893
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
853 894
         </javadoc>
854 895
         <copy todir="${dist.javadoc.dir}">
855 896
             <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
@@ -894,7 +935,7 @@ is divided into following sections:
894 935
     <target if="do.depend.true" name="-compile-test-depend">
895 936
         <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
896 937
     </target>
897
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
938
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
898 939
         <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
899 940
         <copy todir="${build.test.classes.dir}">
900 941
             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -909,7 +950,7 @@ is divided into following sections:
909 950
         <!-- Empty placeholder for easier customization. -->
910 951
         <!-- You can override this target in the ../build.xml file. -->
911 952
     </target>
912
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
953
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
913 954
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
914 955
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
915 956
         <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>

+ 2
- 2
nbproject/genfiles.properties View File

@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.40.0.45
4 4
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 5
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 6
 nbproject/build-impl.xml.data.CRC32=3df6429b
7
-nbproject/build-impl.xml.script.CRC32=292a7a81
8
-nbproject/build-impl.xml.stylesheet.CRC32=fce8b508@1.40.0.45
7
+nbproject/build-impl.xml.script.CRC32=f0bc9380
8
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46

+ 2
- 0
nbproject/project.properties View File

@@ -1,5 +1,6 @@
1 1
 annotation.processing.enabled=true
2 2
 annotation.processing.enabled.in.editor=false
3
+annotation.processing.processors.list=
3 4
 annotation.processing.run.all.processors=true
4 5
 application.title=charliebravo
5 6
 application.vendor=chris
@@ -86,6 +87,7 @@ javadoc.windowtitle=
86 87
 main.class=com.md87.charliebravo.CharlieBravo
87 88
 manifest.file=manifest.mf
88 89
 meta.inf.dir=${src.dir}/META-INF
90
+mkdist.disabled=false
89 91
 platform.active=default_platform
90 92
 run.classpath=\
91 93
     ${javac.classpath}:\

+ 0
- 51
src/com/md87/charliebravo/CharlieBravo.java View File

@@ -97,55 +97,4 @@ public class CharlieBravo implements Runnable, Post005Listener,
97 97
     public void onDataOut(final Parser tParser, final Date date, final String sData, final boolean bFromParser) {
98 98
         System.out.println(">>> " + sData);
99 99
     }
100
-    
101
-    /**
102
-     * Tests for and adds one component of the duration format.
103
-     *
104
-     * @param builder The string builder to append text to
105
-     * @param current The number of seconds in the duration
106
-     * @param duration The number of seconds in this component
107
-     * @param name The name of this component
108
-     * @return The number of seconds used by this component
109
-     */
110
-    private static int doDuration(final StringBuilder builder, final int current,
111
-            final int duration, final String name) {
112
-        int res = 0;
113
-
114
-        if (current >= duration) {
115
-            final int units = current / duration;
116
-            res = units * duration;
117
-
118
-            if (builder.length() > 0) {
119
-                builder.append(", ");
120
-            }
121
-
122
-            builder.append(units);
123
-            builder.append(' ');
124
-            builder.append(name + (units != 1 ? 's' : ""));
125
-        }
126
-
127
-        return res;
128
-    }
129
-
130
-    
131
-    /**
132
-     * Formats the specified number of seconds as a string containing the
133
-     * number of days, hours, minutes and seconds.
134
-     *
135
-     * @param duration The duration in seconds to be formatted
136
-     * @return A textual version of the duration
137
-     */
138
-    public static String formatDuration(final int duration) {
139
-        final StringBuilder buff = new StringBuilder();
140
-
141
-        int seconds = duration;
142
-
143
-        seconds -= doDuration(buff, seconds, 60*60*24, "day");
144
-        seconds -= doDuration(buff, seconds, 60*60, "hour");
145
-        seconds -= doDuration(buff, seconds, 60, "minute");
146
-        seconds -= doDuration(buff, seconds, 1, "second");
147
-
148
-        return buff.length() == 0 ? "0 seconds" : buff.toString();
149
-    }
150
-
151 100
 }

+ 4
- 4
src/com/md87/charliebravo/commands/SkillCommand.java View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.md87.charliebravo.commands;
24 24
 
25
-import com.md87.charliebravo.CharlieBravo;
25
+import com.dmdirc.util.DateUtils;
26 26
 import com.md87.charliebravo.Command;
27 27
 import com.md87.charliebravo.CommandOptions;
28 28
 import com.md87.charliebravo.ConfigCache;
@@ -67,7 +67,7 @@ public class SkillCommand implements Command {
67 67
                         response.sendMessage("you are currently training "
68 68
                                 + skill.getSkill().getName() + " to level "
69 69
                                 + skill.getTargetLevel() + ". It will finish in "
70
-                                + CharlieBravo.formatDuration((int) (skill.getEndTime()
70
+                                + DateUtils.formatDuration((int) (skill.getEndTime()
71 71
                                 .getTime() - System.currentTimeMillis()) / 1000));
72 72
                     } else {
73 73
                         response.sendMessage("You are not training anything", true);
@@ -102,10 +102,10 @@ public class SkillCommand implements Command {
102 102
         public void execute(InputHandler handler, Response response, String line) throws Exception {
103 103
             response.setInheritFollows(true);
104 104
             response.sendMessage("the result has been cached for " +
105
-                    CharlieBravo.formatDuration((int) (System.currentTimeMillis()
105
+                    DateUtils.formatDuration((int) (System.currentTimeMillis()
106 106
                     - apiresponse.getApiResult().getCachedSince().getTime()) / 1000)
107 107
                     + ", and will expire in " +
108
-                    CharlieBravo.formatDuration((int) (apiresponse.getApiResult()
108
+                    DateUtils.formatDuration((int) (apiresponse.getApiResult()
109 109
                     .getCachedUntil().getTime() - System.currentTimeMillis()) / 1000));
110 110
         }
111 111
 

+ 3
- 3
src/com/md87/charliebravo/commands/WhoisCommand.java View File

@@ -23,7 +23,7 @@
23 23
 package com.md87.charliebravo.commands;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.ClientInfo;
26
-import com.md87.charliebravo.CharlieBravo;
26
+import com.dmdirc.util.DateUtils;
27 27
 import com.md87.charliebravo.Command;
28 28
 import com.md87.charliebravo.InputHandler;
29 29
 import com.md87.charliebravo.Response;
@@ -51,7 +51,7 @@ public class WhoisCommand implements Command {
51 51
                     }
52 52
 
53 53
                     response.sendMessage(line + " last authenticated with me "
54
-                            + CharlieBravo.formatDuration((int)
54
+                            + DateUtils.formatDuration((int)
55 55
                             (System.currentTimeMillis() -
56 56
                             Long.valueOf(handler.getConfig().getOption(line, "internal.lastseen")))
57 57
                             / 1000)
@@ -70,7 +70,7 @@ public class WhoisCommand implements Command {
70 70
                     final StringBuilder extra = new StringBuilder();
71 71
 
72 72
                     if (handler.getConfig().hasOption(openid, "admin.level")) {
73
-                        extra.append(", and " + (you ? "have" : "has") + " access level ");
73
+                        extra.append(", and ").append(you ? "have" : "has").append(" access level ");
74 74
                         extra.append(handler.getConfig().getOption(openid, "admin.level"));
75 75
                     }
76 76
 

Loading…
Cancel
Save