Sfoglia il codice sorgente

Core style fixes

Change-Id: Id071eef525d7cbf9e08f8bbf975277b6ca7e4f1d
Reviewed-on: http://gerrit.dmdirc.com/1317
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4rc1
Chris Smith 14 anni fa
parent
commit
00ae9c2a1f
34 ha cambiato i file con 78 aggiunte e 115 eliminazioni
  1. 7
    10
      src/com/dmdirc/Channel.java
  2. 3
    2
      src/com/dmdirc/ChannelEventHandler.java
  3. 1
    3
      src/com/dmdirc/EventHandler.java
  4. 1
    5
      src/com/dmdirc/FrameContainer.java
  5. 3
    10
      src/com/dmdirc/FrameContainerComparator.java
  6. 4
    0
      src/com/dmdirc/GlobalWindow.java
  7. 0
    1
      src/com/dmdirc/Invite.java
  8. 2
    2
      src/com/dmdirc/Main.java
  9. 2
    2
      src/com/dmdirc/Query.java
  10. 2
    1
      src/com/dmdirc/Raw.java
  11. 8
    8
      src/com/dmdirc/Server.java
  12. 4
    3
      src/com/dmdirc/ServerEventHandler.java
  13. 16
    16
      src/com/dmdirc/commandline/CommandLineParser.java
  14. 0
    7
      src/com/dmdirc/commandline/RemoteServer.java
  15. 5
    4
      src/com/dmdirc/commandparser/CommandManager.java
  16. 2
    2
      src/com/dmdirc/commandparser/commands/Command.java
  17. 1
    1
      src/com/dmdirc/commandparser/commands/IntelligentCommand.java
  18. 1
    1
      src/com/dmdirc/commandparser/commands/channel/Cycle.java
  19. 1
    1
      src/com/dmdirc/commandparser/commands/channel/Invite.java
  20. 1
    1
      src/com/dmdirc/commandparser/commands/channel/Mode.java
  21. 0
    1
      src/com/dmdirc/commandparser/commands/channel/SetNickColour.java
  22. 1
    1
      src/com/dmdirc/commandparser/commands/global/AliasCommand.java
  23. 4
    9
      src/com/dmdirc/commandparser/commands/global/Debug.java
  24. 2
    2
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  25. 0
    1
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  26. 1
    1
      src/com/dmdirc/commandparser/commands/global/OpenWindow.java
  27. 1
    0
      src/com/dmdirc/commandparser/commands/global/Set.java
  28. 0
    1
      src/com/dmdirc/commandparser/commands/server/ChangeServer.java
  29. 1
    1
      src/com/dmdirc/commandparser/commands/server/Disconnect.java
  30. 2
    2
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  31. 1
    1
      src/com/dmdirc/commandparser/commands/server/Reconnect.java
  32. 1
    1
      src/com/dmdirc/commandparser/parsers/CommandParser.java
  33. 0
    7
      src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java
  34. 0
    7
      src/com/dmdirc/commandparser/parsers/ServerCommandParser.java

+ 7
- 10
src/com/dmdirc/Channel.java Vedi File

@@ -58,7 +58,7 @@ import java.util.Map;
58 58
 public class Channel extends MessageTarget<ChannelWindow> implements ConfigChangeListener {
59 59
 
60 60
     /** The parser's pChannel class. */
61
-    private transient ChannelInfo channelInfo;
61
+    private ChannelInfo channelInfo;
62 62
 
63 63
     /** The server this channel is on. */
64 64
     private Server server;
@@ -151,7 +151,7 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
151 151
         }
152 152
 
153 153
         final ClientInfo me = server.getParser().getLocalClient();
154
-        final String[] details = getDetails(channelInfo.getChannelClient(me), showColours);
154
+        final String[] details = getDetails(channelInfo.getChannelClient(me));
155 155
 
