Kaynağa Gözat

Style fixes

Change-Id: I94a245fd1824ba6a5c8c32e66a45a0c9be806aa1
Reviewed-on: http://gerrit.dmdirc.com/1750
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5rc1
Chris Smith 13 yıl önce
ebeveyn
işleme
68b0ed1d1f
42 değiştirilmiş dosya ile 83 ekleme ve 93 silme
  1. 1
    1
      src/com/dmdirc/CertificateManager.java
  2. 1
    1
      src/com/dmdirc/Channel.java
  3. 1
    1
      src/com/dmdirc/EventHandler.java
  4. 1
    3
      src/com/dmdirc/Main.java
  5. 6
    5
      src/com/dmdirc/MissingModeAliasException.java
  6. 2
    8
      src/com/dmdirc/Server.java
  7. 10
    15
      src/com/dmdirc/ServerEventHandler.java
  8. 1
    1
      src/com/dmdirc/ServerState.java
  9. 1
    0
      src/com/dmdirc/ServerStatus.java
  10. 4
    4
      src/com/dmdirc/actions/Action.java
  11. 1
    1
      src/com/dmdirc/actions/ActionComponentChain.java
  12. 7
    9
      src/com/dmdirc/actions/ActionManager.java
  13. 2
    2
      src/com/dmdirc/actions/ActionModel.java
  14. 1
    1
      src/com/dmdirc/actions/ConditionTree.java
  15. 1
    0
      src/com/dmdirc/actions/internal/WhoisNumericFormatter.java
  16. 1
    1
      src/com/dmdirc/actions/metatypes/ClientEvents.java
  17. 1
    1
      src/com/dmdirc/actions/validators/ActionGroupValidator.java
  18. 2
    2
      src/com/dmdirc/actions/validators/ActionNameValidator.java
  19. 1
    1
      src/com/dmdirc/actions/validators/ConditionRuleValidator.java
  20. 1
    1
      src/com/dmdirc/commandparser/CommandArguments.java
  21. 1
    1
      src/com/dmdirc/commandparser/PopupManager.java
  22. 1
    1
      src/com/dmdirc/commandparser/commands/Command.java
  23. 1
    1
      src/com/dmdirc/commandparser/commands/PreviousCommand.java
  24. 1
    3
      src/com/dmdirc/commandparser/commands/ValidatingCommand.java
  25. 1
    1
      src/com/dmdirc/commandparser/commands/chat/Me.java
  26. 1
    1
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  27. 1
    1
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  28. 2
    1
      src/com/dmdirc/commandparser/validators/CommandNameValidator.java
  29. 6
    6
      src/com/dmdirc/config/CipherUtils.java
  30. 1
    1
      src/com/dmdirc/config/IdentityManager.java
  31. 2
    2
      src/com/dmdirc/config/prefs/PreferencesDialogModel.java
  32. 1
    1
      src/com/dmdirc/installer/ui/StepSettings.java
  33. 2
    2
      src/com/dmdirc/installer/ui/WizardPanel.java
  34. 1
    1
      src/com/dmdirc/interfaces/NicklistListener.java
  35. 2
    1
      src/com/dmdirc/logger/ErrorManager.java
  36. 3
    3
      src/com/dmdirc/plugins/GlobalClassLoader.java
  37. 1
    0
      src/com/dmdirc/plugins/Plugin.java
  38. 2
    2
      src/com/dmdirc/plugins/PluginInfo.java
  39. 3
    2
      src/com/dmdirc/plugins/PluginManager.java
  40. 1
    1
      src/com/dmdirc/ui/core/util/URLHandler.java
  41. 2
    2
      src/com/dmdirc/ui/messages/Formatter.java
  42. 1
    1
      src/com/dmdirc/updater/UpdateChecker.java

+ 1
- 1
src/com/dmdirc/CertificateManager.java Dosyayı Görüntüle

@@ -315,7 +315,7 @@ public class CertificateManager implements X509TrustManager {
315 315
         }
316 316
 