156 156
         for (String part : splitLine(getTranscoder().encode(line))) {
157 157
             if (!part.isEmpty()) {
@@ -186,7 +186,7 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
186 186
         }
187 187
 
188 188
         final ClientInfo me = server.getParser().getLocalClient();
189
-        final String[] details = getDetails(channelInfo.getChannelClient(me), showColours);
189
+        final String[] details = getDetails(channelInfo.getChannelClient(me));
190 190
 
191 191
         if (server.getParser().getMaxLength("PRIVMSG", getChannelInfo().getName())
192 192
                 <= action.length()) {
@@ -275,7 +275,7 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
275 275
         String temp = Styliser.stipControlCodes(channelInfo.getName());
276 276
 
277 277
         if (!channelInfo.getTopic().isEmpty()) {
278
-            temp = temp + " - " + Styliser.stipControlCodes(channelInfo.getTopic());
278
+            temp += " - " + Styliser.stipControlCodes(channelInfo.getTopic());
279 279
         }
280 280
 
281 281
         setTitle(temp);
@@ -480,11 +480,9 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
480 480
      * client.
481 481
      *
482 482
      * @param client The channel client to check
483
-     * @param showColours Whether or not to show colours
484 483
      * @return A string[] containing displayable components
485 484
      */
486
-    private String[] getDetails(final ChannelClientInfo client,
487
-            final boolean showColours) {
485
+    private String[] getDetails(final ChannelClientInfo client) {
488 486
         if (client == null) {
489 487
             // WTF?
490 488
             throw new UnsupportedOperationException("getDetails called with"
@@ -500,10 +498,9 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
500 498
         if (showColours) {
501 499
             final Map<?,?> map = client.getMap();
502 500
             String prefix = null;
503
-            Color colour;
504 501
 
505 502
             if (map.containsKey(ChannelClientProperty.TEXT_FOREGROUND)) {
506
-                colour = (Color) map.get(ChannelClientProperty.TEXT_FOREGROUND);
503
+                Color colour = (Color) map.get(ChannelClientProperty.TEXT_FOREGROUND);
507 504
                 prefix = Styliser.CODE_HEXCOLOUR + ColourManager.getHex(colour);
508 505
                 if (map.containsKey(ChannelClientProperty.TEXT_BACKGROUND)) {
509 506
                     colour = (Color) map.get(ChannelClientProperty.TEXT_BACKGROUND);
@@ -535,7 +532,7 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
535 532
             // Format ChannelClientInfos
536 533
 
537 534
             final ChannelClientInfo clientInfo = (ChannelClientInfo) arg;
538
-            args.addAll(Arrays.asList(getDetails(clientInfo, showColours)));
535
+            args.addAll(Arrays.asList(getDetails(clientInfo)));
539 536
 
540 537
             return true;
541 538
         } else if (arg instanceof Topic) {

+ 3
- 2
src/com/dmdirc/ChannelEventHandler.java Vedi File

@@ -25,12 +25,13 @@ package com.dmdirc;
25 25
 import com.dmdirc.actions.ActionManager;
26 26
 import com.dmdirc.actions.CoreActionType;
27 27
 import com.dmdirc.parser.common.AwayState;
28
+import com.dmdirc.parser.common.CallbackManager;
28 29
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
29 30
 import com.dmdirc.parser.interfaces.ChannelInfo;
30 31
 import com.dmdirc.parser.interfaces.ClientInfo;
31 32
 import com.dmdirc.parser.interfaces.Parser;
32
-import com.dmdirc.parser.common.CallbackManager;
33 33
 import com.dmdirc.parser.interfaces.callbacks.*;
34
+
34 35
 import java.util.Date;
35 36
 
36 37
 /**
@@ -38,7 +39,7 @@ import java.util.Date;
38 39
  *
39 40
  * @author chris
40 41
  */
41
-public final class ChannelEventHandler extends EventHandler implements
42
+public class ChannelEventHandler extends EventHandler implements
42 43
         ChannelMessageListener, ChannelNamesListener, ChannelTopicListener,
43 44
         ChannelJoinListener, ChannelPartListener, ChannelKickListener,
44 45
         ChannelQuitListener, ChannelActionListener, ChannelNickChangeListener,

+ 1
- 3
src/com/dmdirc/EventHandler.java Vedi File

@@ -24,9 +24,9 @@ package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.logger.ErrorLevel;
26 26
 import com.dmdirc.logger.Logger;
27
-import com.dmdirc.parser.interfaces.Parser;
28 27
 import com.dmdirc.parser.common.CallbackManager;
29 28
 import com.dmdirc.parser.common.CallbackNotFoundException;
29
+import com.dmdirc.parser.interfaces.Parser;
30 30
 import com.dmdirc.parser.interfaces.callbacks.CallbackInterface;
31 31
 
32 32
 /**
@@ -40,7 +40,6 @@ public abstract class EventHandler implements CallbackInterface {
40 40
      * Registers all callbacks that this event handler implements with the
41 41
      * owner's parser.
42 42
      */
43
-    @SuppressWarnings("unchecked")
44 43
     public void registerCallbacks() {
45 44
         final CallbackManager<?> cbm = getServer().getParser().getCallbackManager();
46 45
         
@@ -73,7 +72,6 @@ public abstract class EventHandler implements CallbackInterface {
73 72
      * @param type The type of the callback to be added
74 73
      * @throws CallbackNotFoundException if the specified callback isn't found
75 74
      */
76
-    @SuppressWarnings("unchecked")
77 75
     protected abstract <T extends CallbackInterface> void addCallback(
78 76
             final CallbackManager<?> cbm, final Class<T> type) throws CallbackNotFoundException;
79 77
     

+ 1
- 5
src/com/dmdirc/FrameContainer.java Vedi File

@@ -55,10 +55,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
55 55
  */
56 56
 public abstract class FrameContainer<T extends Window> {
57 57
 
58
-    /** Logger to use. */
59
-    private static final java.util.logging.Logger LOGGER = java.util.logging
60
-            .Logger.getLogger(FrameContainer.class.getName());
61
-
62 58
     /** The colour of our frame's notifications. */
63 59
     protected Color notification = Color.BLACK;
64 60
 
@@ -113,7 +109,7 @@ public abstract class FrameContainer<T extends Window> {
113 109
      * @param config The config manager for this container
114 110
      * @since 0.6.4
115 111
      */
116
-    public FrameContainer(final String icon, final String name,
112
+    protected FrameContainer(final String icon, final String name,
117 113
             final String title, final Class<T> windowClass, final ConfigManager config) {
118 114
         this.config = config;
119 115
         this.name = name;

+ 3
- 10
src/com/dmdirc/FrameContainerComparator.java Vedi File

@@ -40,13 +40,6 @@ public final class FrameContainerComparator implements Comparator<FrameContainer
40 40
      */
41 41
     private static final long serialVersionUID = 1;
42 42
 
43
-    /**
44
-     * Creates a new instance of FrameContainerComparator.
45
-     */
46
-    public FrameContainerComparator() {
47
-        super();
48
-    }
49
-
50 43
     /**
51 44
      * Compares two frame containers names.
52 45
      *
@@ -91,7 +84,7 @@ public final class FrameContainerComparator implements Comparator<FrameContainer
91 84
      * @param item2 The existing container to test against
92 85
      * @return True iff the new container should be before the old container
93 86
      */
94
-    private boolean sortBefore(final FrameContainer<?> item1,
87
+    private static boolean sortBefore(final FrameContainer<?> item1,
95 88
             final FrameContainer<?> item2) {
96 89
 
97 90
         return getPosition(item1) < getPosition(item2);
@@ -104,7 +97,7 @@ public final class FrameContainerComparator implements Comparator<FrameContainer
104 97
      * @param item2 The existing container to test against
105 98
      * @return True iff the new container should be after the old container
106 99
      */
107
-    private boolean sortAfter(final FrameContainer<?> item1,
100
+    private static boolean sortAfter(final FrameContainer<?> item1,
108 101
             final FrameContainer<?> item2) {
109 102
         return getPosition(item1) > getPosition(item2);
110 103
     }
@@ -116,7 +109,7 @@ public final class FrameContainerComparator implements Comparator<FrameContainer
116 109
      * @param item The frame container to be tested
117 110
      * @return Position of the frame container
118 111
      */
119
-    private int getPosition(final FrameContainer<?> item) {
112
+    private static int getPosition(final FrameContainer<?> item) {
120 113
         if (item instanceof GlobalWindow) {
121 114
             return 0;
122 115
         } else if (item instanceof Server) {

+ 4
- 0
src/com/dmdirc/GlobalWindow.java Vedi File

@@ -125,6 +125,10 @@ public class GlobalWindow extends WritableFrameContainer<InputWindow> {
125 125
         updateWindowState();
126 126
     }
127 127
 
128
+    /**
129
+     * Updates the state of the global window in line with the
130
+     * general.showglobalwindow config setting.
131
+     */
128 132
     protected static void updateWindowState() {
129 133
         synchronized (GlobalWindow.class) {
130 134
             if (IdentityManager.getGlobalConfig().getOptionBool("general", "showglobalwindow")) {

+ 0
- 1
src/com/dmdirc/Invite.java Vedi File

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.parser.common.ChannelJoinRequest;
26 25
 import java.util.Date;
27 26
 
28 27
 /**

+ 2
- 2
src/com/dmdirc/Main.java Vedi File

@@ -35,8 +35,8 @@ import com.dmdirc.logger.Logger;
35 35
 import com.dmdirc.plugins.PluginInfo;
36 36
 import com.dmdirc.plugins.PluginManager;
37 37
 import com.dmdirc.plugins.Service;
38
-import com.dmdirc.ui.themes.ThemeManager;
39 38
 import com.dmdirc.ui.interfaces.UIController;
39
+import com.dmdirc.ui.themes.ThemeManager;
40 40
 import com.dmdirc.ui.WarningDialog;
41 41
 import com.dmdirc.updater.UpdateChecker;
42 42
 import com.dmdirc.updater.Version;
@@ -59,7 +59,7 @@ import java.util.logging.Level;
59 59
  *
60 60
  * @author chris
61 61
  */
62
-public final class Main {
62
+public class Main {
63 63
 
64 64
     /** Feedback nag delay. */
65 65
     private static final int FEEDBACK_DELAY = 30 * 60 * 1000;

+ 2
- 2
src/com/dmdirc/Query.java Vedi File

@@ -29,10 +29,10 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.parsers.QueryCommandParser;
30 30
 import com.dmdirc.logger.ErrorLevel;
31 31
 import com.dmdirc.logger.Logger;
32
-import com.dmdirc.parser.interfaces.ClientInfo;
33
-import com.dmdirc.parser.interfaces.Parser;
34 32
 import com.dmdirc.parser.common.CallbackManager;
35 33
 import com.dmdirc.parser.common.CallbackNotFoundException;
34
+import com.dmdirc.parser.interfaces.ClientInfo;
35
+import com.dmdirc.parser.interfaces.Parser;
36 36
 import com.dmdirc.parser.interfaces.callbacks.NickChangeListener;
37 37
 import com.dmdirc.parser.interfaces.callbacks.PrivateActionListener;
38 38
 import com.dmdirc.parser.interfaces.callbacks.PrivateMessageListener;

+ 2
- 1
src/com/dmdirc/Raw.java Vedi File

@@ -25,13 +25,14 @@ package com.dmdirc;
25 25
 import com.dmdirc.commandparser.parsers.ServerCommandParser;
26 26
 import com.dmdirc.logger.ErrorLevel;
27 27
 import com.dmdirc.logger.Logger;
28
-import com.dmdirc.parser.interfaces.Parser;
29 28
 import com.dmdirc.parser.common.CallbackNotFoundException;
29
+import com.dmdirc.parser.interfaces.Parser;
30 30
 import com.dmdirc.parser.interfaces.callbacks.DataInListener;
31 31
 import com.dmdirc.parser.interfaces.callbacks.DataOutListener;
32 32
 import com.dmdirc.ui.WindowManager;
33 33
 import com.dmdirc.ui.input.TabCompleter;
34 34
 import com.dmdirc.ui.interfaces.InputWindow;
35
+
35 36
 import java.util.Date;
36 37
 
37 38
 /**

+ 8
- 8
src/com/dmdirc/Server.java Vedi File

@@ -39,14 +39,14 @@ import com.dmdirc.logger.Logger;
39 39
 import com.dmdirc.parser.common.ChannelJoinRequest;
40 40
 import com.dmdirc.parser.common.DefaultStringConverter;
41 41
 import com.dmdirc.parser.common.IgnoreList;
42
+import com.dmdirc.parser.common.MyInfo;
42 43
 import com.dmdirc.parser.common.ParserError;
43 44
 import com.dmdirc.parser.interfaces.ChannelInfo;
44 45
 import com.dmdirc.parser.interfaces.ClientInfo;
45 46
 import com.dmdirc.parser.interfaces.Parser;
47
+import com.dmdirc.parser.interfaces.ProtocolDescription;
46 48
 import com.dmdirc.parser.interfaces.SecureParser;
47 49
 import com.dmdirc.parser.interfaces.StringConverter;
48
-import com.dmdirc.parser.common.MyInfo;
49
-import com.dmdirc.parser.interfaces.ProtocolDescription;
50 50
 import com.dmdirc.ui.WindowManager;
51 51
 import com.dmdirc.ui.input.TabCompleter;
52 52
 import com.dmdirc.ui.input.TabCompletionType;
@@ -102,9 +102,9 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
102 102
     private final Map<String, Query> queries = new HashMap<String, Query>();
103 103
 
104 104
     /** The Parser instance handling this server. */
105
-    private transient Parser parser;
105
+    private Parser parser;
106 106
     /** The Parser instance that used to be handling this server. */
107
-    private transient Parser oldParser;
107
+    private Parser oldParser;
108 108
     /** The parser-supplied protocol description object. */
109 109
     private ProtocolDescription protocolDescription;
110 110
 
@@ -120,7 +120,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
120 120
     private final ReadWriteLock parserLock = new ReentrantReadWriteLock();
121 121
 
122 122
     /** The Parser Thread. */
123
-    private transient Thread parserThread;
123
+    private Thread parserThread;
124 124
 
125 125
     /** The raw frame used for this server instance. */
126 126
     private Raw raw;
@@ -129,7 +129,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
129 129
     private URI address;
130 130
 
131 131
     /** The profile we're using. */
132
-    private transient Identity profile;
132
+    private Identity profile;
133 133
 
134 134
     /** Object used to synchronise access to myState. */
135 135
     private final Object myStateLock = new Object();
@@ -1402,7 +1402,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
1402 1402
         synchronized (myStateLock) {
1403 1403
             if (myState.getState() == ServerState.CLOSING
1404 1404
                     || myState.getState() == ServerState.DISCONNECTED) {
1405
-                // This has been triggered via .disconect()
1405
+                // This has been triggered via .disconnect()
1406 1406
                 return;
1407 1407
             }
1408 1408
 
@@ -1572,7 +1572,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
1572 1572
     }
1573 1573
 
1574 1574
     /**
1575
-     * Checks that we have the neccessary mode aliases for this server.
1575
+     * Checks that we have the necessary mode aliases for this server.
1576 1576
      */
1577 1577
     private void checkModeAliases() {
1578 1578
         // Check we have mode aliases

+ 4
- 3
src/com/dmdirc/ServerEventHandler.java Vedi File

@@ -27,14 +27,15 @@ import com.dmdirc.actions.CoreActionType;
27 27
 import com.dmdirc.logger.ErrorLevel;
28 28
 import com.dmdirc.logger.Logger;
29 29
 import com.dmdirc.parser.common.AwayState;
30
+import com.dmdirc.parser.common.CallbackManager;
31
+import com.dmdirc.parser.common.CallbackNotFoundException;
32
+import com.dmdirc.parser.common.ParserError;
30 33
 import com.dmdirc.parser.interfaces.ChannelInfo;
31 34
 import com.dmdirc.parser.interfaces.ClientInfo;
32 35
 import com.dmdirc.parser.interfaces.Parser;
33
-import com.dmdirc.parser.common.ParserError;
34
-import com.dmdirc.parser.common.CallbackManager;
35
-import com.dmdirc.parser.common.CallbackNotFoundException;
36 36
 import com.dmdirc.parser.interfaces.callbacks.*;
37 37
 import com.dmdirc.parser.irc.IRCParser;
38
+
38 39
 import java.util.Date;
39 40
 
40 41
 /**

+ 16
- 16
src/com/dmdirc/commandline/CommandLineParser.java Vedi File

@@ -128,9 +128,9 @@ public class CommandLineParser {
128 128
     private boolean checkArgument(final char argument) {
129 129
         boolean needsArg = false;
130 130
         
131
-        for (int i = 0; i < ARGUMENTS.length; i++) {
132
-            if (argument == ARGUMENTS[i][0]) {
133
-                needsArg = (Boolean) ARGUMENTS[i][3];
131
+        for (Object[] target : ARGUMENTS) {
132
+            if ((Character) argument == target[0]) {
133
+                needsArg = (Boolean) target[3];
134 134
                 break;
135 135
             }
136 136
         }
@@ -151,9 +151,9 @@ public class CommandLineParser {
151 151
      * @return The short form of the corresponding argument
152 152
      */
153 153
     private char processLongArg(final String arg) {
154
-        for (int i = 0; i < ARGUMENTS.length; i++) {
155
-            if (arg.equalsIgnoreCase((String) ARGUMENTS[i][1])) {
156
-                return (Character) ARGUMENTS[i][0];
154
+        for (Object[] target : ARGUMENTS) {
155
+            if (arg.equalsIgnoreCase((String) target[1])) {
156
+                return (Character) target[0];
157 157
             }
158 158
         }
159 159
         
@@ -170,9 +170,9 @@ public class CommandLineParser {
170 170
      * @return The short form of the corresponding argument
171 171
      */
172 172
     private char processShortArg(final String arg) {
173
-        for (int i = 0; i < ARGUMENTS.length; i++) {
174
-            if (arg.equals(String.valueOf(ARGUMENTS[i][0]))) {
175
-                return (Character) ARGUMENTS[i][0];
173
+        for (Object[] target : ARGUMENTS) {
174
+            if (arg.equals(String.valueOf(target[0]))) {
175
+                return (Character) target[0];
176 176
             }
177 177
         }
178 178
         
@@ -183,7 +183,7 @@ public class CommandLineParser {
183 183
     }
184 184
     
185 185
     /**
186
-     * Processes the sepcified command-line argument.
186
+     * Processes the specified command-line argument.
187 187
      *
188 188
      * @param arg The short form of the argument used
189 189
      * @param param The (optional) string parameter for the option
@@ -232,7 +232,7 @@ public class CommandLineParser {
232 232
      *
233 233
      * @param message The message about the unknown argument to be displayed
234 234
      */
235
-    private void doUnknownArg(final String message) {
235
+    private static void doUnknownArg(final String message) {
236 236
         System.out.println(message);
237 237
         System.out.println();
238 238
         doHelp();
@@ -241,7 +241,7 @@ public class CommandLineParser {
241 241
     /**
242 242
      * Exits DMDirc.
243 243
      */
244
-    private void exit() {
244
+    private static void exit() {
245 245
         System.exit(0);
246 246
     }
247 247
     
@@ -275,7 +275,7 @@ public class CommandLineParser {
275 275
     /**
276 276
      * Handles the --check argument.
277 277
      */
278
-    private void doExistingCheck() {
278
+    private static void doExistingCheck() {
279 279
         if (RemoteServer.getServer() == null) {
280 280
             System.out.println("Existing instance not found.");
281 281
             System.exit(1);
@@ -290,7 +290,7 @@ public class CommandLineParser {
290 290
      *
291 291
      * @param dir The new config directory
292 292
      */
293
-    private void doDirectory(final String dir) {
293
+    private static void doDirectory(final String dir) {
294 294
         if (dir.endsWith(File.separator)) {
295 295
             Main.setConfigDir(dir);
296 296
         } else {
@@ -301,7 +301,7 @@ public class CommandLineParser {
301 301
     /**
302 302
      * Prints out the client version and exits.
303 303
      */
304
-    private void doVersion() {
304
+    private static void doVersion() {
305 305
         System.out.println("DMDirc - a cross-platform, open-source IRC client.");
306 306
         System.out.println();
307 307
         System.out.println("        Version: "
@@ -314,7 +314,7 @@ public class CommandLineParser {
314 314
     /**
315 315
      * Prints out client help and exits.
316 316
      */
317
-    private void doHelp() {
317
+    private static void doHelp() {
318 318
         System.out.println("Usage: java -jar DMDirc.jar [options]");
319 319
         System.out.println();
320 320
         System.out.println("Valid options:");

+ 0
- 7
src/com/dmdirc/commandline/RemoteServer.java Vedi File

@@ -48,13 +48,6 @@ public class RemoteServer implements RemoteInterface {
48 48
     /** The interface we're exposing. */
49 49
     private static final RemoteServer SERVER = new RemoteServer();
50 50
     
51
-    /**
52
-     * Creates a new instance of RemoteServer.
53
-     */
54
-    public RemoteServer() {
55
-        super();
56
-    }
57
-    
58 51
     /** {@inheritDoc} */
59 52
     @Override
60 53
     public void connect(final List<URI> addresses) throws RemoteException {

+ 5
- 4
src/com/dmdirc/commandparser/CommandManager.java Vedi File

@@ -32,8 +32,8 @@ import com.dmdirc.commandparser.commands.global.*;
32 32
 //import com.dmdirc.commandparser.commands.query.*;
33 33
 import com.dmdirc.commandparser.commands.server.*;
34 34
 import com.dmdirc.commandparser.parsers.CommandParser;
35
-import com.dmdirc.interfaces.ConfigChangeListener;
36 35
 import com.dmdirc.config.IdentityManager;
36
+import com.dmdirc.interfaces.ConfigChangeListener;
37 37
 import com.dmdirc.ui.input.TabCompleter;
38 38
 import com.dmdirc.ui.input.TabCompletionType;
39 39
 import com.dmdirc.util.MapList;
@@ -151,11 +151,12 @@ public final class CommandManager {
151 151
     }
152 152
     
153 153
     /**
154
-     * Registers the specified command with all of the specified parsers.
154
+     * Registers or unregisters the specified command with all of the specified parsers.
155 155
      *
156 156
      * @param info The command information object
157
-     * @param command The command to be reigstered
158
-     * @param parsers The parsers to register the command with
157
+     * @param command The command to be registered
158
+     * @param myParsers The parsers to register the command with
159
+     * @param register Whether to register or unregister the commands
159 160
      * @since 0.6.3m1
160 161
      */
161 162
     private static void registerCommand(final CommandInfo info, final Command command,

+ 2
- 2
src/com/dmdirc/commandparser/commands/Command.java Vedi File

@@ -88,8 +88,8 @@ public abstract class Command {
88 88
         for (int i = 0; i < headers.length; i++) {
89 89
             maxsizes[i] = headers[i].length() + 3;
90 90
             
91
-            for (int j = 0; j < data.length; j++) {
92
-                maxsizes[i] = Math.max(maxsizes[i], data[j][i].length() + 3);
91
+            for (String[] row : data) {
92
+                maxsizes[i] = Math.max(maxsizes[i], row[i].length() + 3);
93 93
             }
94 94
             
95 95
             doPadding(res, headers[i], maxsizes[i]);

+ 1
- 1
src/com/dmdirc/commandparser/commands/IntelligentCommand.java Vedi File

@@ -39,7 +39,7 @@ public interface IntelligentCommand {
39 39
      *
40 40
      * @since 0.6.4
41 41
      */
42
-    public static class IntelligentCommandContext {
42
+    class IntelligentCommandContext {
43 43
 
44 44
         /** The window the command is being entered in. */
45 45
         private final InputWindow window;

+ 1
- 1
src/com/dmdirc/commandparser/commands/channel/Cycle.java Vedi File

@@ -26,8 +26,8 @@ import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandInfo;
29
-import com.dmdirc.commandparser.CommandType;
30 29
 import com.dmdirc.commandparser.CommandManager;
30
+import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.CommandOptions;
33 33
 import com.dmdirc.commandparser.commands.context.ChannelCommandContext;

+ 1
- 1
src/com/dmdirc/commandparser/commands/channel/Invite.java Vedi File

@@ -27,8 +27,8 @@ import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28 28
 import com.dmdirc.commandparser.CommandArguments;
29 29
 import com.dmdirc.commandparser.CommandInfo;
30
-import com.dmdirc.commandparser.CommandType;
31 30
 import com.dmdirc.commandparser.CommandManager;
31
+import com.dmdirc.commandparser.CommandType;
32 32
 import com.dmdirc.commandparser.commands.Command;
33 33
 import com.dmdirc.commandparser.commands.CommandOptions;
34 34
 import com.dmdirc.commandparser.commands.ExternalCommand;

+ 1
- 1
src/com/dmdirc/commandparser/commands/channel/Mode.java Vedi File

@@ -27,8 +27,8 @@ import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28 28
 import com.dmdirc.commandparser.CommandArguments;
29 29
 import com.dmdirc.commandparser.CommandInfo;
30
-import com.dmdirc.commandparser.CommandType;
31 30
 import com.dmdirc.commandparser.CommandManager;
31
+import com.dmdirc.commandparser.CommandType;
32 32
 import com.dmdirc.commandparser.commands.Command;
33 33
 import com.dmdirc.commandparser.commands.CommandOptions;
34 34
 import com.dmdirc.commandparser.commands.ExternalCommand;

+ 0
- 1
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java Vedi File

@@ -56,7 +56,6 @@ public final class SetNickColour extends Command implements IntelligentCommand,
56 56
     }
57 57
     
58 58
     /** {@inheritDoc} */
59
-    @SuppressWarnings("unchecked")
60 59
     @Override
61 60
     public void execute(final FrameContainer<?> origin,
62 61
             final CommandArguments args, final CommandContext context) {

+ 1
- 1
src/com/dmdirc/commandparser/commands/global/AliasCommand.java Vedi File

@@ -105,7 +105,7 @@ public final class AliasCommand extends Command implements
105 105
      * @param name The name of the alias to remove
106 106
      * @return True if the alias was deleted, false otherwise
107 107
      */
108
-    private boolean doRemove(final String name) {
108
+    private static boolean doRemove(final String name) {
109 109
         for (Action alias : AliasWrapper.getAliasWrapper()) {
110 110
             if (AliasWrapper.getCommandName(alias).substring(1).equalsIgnoreCase(
111 111
                     name)) {

+ 4
- 9
src/com/dmdirc/commandparser/commands/global/Debug.java Vedi File

@@ -47,9 +47,9 @@ import com.dmdirc.updater.UpdateChecker;
47 47
 import java.io.Serializable;
48 48
 import java.util.Comparator;
49 49
 import java.util.Map;
50
-import java.util.Map.Entry;
51 50
 import java.util.SortedSet;
52 51
 import java.util.TreeSet;
52
+import java.util.Map.Entry;
53 53
 
54 54
 /**
55 55
  * Provides various handy ways to test or debug the client.
@@ -116,7 +116,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
116 116
      *
117 117
      * @param args The arguments that were passed to the command
118 118
      */
119
-    private void doError(final String ... args) {
119
+    private static void doError(final String ... args) {
120 120
         ErrorLevel el = ErrorLevel.HIGH;
121 121
         if (args.length > 2) {
122 122
             final String level = args[2];
@@ -258,7 +258,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
258 258
      *
259 259
      * @return Sorted set of config options and usages
260 260
      */
261
-    private SortedSet<Entry<String, Integer>> getSortedStats() {
261
+    private static SortedSet<Entry<String, Integer>> getSortedStats() {
262 262
         final SortedSet<Entry<String, Integer>> sortedStats =
263 263
                 new TreeSet<Entry<String, Integer>>(new ValueComparator());
264 264
         sortedStats.addAll(ConfigManager.getStats().entrySet());
@@ -414,7 +414,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
414 414
      * 
415 415
      * @param origin The window this command was executed in
416 416
      */
417
-    private void doBenchmark(final FrameContainer<?> origin) {
417
+    private static void doBenchmark(final FrameContainer<?> origin) {
418 418
         long[] results = new long[10];
419 419
         
420 420
         for (int i = 0; i < results.length; i++) {
@@ -534,11 +534,6 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
534 534
          */
535 535
         private static final long serialVersionUID = 1;
536 536
         
537
-        /** Instantiates a new ValueComparator. */
538
-        public ValueComparator() {
539
-            super();
540
-        }
541
-        
542 537
         /** {@inheritDoc} */
543 538
         @Override
544 539
         public int compare(final Entry<String, Integer> o1,

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/Ifplugin.java Vedi File

@@ -29,9 +29,9 @@ import com.dmdirc.commandparser.CommandInfo;
29 29
 import com.dmdirc.commandparser.CommandManager;
30 30
 import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32
-import com.dmdirc.commandparser.parsers.GlobalCommandParser;
33 32
 import com.dmdirc.commandparser.commands.IntelligentCommand;
34 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34
+import com.dmdirc.commandparser.parsers.GlobalCommandParser;
35 35
 import com.dmdirc.plugins.PluginInfo;
36 36
 import com.dmdirc.plugins.PluginManager;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -116,7 +116,7 @@ public final class Ifplugin extends Command implements IntelligentCommand,
116 116
     @Override
117 117
     public AdditionalTabTargets getSuggestions(final int arg,
118 118
             final IntelligentCommandContext context) {
119
-        AdditionalTabTargets res;
119
+        final AdditionalTabTargets res;
120 120
         
121 121
         if (arg == 0) {
122 122
             res = new AdditionalTabTargets().excludeAll();

+ 0
- 1
src/com/dmdirc/commandparser/commands/global/NewServer.java Vedi File

@@ -69,7 +69,6 @@ public final class NewServer extends Command implements IntelligentCommand,
69 69
         if (args.getArguments().length == 0) {
70 70
             showUsage(origin, args.isSilent(), "newserver",
71 71
                     "<host[:[+]port]> [password]");
72
-            address = null;
73 72
             return;
74 73
         } else if (args.getArguments().length == 1
75 74
                 && args.getArgumentsAsString().contains("://")) {

+ 1
- 1
src/com/dmdirc/commandparser/commands/global/OpenWindow.java Vedi File

@@ -73,7 +73,7 @@ public class OpenWindow extends Command implements IntelligentCommand, CommandIn
73 73
             showUsage(origin, args.isSilent(), "openwindow",
74 74
                     "[--server|--child] <name> [title]");
75 75
         } else {
76
-            FrameContainer<?> window;
76
+            final FrameContainer<?> window;
77 77
             
78 78
             if (parent == null) {
79 79
                 window = WindowManager.findCustomWindow(args.getArguments()[start]);

+ 1
- 0
src/com/dmdirc/commandparser/commands/global/Set.java Vedi File

@@ -94,6 +94,7 @@ public final class Set extends Command implements IntelligentCommand, CommandInf
94 94
                 doSetOption(origin, args.isSilent(), identity, args.getArguments()[i],
95 95
                         args.getArguments()[1 + i], args.getArgumentsAsString(2 + i));
96 96
             }
97
+            break;
97 98
         }
98 99
     }
99 100
 

+ 0
- 1
src/com/dmdirc/commandparser/commands/server/ChangeServer.java Vedi File

@@ -60,7 +60,6 @@ public final class ChangeServer extends Command implements CommandInfo {
60 60
         URI address = null;
61 61
         if (args.getArguments().length == 0) {
62 62
             showUsage(origin, args.isSilent(), "server", "<host[:[+]port]> [password]");
63
-            address = null;
64 63
             return;
65 64
         } else if (args.getArguments().length == 1
66 65
                 && args.getArgumentsAsString().contains("://")) {

+ 1
- 1
src/com/dmdirc/commandparser/commands/server/Disconnect.java Vedi File

@@ -52,7 +52,7 @@ public final class Disconnect extends Command implements CommandInfo {
52 52
     public void execute(final FrameContainer<?> origin,
53 53
             final CommandArguments args, final CommandContext context) {
54 54
         final Server server = ((ServerCommandContext) context).getServer();
55
-        String line;
55
+        final String line;
56 56
         
57 57
         if (args.getArguments().length == 0) {
58 58
             line = origin.getConfigManager().getOption("general", "quitmessage");

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java Vedi File

@@ -50,7 +50,7 @@ import java.util.List;
50 50
  * @since 0.6.3m1
51 51
  * @author chris
52 52
  */
53
-public final class JoinChannelCommand extends Command implements
53
+public class JoinChannelCommand extends Command implements
54 54
         ActionListener, IntelligentCommand, CommandInfo {
55 55
 
56 56
     /** A map of channel name mentions. */
@@ -146,7 +146,7 @@ public final class JoinChannelCommand extends Command implements
146 146
         final AdditionalTabTargets targets = new AdditionalTabTargets().excludeAll();
147 147
 
148 148
         final String prefix;
149
-        int index;
149
+        final int index;
150 150
         if ((index = context.getPartial().lastIndexOf(',')) > -1) {
151 151
             // If they are tab completing something containing a comma, we
152 152
             // add our results after the comma instead of returning them as-is.

+ 1
- 1
src/com/dmdirc/commandparser/commands/server/Reconnect.java Vedi File

@@ -52,7 +52,7 @@ public final class Reconnect extends Command implements CommandInfo {
52 52
     public void execute(final FrameContainer<?> origin,
53 53
             final CommandArguments args, final CommandContext context) {
54 54
         final Server server = ((ServerCommandContext) context).getServer();
55
-        String line;
55
+        final String line;
56 56
         
57 57
         if (args.getArguments().length == 0) {
58 58
             line = origin.getConfigManager().getOption("general", "reconnectmessage");

+ 1
- 1
src/com/dmdirc/commandparser/parsers/CommandParser.java Vedi File

@@ -71,7 +71,7 @@ public abstract class CommandParser implements Serializable {
71 71
     private final RollingList<PreviousCommand> history;
72 72
 
73 73
     /** Creates a new instance of CommandParser. */
74
-    public CommandParser() {
74
+    protected CommandParser() {
75 75
         commands = new Hashtable<String, CommandInfoPair>();
76 76
         history = new RollingList<PreviousCommand>(
77 77
                 IdentityManager.getGlobalConfig().getOptionInt("general",

+ 0
- 7
src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java Vedi File

@@ -51,13 +51,6 @@ public class GlobalCommandParser extends CommandParser {
51 51
      */
52 52
     private static GlobalCommandParser me;
53 53
     
54
-    /**
55
-     * Creates a new instance of the GlobalCommandParser.
56
-     */
57
-    public GlobalCommandParser() {
58
-        super();
59
-    }
60
-
61 54
     /** {@inheritDoc} */
62 55
     @Override
63 56
     public void setOwner(final FrameContainer<?> owner) {

+ 0
- 7
src/com/dmdirc/commandparser/parsers/ServerCommandParser.java Vedi File

@@ -52,13 +52,6 @@ public class ServerCommandParser extends GlobalCommandParser {
52 52
      */
53 53
     private Server server;
54 54
     
55
-    /**
56
-     * Creates a new instance of ServerCommandParser.
57
-     */
58
-    public ServerCommandParser() {
59
-        super();
60
-    }
61
-
62 55
     /** {@inheritDoc} */
63 56
     @Override
64 57
     public void setOwner(final FrameContainer<?> owner) {

Loading…
Annulla
Salva