317 317
         for (X509Certificate cert : chain) {
318
-            TrustResult trustResult = isTrusted(cert);
318
+            final TrustResult trustResult = isTrusted(cert);
319 319
 
320 320
             if (checkDate) {
321 321
                 // Check that the certificate is in-date

+ 1
- 1
src/com/dmdirc/Channel.java Dosyayı Görüntüle

@@ -506,7 +506,7 @@ public class Channel extends MessageTarget<ChannelWindow> implements ConfigChang
506 506
             getModes(client),
507 507
             Styliser.CODE_NICKNAME + client.getClient().getNickname() + Styliser.CODE_NICKNAME,
508 508
             client.getClient().getUsername(),
509
-            client.getClient().getHostname()
509
+            client.getClient().getHostname(),
510 510
         };
511 511
 
512 512
         if (showColours) {

+ 1
- 1
src/com/dmdirc/EventHandler.java Dosyayı Görüntüle

@@ -73,7 +73,7 @@ public abstract class EventHandler implements CallbackInterface {
73 73
      * @throws CallbackNotFoundException if the specified callback isn't found
74 74
      */
75 75
     protected abstract <T extends CallbackInterface> void addCallback(
76
-            final CallbackManager<?> cbm, final Class<T> type) throws CallbackNotFoundException;
76
+            final CallbackManager<?> cbm, final Class<T> type);
77 77
 
78 78
     /**
79 79
      * Retrieves the server belonging to this EventHandler's owner.

+ 1
- 3
src/com/dmdirc/Main.java Dosyayı Görüntüle

@@ -59,10 +59,8 @@ import java.util.logging.Level;
59 59
 
60 60
 /**
61 61
  * Main class, handles initialisation.
62
- *
63
- * @author chris
64 62
  */
65
-public class Main {
63
+public final class Main {
66 64
 
67 65
     /** Feedback nag delay. */
68 66
     private static final int FEEDBACK_DELAY = 30 * 60 * 1000;

+ 6
- 5
src/com/dmdirc/MissingModeAliasException.java Dosyayı Görüntüle

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -23,6 +23,7 @@
23 23
 package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.Parser;
26
+
26 27
 import java.util.List;
27 28
 
28 29
 /**
@@ -59,10 +60,10 @@ public class MissingModeAliasException extends Exception {
59 60
     }
60 61
 
61 62
     private static String arrayListToString(final List<String> lines) {
62
-        StringBuilder sb = new StringBuilder();
63
+        final StringBuilder sb = new StringBuilder();
63 64
 
64 65
         for (String line : lines) {
65
-            sb.append(line).append("\n");
66
+            sb.append(line).append('\n');
66 67
         }
67 68
 
68 69
         return sb.toString();

+ 2
- 8
src/com/dmdirc/Server.java Dosyayı Görüntüle

@@ -470,13 +470,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
470 470
      * @return list of channel names belonging to this server
471 471
      */
472 472
     public List<String> getChannels() {
473
-        final ArrayList<String> res = new ArrayList<String>();
474
-
475
-        for (String channel : channels.keySet()) {
476
-            res.add(channel);
477
-        }
478
-
479
-        return res;
473
+        return new ArrayList<String>(channels.keySet());
480 474
     }
481 475
 
482 476
     /**
@@ -1304,7 +1298,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
1304 1298
                 final Object[] arguments = new Object[]{
1305 1299
                     address.getHost(), parser == null ? "Unknown" : parser.getServerName(),
1306 1300
                     address.getPort(), parser == null ? "Unknown" : getNetwork(),
1307
-                    parser == null ? "Unknown" : parser.getLocalClient().getNickname()
1301
+                    parser == null ? "Unknown" : parser.getLocalClient().getNickname(),
1308 1302
                 };
1309 1303
 
1310 1304
                 setName(Formatter.formatMessage(getConfigManager(),

+ 10
- 15
src/com/dmdirc/ServerEventHandler.java Dosyayı Görüntüle

@@ -28,7 +28,6 @@ import com.dmdirc.logger.ErrorLevel;
28 28
 import com.dmdirc.logger.Logger;
29 29
 import com.dmdirc.parser.common.AwayState;
30 30
 import com.dmdirc.parser.common.CallbackManager;
31
-import com.dmdirc.parser.common.CallbackNotFoundException;
32 31
 import com.dmdirc.parser.common.ParserError;
33 32
 import com.dmdirc.parser.interfaces.ChannelInfo;
34 33
 import com.dmdirc.parser.interfaces.ClientInfo;
@@ -73,7 +72,7 @@ public final class ServerEventHandler extends EventHandler implements
73 72
     @Override
74 73
     @SuppressWarnings("unchecked")
75 74
     protected <T extends CallbackInterface> void addCallback(
76
-            final CallbackManager<?> cbm, final Class<T> type) throws CallbackNotFoundException {
75
+            final CallbackManager<?> cbm, final Class<T> type) {
77 76
         cbm.addCallback(type, (T) this);
78 77
     }
79 78
 
@@ -119,24 +118,20 @@ public final class ServerEventHandler extends EventHandler implements
119 118
 
120 119
         final StringBuilder errorString = new StringBuilder();
121 120
         errorString.append("Parser exception.\n\n");
122
-        
121
+
123 122
         errorString.append("\tLast line:\t");
124
-        errorString.append(errorInfo.getLastLine());
125
-        errorString.append("\n");
126
-       
123
+        errorString.append(errorInfo.getLastLine()).append('\n');
124
+
127 125
         errorString.append("\tServer:\t");
128
-        errorString.append(owner.getAddress());
129
-        errorString.append("\n");
130
-        
126
+        errorString.append(owner.getAddress()).append('\n');
127
+
131 128
         errorString.append("\tAdditional Information:\n");
132 129
         for (final String line : parser.getServerInformationLines()) {
133
-            errorString.append("\t\t");
134
-            errorString.append(line);
135
-            errorString.append("\n");
130
+            errorString.append("\t\t").append(line).append('\n');
136 131
         }
137 132
 
138
-        final Exception ex = (errorInfo.isException()) ? errorInfo.getException()
139
-                : new Exception(errorString.toString());
133
+        final Exception ex = errorInfo.isException() ? errorInfo.getException()
134
+                : new Exception(errorString.toString()); // NOPMD
140 135
 
141 136
         if (errorInfo.isUserError()) {
142 137
             Logger.userError(errorLevel, errorInfo.getData(), ex);
@@ -432,7 +427,7 @@ public final class ServerEventHandler extends EventHandler implements
432 427
     @Override
433 428
     protected void checkParser(final Parser parser) {
434 429
         super.checkParser(parser);
435
-        
430
+
436 431
         if (owner.getState() != ServerState.CONNECTED
437 432
                 && owner.getState() != ServerState.CONNECTING
438 433
                 && owner.getState() != ServerState.DISCONNECTING) {

+ 1
- 1
src/com/dmdirc/ServerState.java Dosyayı Görüntüle

@@ -110,4 +110,4 @@ public enum ServerState {
110 110
     public boolean isDisconnected() {
111 111
         return this == ServerState.DISCONNECTED || this == ServerState.TRANSIENTLY_DISCONNECTED;
112 112
     }
113
-}
113
+}

+ 1
- 0
src/com/dmdirc/ServerStatus.java Dosyayı Görüntüle

@@ -24,6 +24,7 @@ package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.Parser;
26 26
 import com.dmdirc.util.RollingList;
27
+
27 28
 import java.util.ArrayList;
28 29
 import java.util.List;
29 30
 

+ 4
- 4
src/com/dmdirc/actions/Action.java Dosyayı Görüntüle

@@ -65,15 +65,15 @@ public class Action extends ActionModel implements ConfigChangeListener {
65 65
     /** The domain name for misc settings. */
66 66
     private static final String DOMAIN_MISC = "misc".intern();
67 67
 
68
-    /** The location of the file we're reading/saving. */
69
-    private String location;
70
-
71 68
     /** Whether or not this action is disabled. */
72 69
     protected boolean disabled;
73 70
 
74 71
     /** The config file we're using. */
75 72
     protected ConfigFile config;
76 73
 
74
+    /** The location of the file we're reading/saving. */
75
+    private String location;
76
+
77 77
     /**
78 78
      * Creates a new instance of Action. The group and name specified must
79 79
      * be the group and name of a valid action already saved to disk.
@@ -388,7 +388,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
388 388
      * @param data The relevant section of the action configuration
389 389
      * @return True if the condition is valid, false otherwise
390 390
      */
391
-    private boolean readCondition(final Map<String,String> data) {
391
+    private boolean readCondition(final Map<String, String> data) {
392 392
         int arg = 0;
393 393
         ActionComponent component = null;
394 394
         ActionComparison comparison = null;

+ 1
- 1
src/com/dmdirc/actions/ActionComponentChain.java Dosyayı Görüntüle

@@ -166,4 +166,4 @@ public class ActionComponentChain implements ActionComponent {
166 166
         return res;
167 167
     }
168 168
 
169
-}
169
+}

+ 7
- 9
src/com/dmdirc/actions/ActionManager.java Dosyayı Görüntüle

@@ -48,8 +48,6 @@ import java.util.Map;
48 48
 
49 49
 /**
50 50
  * Manages all actions for the client.
51
- *
52
- * @author chris
53 51
  */
54 52
 public final class ActionManager {
55 53
 
@@ -106,7 +104,7 @@ public final class ActionManager {
106 104
         registerGroup(PerformWrapper.getPerformWrapper());
107 105
 
108 106
         new WhoisNumericFormatter(IdentityManager.getAddonIdentity()).register();
109
-       
107
+
110 108
         // Register a listener for the closing event, so we can save actions
111 109
         addListener(new ActionListener() {
112 110
             /** {@inheritDoc} */
@@ -128,7 +126,7 @@ public final class ActionManager {
128 126
             }
129 127
         });
130 128
     }
131
-    
129
+
132 130
     /**
133 131
      * Saves all actions.
134 132
      */
@@ -168,7 +166,7 @@ public final class ActionManager {
168 166
     public static void registerActionTypes(final ActionType[] types) {
169 167
         for (ActionType type : types) {
170 168
             Logger.assertTrue(type != null);
171
-            
169
+
172 170
             if(!ACTION_TYPES.contains(type)) {
173 171
                 ACTION_TYPES.add(type);
174 172
                 ACTIONTYPE_GROUPS.add(type.getType().getGroup(), type);
@@ -275,7 +273,7 @@ public final class ActionManager {
275 273
     private static void loadActions(final File dir) {
276 274
         Logger.assertTrue(dir != null);
277 275
         Logger.assertTrue(dir.isDirectory());
278
-        
276
+
279 277
         if (!GROUPS.containsKey(dir.getName())) {
280 278
             GROUPS.put(dir.getName(), new ActionGroup(dir.getName()));
281 279
         }
@@ -293,7 +291,7 @@ public final class ActionManager {
293 291
     @Precondition("The specified action is not null")
294 292
     public static void registerAction(final Action action) {
295 293
         Logger.assertTrue(action != null);
296
- 
294
+
297 295
         for (ActionType trigger : action.getTriggers()) {
298 296
             ACTIONS.add(trigger, action);
299 297
         }
@@ -352,7 +350,7 @@ public final class ActionManager {
352 350
         Logger.assertTrue(action != null);
353 351
 
354 352
         unregisterAction(action);
355
-        
353
+
356 354
         action.delete();
357 355
     }
358 356
 
@@ -456,7 +454,7 @@ public final class ActionManager {
456 454
      * Creates a new group with the specified name.
457 455
      *
458 456
      * @param group The group to be created
459
-     * 
457
+     *
460 458
      * @return The newly created group
461 459
      */
462 460
     @Precondition({

+ 2
- 2
src/com/dmdirc/actions/ActionModel.java Dosyayı Görüntüle

@@ -124,8 +124,8 @@ public class ActionModel {
124 124
     })
125 125
     public boolean trigger(final StringBuffer format,
126 126
             final Object... arguments) {
127
-        assert(triggers.length > 0);
128
-        assert(triggers[0] != null);
127
+        assert triggers.length > 0;
128
+        assert triggers[0] != null;
129 129
 
130 130
         final ActionSubstitutor sub = new ActionSubstitutor(triggers[0]);
131 131
 

+ 1
- 1
src/com/dmdirc/actions/ConditionTree.java Dosyayı Görüntüle

@@ -392,4 +392,4 @@ public class ConditionTree {
392 392
         return parseString(builder.toString());
393 393
     }
394 394
 
395
-}
395
+}

+ 1
- 0
src/com/dmdirc/actions/internal/WhoisNumericFormatter.java Dosyayı Görüntüle

@@ -28,6 +28,7 @@ import com.dmdirc.actions.CoreActionType;
28 28
 import com.dmdirc.actions.interfaces.ActionType;
29 29
 import com.dmdirc.config.Identity;
30 30
 import com.dmdirc.interfaces.ActionListener;
31
+
31 32
 import java.util.HashMap;
32 33
 import java.util.Map;
33 34
 

+ 1
- 1
src/com/dmdirc/actions/metatypes/ClientEvents.java Dosyayı Görüntüle

@@ -28,8 +28,8 @@ import com.dmdirc.commandparser.PopupMenu;
28 28
 import com.dmdirc.commandparser.PopupType;
29 29
 import com.dmdirc.config.ConfigManager;
30 30
 import com.dmdirc.config.prefs.PreferencesCategory;
31
-
32 31
 import com.dmdirc.config.prefs.PreferencesDialogModel;
32
+
33 33
 import javax.swing.KeyStroke;
34 34
 import javax.swing.text.StyledDocument;
35 35
 

+ 1
- 1
src/com/dmdirc/actions/validators/ActionGroupValidator.java Dosyayı Görüntüle

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.actions.validators;
24 24
 
25
+import com.dmdirc.actions.ActionManager;
25 26
 import com.dmdirc.util.validators.ValidationResponse;
26 27
 import com.dmdirc.util.validators.Validator;
27
-import com.dmdirc.actions.ActionManager;
28 28
 
29 29
 /**
30 30
  * Validates action groups.

+ 2
- 2
src/com/dmdirc/actions/validators/ActionNameValidator.java Dosyayı Görüntüle

@@ -22,10 +22,10 @@
22 22
 
23 23
 package com.dmdirc.actions.validators;
24 24
 
25
-import com.dmdirc.util.validators.ValidationResponse;
26
-import com.dmdirc.util.validators.Validator;
27 25
 import com.dmdirc.actions.Action;
28 26
 import com.dmdirc.actions.ActionGroup;
27
+import com.dmdirc.util.validators.ValidationResponse;
28
+import com.dmdirc.util.validators.Validator;
29 29
 
30 30
 import java.util.List;
31 31
 

+ 1
- 1
src/com/dmdirc/actions/validators/ConditionRuleValidator.java Dosyayı Görüntüle

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.actions.validators;
24 24
 
25
+import com.dmdirc.actions.ConditionTree;
25 26
 import com.dmdirc.util.validators.ValidationResponse;
26 27
 import com.dmdirc.util.validators.Validator;
27
-import com.dmdirc.actions.ConditionTree;
28 28
 
29 29
 /**
30 30
  * Validates a condition tree.

+ 1
- 1
src/com/dmdirc/commandparser/CommandArguments.java Dosyayı Görüntüle

@@ -187,7 +187,7 @@ public class CommandArguments {
187 187
     public String getWordsAsString(final int start, final int end) {
188 188
         Logger.assertTrue(start <= end + 1);
189 189
 
190
-        final Pattern pattern = Pattern.compile("(\\S+\\s+){" + (start) + "}"
190
+        final Pattern pattern = Pattern.compile("(\\S+\\s+){" + start + "}"
191 191
                 + "((\\S+\\s+){" + Math.max(0, end - start) + "}\\S+(\\s+$)?).*?");
192 192
         final Matcher matcher = pattern.matcher(line);
193 193
 

+ 1
- 1
src/com/dmdirc/commandparser/PopupManager.java Dosyayı Görüntüle

@@ -117,4 +117,4 @@ public class PopupManager {
117 117
         return res;
118 118
     }
119 119
 
120
-}
120
+}

+ 1
- 1
src/com/dmdirc/commandparser/commands/Command.java Dosyayı Görüntüle

@@ -83,7 +83,7 @@ public abstract class Command {
83 83
         res.append(Styliser.CODE_FIXED);
84 84
         res.append(Styliser.CODE_BOLD);
85 85
 
86
-        int[] maxsizes = new int[headers.length];
86
+        final int[] maxsizes = new int[headers.length];
87 87
 
88 88
         for (int i = 0; i < headers.length; i++) {
89 89
             maxsizes[i] = headers[i].length() + 3;

+ 1
- 1
src/com/dmdirc/commandparser/commands/PreviousCommand.java Dosyayı Görüntüle

@@ -93,4 +93,4 @@ public final class PreviousCommand {
93 93
         return hash;
94 94
     }
95 95
 
96
-}
96
+}

+ 1
- 3
src/com/dmdirc/commandparser/commands/ValidatingCommand.java Dosyayı Görüntüle

@@ -22,14 +22,12 @@
22 22
 package com.dmdirc.commandparser.commands;
23 23
 
24 24
 import com.dmdirc.commandparser.CommandArguments;
25
-import com.dmdirc.util.validators.ValidationResponse;
26 25
 import com.dmdirc.ui.interfaces.InputWindow;
26
+import com.dmdirc.util.validators.ValidationResponse;
27 27
 
28 28
 /**
29 29
  * Validating commands are capable of validating their arguments to determine
30 30
  * whether the input would be valid or not.
31
- *
32
- * @author chris
33 31
  */
34 32
 public interface ValidatingCommand {
35 33
 

+ 1
- 1
src/com/dmdirc/commandparser/commands/chat/Me.java Dosyayı Görüntüle

@@ -31,8 +31,8 @@ import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.ValidatingCommand;
32 32
 import com.dmdirc.commandparser.commands.context.ChatCommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34
-import com.dmdirc.util.validators.ValidationResponse;
35 34
 import com.dmdirc.ui.interfaces.InputWindow;
35
+import com.dmdirc.util.validators.ValidationResponse;
36 36
 
37 37
 /**
38 38
  * The me command sends a CTCP action to the current channel.

+ 1
- 1
src/com/dmdirc/commandparser/commands/global/NewServer.java Dosyayı Görüntüle

@@ -99,7 +99,7 @@ public final class NewServer extends Command implements IntelligentCommand,
99 99
      */
100 100
     public static URI getURI(final String address) throws URISyntaxException {
101 101
         final URI uri = new URI(address);
102
-        int port = uri.getPort();
102
+        final int port = uri.getPort();
103 103
 
104 104
         // Either no port specified, or a +port was used, lets try to find one.
105 105
         // Otherwise just return the URI.

+ 1
- 1
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java Dosyayı Görüntüle

@@ -78,7 +78,7 @@ public class JoinChannelCommand extends Command implements
78 78
         final List<ChannelJoinRequest> channels = new ArrayList<ChannelJoinRequest>();
79 79
 
80 80
         for (String pair : args.getArgumentsAsString().split(",")) {
81
-            int index = pair.trim().indexOf(' ');
81
+            final int index = pair.trim().indexOf(' ');
82 82
 
83 83
             if (index == -1) {
84 84
                 channels.add(new ChannelJoinRequest(pair));

+ 2
- 1
src/com/dmdirc/commandparser/validators/CommandNameValidator.java Dosyayı Görüntüle

@@ -22,9 +22,10 @@
22 22
 
23 23
 package com.dmdirc.commandparser.validators;
24 24
 
25
+import com.dmdirc.commandparser.CommandManager;
25 26
 import com.dmdirc.util.validators.RegexStringValidator;
26 27
 import com.dmdirc.util.validators.ValidatorChain;
27
-import com.dmdirc.commandparser.CommandManager;
28
+
28 29
 import java.util.regex.Pattern;
29 30
 
30 31
 /**

+ 6
- 6
src/com/dmdirc/config/CipherUtils.java Dosyayı Görüntüle

@@ -56,12 +56,6 @@ public class CipherUtils {
56 56
     /** Singleton instance. */
57 57
     private static CipherUtils me;
58 58
 
59
-    /** Encryption cipher. */
60
-    private Cipher ecipher;
61
-
62
-    /** Decryption cipher. */
63
-    private Cipher dcipher;
64
-
65 59
     /** Salt. */
66 60
     private static final byte[] SALT = {
67 61
         (byte) 0xA9, (byte) 0x9B, (byte) 0xC8, (byte) 0x32,
@@ -74,6 +68,12 @@ public class CipherUtils {
74 68
     /** Number of auth attemps before failing the attempt. */
75 69
     private static final int AUTH_TRIES = 4;
76 70
 
71
+    /** Encryption cipher. */
72
+    private Cipher ecipher;
73
+
74
+    /** Decryption cipher. */
75
+    private Cipher dcipher;
76
+
77 77
     /** User password. */
78 78
     private String password;
79 79
 

+ 1
- 1
src/com/dmdirc/config/IdentityManager.java Dosyayı Görüntüle

@@ -137,7 +137,7 @@ public final class IdentityManager {
137 137
         final String dir = getDirectory();
138 138
 
139 139
         for (String target : targets) {
140
-            File file = new File(dir + target);
140
+            final File file = new File(dir + target);
141 141
 
142 142
             if (file.exists() && !file.isDirectory()) {
143 143
                 boolean success = false;

+ 2
- 2
src/com/dmdirc/config/prefs/PreferencesDialogModel.java Dosyayı Görüntüle

@@ -24,12 +24,12 @@ package com.dmdirc.config.prefs;
24 24
 
25 25
 import com.dmdirc.actions.ActionManager;
26 26
 import com.dmdirc.actions.CoreActionType;
27
-import com.dmdirc.util.validators.NumericalValidator;
28
-import com.dmdirc.util.validators.OptionalValidator;
29 27
 import com.dmdirc.plugins.PluginManager;
30 28
 import com.dmdirc.plugins.Service;
31 29
 import com.dmdirc.ui.interfaces.UIController;
32 30
 import com.dmdirc.util.ListenerList;
31
+import com.dmdirc.util.validators.NumericalValidator;
32
+import com.dmdirc.util.validators.OptionalValidator;
33 33
 
34 34
 import java.util.ArrayList;
35 35
 import java.util.Collections;

+ 1
- 1
src/com/dmdirc/installer/ui/StepSettings.java Dosyayı Görüntüle

@@ -69,7 +69,7 @@ public final class StepSettings extends SwingStep implements Settings {
69 69
     public StepSettings() {
70 70
         super();
71 71
 
72
-        DefaultSettings defaultSettings = new DefaultSettings();
72
+        final DefaultSettings defaultSettings = new DefaultSettings();
73 73
         shortcutMenu.setSelected(defaultSettings.getShortcutMenuState());
74 74
         shortcutDesktop.setSelected(defaultSettings.getShortcutDesktopState());
75 75
         shortcutQuick.setSelected(defaultSettings.getShortcutQuickState());

+ 2
- 2
src/com/dmdirc/installer/ui/WizardPanel.java Dosyayı Görüntüle

@@ -88,13 +88,13 @@ public class WizardPanel extends JPanel {
88 88
      * @return Step
89 89
      */
90 90
     public Step getStep(final String stepName) {
91
-        Step step = null;
92 91
         for (SwingStep loopStep : layout.getSteps()) {
93 92
             if (stepName.equals(loopStep.getStepName())) {
94 93
                 return loopStep;
95 94
             }
96 95
         }
97
-        return step;
96
+
97
+        return null;
98 98
     }
99 99
 
100 100
     /**

+ 1
- 1
src/com/dmdirc/interfaces/NicklistListener.java Dosyayı Görüntüle

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.interfaces;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
26
+
26 27
 import java.util.Collection;
27 28
 
28 29
 /**
@@ -30,7 +31,6 @@ import java.util.Collection;
30 31
  * channel's list of active users (the 'nicklist').
31 32
  *
32 33
  * @since 0.6.5
33
- * @author chris
34 34
  */
35 35
 public interface NicklistListener {
36 36
 

+ 2
- 1
src/com/dmdirc/logger/ErrorManager.java Dosyayı Görüntüle

@@ -48,7 +48,8 @@ public final class ErrorManager implements ConfigChangeListener {
48 48
     private static final Class[] BANNED_EXCEPTIONS = new Class[]{
49 49
         NoSuchMethodError.class, NoClassDefFoundError.class,
50 50
         UnsatisfiedLinkError.class, AbstractMethodError.class,
51
-        IllegalAccessError.class, OutOfMemoryError.class, NoSuchFieldError.class
51
+        IllegalAccessError.class, OutOfMemoryError.class,
52
+        NoSuchFieldError.class,
52 53
     };
53 54
 
54 55
     /** Whether or not to send error reports. */

+ 3
- 3
src/com/dmdirc/plugins/GlobalClassLoader.java Dosyayı Görüntüle

@@ -101,7 +101,7 @@ public final class GlobalClassLoader extends ClassLoader {
101 101
         try {
102 102
             return super.loadClass(name);
103 103
         } catch (ClassNotFoundException e) {
104
-            byte[] data = getClassData(name);
104
+            final byte[] data = getClassData(name);
105 105
             if (data != null) {
106 106
                 return defineClass(name, data);
107 107
             }
@@ -109,7 +109,7 @@ public final class GlobalClassLoader extends ClassLoader {
109 109
 
110 110
         // Check the other plugins.
111 111
         for (PluginInfo pi : PluginManager.getPluginManager().getPluginInfos()) {
112
-            List<String> classList = pi.getClassList();
112
+            final List<String> classList = pi.getClassList();
113 113
             if (classList.contains(name) && pi.getPluginClassLoader() != null) {
114 114
                 return pi.getPluginClassLoader().loadClass(name, false);
115 115
             }
@@ -137,7 +137,7 @@ public final class GlobalClassLoader extends ClassLoader {
137 137
         try {
138 138
             final String jarname = resourcesList.get(classname);
139 139
             if (jarname != null) {
140
-                ResourceManager rm = ResourceManager.getResourceManager("jar://" + jarname);
140
+                final ResourceManager rm = ResourceManager.getResourceManager("jar://" + jarname);
141 141
                 final String filename = classname.replace('.', '/') + ".class";
142 142
                 if (rm.resourceExists(filename)) {
143 143
                     return rm.getResourceBytes(filename);

+ 1
- 0
src/com/dmdirc/plugins/Plugin.java Dosyayı Görüntüle

@@ -24,6 +24,7 @@ package com.dmdirc.plugins;
24 24
 
25 25
 import com.dmdirc.config.prefs.PreferencesDialogModel;
26 26
 import com.dmdirc.util.validators.ValidationResponse;
27
+
27 28
 import java.io.File;
28 29
 
29 30
 /**

+ 2
- 2
src/com/dmdirc/plugins/PluginInfo.java Dosyayı Görüntüle

@@ -27,13 +27,13 @@ import com.dmdirc.actions.CoreActionType;
27 27
 import com.dmdirc.config.Identity;
28 28
 import com.dmdirc.config.IdentityManager;
29 29
 import com.dmdirc.config.InvalidIdentityFileException;
30
-import com.dmdirc.util.validators.ValidationResponse;
31 30
 import com.dmdirc.logger.ErrorLevel;
32 31
 import com.dmdirc.logger.Logger;
33 32
 import com.dmdirc.updater.Version;
34 33
 import com.dmdirc.util.ConfigFile;
35 34
 import com.dmdirc.util.InvalidConfigFileException;
36 35
 import com.dmdirc.util.resourcemanager.ResourceManager;
36
+import com.dmdirc.util.validators.ValidationResponse;
37 37
 
38 38
 import java.io.File;
39 39
 import java.io.IOException;
@@ -1037,7 +1037,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
1037 1037
             return false;
1038 1038
         } else {
1039 1039
             final String unloadable = getKeyValue("metadata", "unloadable", "true");
1040
-            return (unloadable.equalsIgnoreCase("yes") || unloadable.equalsIgnoreCase("true") || unloadable.equalsIgnoreCase("1"));
1040
+            return unloadable.equalsIgnoreCase("yes") || unloadable.equalsIgnoreCase("true") || unloadable.equalsIgnoreCase("1");
1041 1041
         }
1042 1042
     }
1043 1043
 

+ 3
- 2
src/com/dmdirc/plugins/PluginManager.java Dosyayı Görüntüle

@@ -38,6 +38,7 @@ import java.net.MalformedURLException;
38 38
 import java.net.URL;
39 39
 import java.util.ArrayList;
40 40
 import java.util.Collection;
41
+import java.util.Deque;
41 42
 import java.util.HashMap;
42 43
 import java.util.LinkedList;
43 44
 import java.util.List;
@@ -299,7 +300,7 @@ public class PluginManager implements ActionListener {
299 300
             return false;
300 301
         }
301 302
 
302
-        PluginInfo pluginInfo = getPluginInfo(filename);
303
+        final PluginInfo pluginInfo = getPluginInfo(filename);
303 304
         final boolean wasLoaded = pluginInfo.isLoaded();
304 305
 
305 306
         if (wasLoaded && !pluginInfo.isUnloadable()) { return false; }
@@ -411,7 +412,7 @@ public class PluginManager implements ActionListener {
411 412
     public List<PluginInfo> getPossiblePluginInfos(final boolean addPlugins) {
412 413
         final Map<String, PluginInfo> res = new HashMap<String, PluginInfo>();
413 414
 
414
-        final LinkedList<File> dirs = new LinkedList<File>();
415
+        final Deque<File> dirs = new LinkedList<File>();
415 416
 
416 417
         dirs.add(new File(myDir));
417 418
 

+ 1
- 1
src/com/dmdirc/ui/core/util/URLHandler.java Dosyayı Görüntüle

@@ -114,7 +114,7 @@ public class URLHandler {
114 114
     protected static String getSanitisedString(final String urlString) {
115 115
         String sanitisedString = urlString.replace("|", "%7C");
116 116
 
117
-        int index = sanitisedString.indexOf('#');
117
+        final int index = sanitisedString.indexOf('#');
118 118
         if (sanitisedString.lastIndexOf('#') > index) {
119 119
             sanitisedString = sanitisedString.substring(0, index + 1)
120 120
                     + sanitisedString.substring(index + 1).replace("#", "%23");

+ 2
- 2
src/com/dmdirc/ui/messages/Formatter.java Dosyayı Görüntüle

@@ -61,7 +61,7 @@ public final class Formatter {
61 61
     @Precondition("The specified message type is not null")
62 62
     public static String formatMessage(final ConfigManager config, final String messageType,
63 63
             final Object... arguments) {
64
-        assert(messageType != null);
64
+        assert messageType != null;
65 65
 
66 66
         final String res = config.hasOptionString("formatter", messageType) ?
67 67
             config.getOption("formatter", messageType).replace("%-1$", "%"
@@ -99,7 +99,7 @@ public final class Formatter {
99 99
      */
100 100
     @Precondition("The specified format is not null")
101 101
     private static Object[] castArguments(final String format, final Object[] args) {
102
-        assert(format != null);
102
+        assert format != null;
103 103
 
104 104
         if (!TYPE_CACHE.containsKey(format)) {
105 105
             analyseFormat(format, args);

+ 1
- 1
src/com/dmdirc/updater/UpdateChecker.java Dosyayı Görüntüle

@@ -363,7 +363,7 @@ public final class UpdateChecker implements Runnable {
363 363
      */
364 364
     @Precondition("The specified name is not null")
365 365
     public static UpdateComponent findComponent(final String name) {
366
-        assert(name != null);
366
+        assert name != null;
367 367
 
368 368
         for (UpdateComponent component : COMPONENTS) {
369 369
             if (name.equals(component.getName())) {

Loading…
İptal
Kaydet