Browse Source

Style fixes

Change-Id: I1a3166e5b4f21430b119f5a2692c8554e192aec1
Reviewed-on: http://gerrit.dmdirc.com/1329
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
6b0a81a27b
55 changed files with 167 additions and 190 deletions
  1. 1
    1
      src/com/dmdirc/addons/dcc/TransferContainer.java
  2. 1
    1
      src/com/dmdirc/addons/dcc/io/DCC.java
  3. 4
    4
      src/com/dmdirc/addons/dcc/kde/KDialogProcess.java
  4. 1
    1
      src/com/dmdirc/addons/dcc/ui/EmptyWindow.java
  5. 1
    1
      src/com/dmdirc/addons/dcc/ui/PlaceholderWindow.java
  6. 1
    1
      src/com/dmdirc/addons/dcc/ui/TransferWindow.java
  7. 0
    1
      src/com/dmdirc/addons/dcop/DcopCommand.java
  8. 4
    6
      src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java
  9. 9
    10
      src/com/dmdirc/addons/freedesktop_notifications/commons/Entities.java
  10. 9
    9
      src/com/dmdirc/addons/freedesktop_notifications/commons/IntHashMap.java
  11. 6
    7
      src/com/dmdirc/addons/freedesktop_notifications/commons/StringEscapeUtils.java
  12. 1
    1
      src/com/dmdirc/addons/lagdisplay/PingHistoryPanel.java
  13. 0
    1
      src/com/dmdirc/addons/logging/LoggingCommand.java
  14. 1
    1
      src/com/dmdirc/addons/logging/ReverseFileReader.java
  15. 1
    1
      src/com/dmdirc/addons/mediasource_windows/DllSource.java
  16. 2
    2
      src/com/dmdirc/addons/nickcolours/NickColourPanel.java
  17. 1
    1
      src/com/dmdirc/addons/nowplaying/ConfigPanel.java
  18. 31
    31
      src/com/dmdirc/addons/nowplaying/MediaSourceState.java
  19. 1
    1
      src/com/dmdirc/addons/parser_twitter/TwitterCallbackObject.java
  20. 1
    1
      src/com/dmdirc/addons/parser_twitter/TwitterCallbackObjectSpecific.java
  21. 1
    3
      src/com/dmdirc/addons/parser_twitter/TwitterClientInfo.java
  22. 9
    10
      src/com/dmdirc/addons/parser_twitter/api/commons/Entities.java
  23. 9
    9
      src/com/dmdirc/addons/parser_twitter/api/commons/IntHashMap.java
  24. 6
    6
      src/com/dmdirc/addons/parser_twitter/api/commons/StringEscapeUtils.java
  25. 0
    2
      src/com/dmdirc/addons/relaybot/RelayChannelHandler.java
  26. 11
    10
      src/com/dmdirc/addons/scriptplugin/JavaScriptHelper.java
  27. 2
    2
      src/com/dmdirc/addons/scriptplugin/TypedProperties.java
  28. 1
    1
      src/com/dmdirc/addons/ui_swing/Apple.java
  29. 0
    1
      src/com/dmdirc/addons/ui_swing/SwingController.java
  30. 2
    2
      src/com/dmdirc/addons/ui_swing/components/MenuScroller.java
  31. 1
    2
      src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java
  32. 0
    2
      src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer.java
  33. 1
    3
      src/com/dmdirc/addons/ui_swing/components/renderers/AddonCellRenderer.java
  34. 1
    2
      src/com/dmdirc/addons/ui_swing/components/statusbar/ErrorPanel.java
  35. 1
    1
      src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java
  36. 1
    1
      src/com/dmdirc/addons/ui_swing/components/vetoable/VetoableChangeEvent.java
  37. 6
    6
      src/com/dmdirc/addons/ui_swing/dialogs/FeedbackDialog.java
  38. 0
    1
      src/com/dmdirc/addons/ui_swing/dialogs/StandardDialog.java
  39. 3
    3
      src/com/dmdirc/addons/ui_swing/dialogs/StandardInputDialog.java
  40. 3
    3
      src/com/dmdirc/addons/ui_swing/dialogs/StandardMessageDialog.java
  41. 3
    3
      src/com/dmdirc/addons/ui_swing/dialogs/StandardQuestionDialog.java
  42. 1
    2
      src/com/dmdirc/addons/ui_swing/dialogs/about/LicenceLoader.java
  43. 2
    2
      src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryLabel.java
  44. 1
    1
      src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuInterface.java
  45. 0
    1
      src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem.java
  46. 3
    6
      src/com/dmdirc/addons/ui_swing/textpane/TextPaneCanvas.java
  47. 1
    1
      src/com/dmdirc/addons/ui_swing/wizard/Step.java
  48. 15
    15
      src/com/dmdirc/addons/ui_web/DynamicRequestHandler.java
  49. 0
    1
      src/com/dmdirc/addons/ui_web/WebInterfaceUI.java
  50. 0
    1
      test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java
  51. 2
    2
      test/com/dmdirc/addons/ui_swing/UIUtilitiesTest.java
  52. 1
    1
      test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java
  53. 2
    0
      test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanelTest.java
  54. 1
    1
      test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsManagerDialogTest.java
  55. 1
    1
      test/com/dmdirc/harness/ui/DMDircUITestCase.java

+ 1
- 1
src/com/dmdirc/addons/dcc/TransferContainer.java View File

@@ -188,7 +188,7 @@ public class TransferContainer extends FrameContainer<TransferWindow> implements
188 188
         final long time = getElapsedTime();
189 189
 
190 190
         synchronized (this) {
191
-            return time > 0 ? (transferCount / time) : transferCount;
191
+            return time > 0 ? ((double) transferCount / time) : transferCount;
192 192
         }
193 193
     }
194 194
 

+ 1
- 1
src/com/dmdirc/addons/dcc/io/DCC.java View File

@@ -324,7 +324,7 @@ public abstract class DCC implements Runnable {
324 324
      * @return ip as a long
325 325
      */
326 326
     public static long ipToLong(final String ip) {
327
-        final String bits[] = ip.split("\\.");
327
+        final String[] bits = ip.split("\\.");
328 328
         if (bits.length > 3) {
329 329
             return (Long.parseLong(bits[0]) << 24) + (Long.parseLong(bits[1]) << 16)
330 330
                     + (Long.parseLong(bits[2]) << 8) + Long.parseLong(bits[3]);

+ 4
- 4
src/com/dmdirc/addons/dcc/kde/KDialogProcess.java View File

@@ -32,10 +32,10 @@ import java.util.ArrayList;
32 32
 public class KDialogProcess {
33 33
 
34 34
     /** Is kdialog in /bin? */
35
-    private final static boolean isBin = (new File("/bin/kdialog")).exists();
35
+    private static final boolean IS_BIN = (new File("/bin/kdialog")).exists();
36 36
 
37 37
     /** Does KDialog exist? */
38
-    private final static boolean hasKDialog = (new File("/usr/bin/kdialog")).exists() || isBin;
38
+    private static final boolean HAS_KDIALOG = (new File("/usr/bin/kdialog")).exists() || IS_BIN;
39 39
 
40 40
     /** Stream for the stdout stream for this process */
41 41
     private final StreamReader stdOutputStream;
@@ -54,7 +54,7 @@ public class KDialogProcess {
54 54
     public KDialogProcess(final String[] params) throws IOException {
55 55
         final String[] exec = new String[params.length + 1];
56 56
         System.arraycopy(params, 0, exec, 1, params.length);
57
-        exec[0] = (isBin) ? "/bin/kdialog" : "/usr/bin/kdialog";
57
+        exec[0] = (IS_BIN) ? "/bin/kdialog" : "/usr/bin/kdialog";
58 58
         process = Runtime.getRuntime().exec(exec);
59 59
         stdOutputStream = new StreamReader(process.getInputStream(), new ArrayList<String>());
60 60
         stdErrorStream = new StreamReader(process.getErrorStream(), new ArrayList<String>());
@@ -68,7 +68,7 @@ public class KDialogProcess {
68 68
      * @return True if kdialog was found, else false
69 69
      */
70 70
     public static boolean hasKDialog() {
71
-        return hasKDialog;
71
+        return HAS_KDIALOG;
72 72
     }
73 73
 
74 74
     /**

+ 1
- 1
src/com/dmdirc/addons/dcc/ui/EmptyWindow.java View File

@@ -35,7 +35,7 @@ import javax.swing.JPopupMenu;
35 35
 public class EmptyWindow extends TextFrame {
36 36
 
37 37
     /** A version number for this class. */
38
-    private static final long serialVersionUID = 2l;
38
+    private static final long serialVersionUID = 2L;
39 39
 
40 40
     /**
41 41
      * Creates a new empty window for the specified UI controller and owner.

+ 1
- 1
src/com/dmdirc/addons/dcc/ui/PlaceholderWindow.java View File

@@ -36,7 +36,7 @@ import com.dmdirc.addons.ui_swing.components.text.TextLabel;
36 36
 public class PlaceholderWindow extends EmptyWindow {
37 37
 
38 38
     /** A version number for this class. */
39
-    private static final long serialVersionUID = 1l;
39
+    private static final long serialVersionUID = 1L;
40 40
 
41 41
     /**
42 42
      * Creates a new placeholder window for the specified UI controller and owner.

+ 1
- 1
src/com/dmdirc/addons/dcc/ui/TransferWindow.java View File

@@ -56,7 +56,7 @@ public class TransferWindow extends EmptyWindow implements ActionListener,
56 56
         SocketCloseListener, DCCTransferHandler {
57 57
 
58 58
     /** A version number for this class. */
59
-    private static final long serialVersionUID = 1l;
59
+    private static final long serialVersionUID = 1L;
60 60
 
61 61
     /** Progress Bar */
62 62
     private final JProgressBar progress = new JProgressBar();

+ 0
- 1
src/com/dmdirc/addons/dcop/DcopCommand.java View File

@@ -53,7 +53,6 @@ public final class DcopCommand extends Command implements CommandInfo {
53 53
     @Override
54 54
     public void execute(final FrameContainer<?> origin,
55 55
             final CommandArguments args, final CommandContext context) {
56
-        final Server server = ((ServerCommandContext) context).getServer();
57 56
         if (args.getArguments().length != 3) {
58 57
             showUsage(origin, args.isSilent(), "dcop", "<app> <object> <function>");
59 58
             return;

+ 4
- 6
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java View File

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.freedesktop_notifications;
24 24
 
25
-import com.dmdirc.Main;
26 25
 import com.dmdirc.addons.freedesktop_notifications.commons.StringEscapeUtils;
27 26
 import com.dmdirc.commandparser.CommandManager;
28 27
 import com.dmdirc.config.IdentityManager;
@@ -41,7 +40,6 @@ import com.dmdirc.plugins.PluginManager;
41 40
 import com.dmdirc.ui.messages.Styliser;
42 41
 import com.dmdirc.util.resourcemanager.ResourceManager;
43 42
 
44
-import java.io.File;
45 43
 import java.io.IOException;
46 44
 import java.util.ArrayList;
47 45
 
@@ -121,11 +119,11 @@ public final class FreeDesktopNotificationsPlugin extends Plugin implements Conf
121 119
      * @param input Input string
122 120
      * @return Input string after being processed according to config settings.
123 121
      */
124
-    public final String prepareString(final String input) {
122
+    public String prepareString(final String input) {
125 123
         String output = input;
126 124
         if (stripcodes) { output = Styliser.stipControlCodes(output); }
127 125
         if (escapehtml) {
128
-	    if (strictescape) {
126
+            if (strictescape) {
129 127
                 output = StringEscapeUtils.escapeHtml(output);
130 128
             } else {
131 129
                 output = output.replace("&", "&amp;");
@@ -192,7 +190,7 @@ public final class FreeDesktopNotificationsPlugin extends Plugin implements Conf
192 190
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER, getDomain(), "general.timeout", "Timeout", "Length of time in seconds before the notification popup closes."));
193 191
         general.addSetting(new PreferencesSetting(PreferencesType.FILE, getDomain(), "general.icon", "icon", "Path to icon to use on the notification."));
194 192
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.escapehtml", "Escape HTML", "Some Implementations randomly parse HTML, escape it before showing?"));
195
-	general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.strictescape", "Strict Escape HTML", "Strictly escape HTML or just the basic characters? (&, < and >)"));
193
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.strictescape", "Strict Escape HTML", "Strictly escape HTML or just the basic characters? (&, < and >)"));
196 194
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.stripcodes", "Strip Control Codes", "Strip IRC Control codes from messages?"));
197 195
         
198 196
         manager.getCategory("Plugins").addSubCategory(general);
@@ -202,7 +200,7 @@ public final class FreeDesktopNotificationsPlugin extends Plugin implements Conf
202 200
         timeout = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "general.timeout");
203 201
         icon = IdentityManager.getGlobalConfig().getOption(getDomain(), "general.icon");
204 202
         escapehtml = IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "advanced.escapehtml");
205
-	strictescape = IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "advanced.strictescape");
203
+        strictescape = IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "advanced.strictescape");
206 204
         stripcodes = IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "advanced.stripcodes");
207 205
     }
208 206
 

+ 9
- 10
src/com/dmdirc/addons/freedesktop_notifications/commons/Entities.java View File

@@ -150,9 +150,9 @@ class Entities {
150 150
     };
151 151
 
152 152
     // package scoped for testing
153
-    static int ISO8859_1_ARRAY_LENGTH = ISO8859_1_ARRAY.length;
153
+    static final int ISO8859_1_ARRAY_LENGTH = ISO8859_1_ARRAY.length;
154 154
     
155
-    static String getISO8859_1(int i, int j) {
155
+    static String getISO88591(int i, int j) {
156 156
         return ISO8859_1_ARRAY[i][j];
157 157
     }
158 158
 
@@ -355,7 +355,7 @@ class Entities {
355 355
     };
356 356
     
357 357
     // package scoped for testing
358
-    static int HTML40_ARRAY_LENGTH = HTML40_ARRAY.length;
358
+    static final int HTML40_ARRAY_LENGTH = HTML40_ARRAY.length;
359 359
     
360 360
     static String getHTML40(int i, int j) {
361 361
         return HTML40_ARRAY[i][j];
@@ -481,7 +481,7 @@ class Entities {
481 481
         }
482 482
     }
483 483
 
484
-    static abstract class MapIntMap implements Entities.EntityMap {
484
+    abstract static class MapIntMap implements Entities.EntityMap {
485 485
         protected Map<String, Integer> mapNameToValue;
486 486
 
487 487
         protected Map<Integer, String> mapValueToName;
@@ -536,7 +536,7 @@ class Entities {
536 536
     static class LookupEntityMap extends PrimitiveEntityMap {
537 537
         private String[] lookupTable;
538 538
 
539
-        private int LOOKUP_TABLE_SIZE = 256;
539
+        private static final int LOOKUP_TABLE_SIZE = 256;
540 540
 
541 541
         /**
542 542
          * {@inheritDoc}
@@ -972,14 +972,13 @@ class Entities {
972 972
                             char isHexChar = entityContent.charAt(1);
973 973
                             try {
974 974
                                 switch (isHexChar) {
975
-                                    case 'X' :
976
-                                    case 'x' : {
975
+                                    case 'X':
976
+                                    case 'x':
977 977
                                         entityValue = Integer.parseInt(entityContent.substring(2), 16);
978 978
                                         break;
979
-                                    }
980
-                                    default : {
979
+                                    default:
981 980
                                         entityValue = Integer.parseInt(entityContent.substring(1), 10);
982
-                                    }
981
+                                        break;
983 982
                                 }
984 983
                                 if (entityValue > 0xFFFF) {
985 984
                                     entityValue = -1;

+ 9
- 9
src/com/dmdirc/addons/freedesktop_notifications/commons/IntHashMap.java View File

@@ -40,7 +40,7 @@ class IntHashMap {
40 40
     /**
41 41
      * The hash table data.
42 42
      */
43
-    private transient Entry table[];
43
+    private transient Entry[] table;
44 44
 
45 45
     /**
46 46
      * The total number of entries in the hash table.
@@ -176,7 +176,7 @@ class IntHashMap {
176 176
             throw new NullPointerException();
177 177
         }
178 178
 
179
-        Entry tab[] = table;
179
+        Entry[] tab = table;
180 180
         for (int i = tab.length; i-- > 0;) {
181 181
             for (Entry e = tab[i]; e != null; e = e.next) {
182 182
                 if (e.value.equals(value)) {
@@ -213,7 +213,7 @@ class IntHashMap {
213 213
      * @see #contains(Object)
214 214
      */
215 215
     public boolean containsKey(int key) {
216
-        Entry tab[] = table;
216
+        Entry[] tab = table;
217 217
         int hash = key;
218 218
         int index = (hash & 0x7FFFFFFF) % tab.length;
219 219
         for (Entry e = tab[index]; e != null; e = e.next) {
@@ -234,7 +234,7 @@ class IntHashMap {
234 234
      * @see     #put(int, Object)
235 235
      */
236 236
     public Object get(int key) {
237
-        Entry tab[] = table;
237
+        Entry[] tab = table;
238 238
         int hash = key;
239 239
         int index = (hash & 0x7FFFFFFF) % tab.length;
240 240
         for (Entry e = tab[index]; e != null; e = e.next) {
@@ -256,10 +256,10 @@ class IntHashMap {
256 256
      */
257 257
     protected void rehash() {
258 258
         int oldCapacity = table.length;
259
-        Entry oldMap[] = table;
259
+        Entry[] oldMap = table;
260 260
 
261 261
         int newCapacity = oldCapacity * 2 + 1;
262
-        Entry newMap[] = new Entry[newCapacity];
262
+        Entry[] newMap = new Entry[newCapacity];
263 263
 
264 264
         threshold = (int) (newCapacity * loadFactor);
265 265
         table = newMap;
@@ -293,7 +293,7 @@ class IntHashMap {
293 293
      */
294 294
     public Object put(int key, Object value) {
295 295
         // Makes sure the key is not already in the hashtable.
296
-        Entry tab[] = table;
296
+        Entry[] tab = table;
297 297
         int hash = key;
298 298
         int index = (hash & 0x7FFFFFFF) % tab.length;
299 299
         for (Entry e = tab[index]; e != null; e = e.next) {
@@ -331,7 +331,7 @@ class IntHashMap {
331 331
      *          or <code>null</code> if the key did not have a mapping.
332 332
      */
333 333
     public Object remove(int key) {
334
-        Entry tab[] = table;
334
+        Entry[] tab = table;
335 335
         int hash = key;
336 336
         int index = (hash & 0x7FFFFFFF) % tab.length;
337 337
         for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) {
@@ -354,7 +354,7 @@ class IntHashMap {
354 354
      * <p>Clears this hashtable so that it contains no keys.</p>
355 355
      */
356 356
     public synchronized void clear() {
357
-        Entry tab[] = table;
357
+        Entry[] tab = table;
358 358
         for (int index = tab.length; --index >= 0;) {
359 359
             tab[index] = null;
360 360
         }

+ 6
- 7
src/com/dmdirc/addons/freedesktop_notifications/commons/StringEscapeUtils.java View File

@@ -19,7 +19,6 @@ package com.dmdirc.addons.freedesktop_notifications.commons;
19 19
 import java.io.IOException;
20 20
 import java.io.StringWriter;
21 21
 import java.io.Writer;
22
-import java.util.Locale;
23 22
 
24 23
 /**
25 24
  * <p>Escapes and unescapes <code>String</code>s for
@@ -71,7 +70,7 @@ public class StringEscapeUtils {
71 70
             return null;
72 71
         }
73 72
         try {
74
-            StringWriter writer = new StringWriter ((int)(str.length() * 1.5));
73
+            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
75 74
             escapeHtml(writer, str);
76 75
             return writer.toString();
77 76
         } catch (IOException ioe) {
@@ -110,8 +109,8 @@ public class StringEscapeUtils {
110 109
      * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a>
111 110
      */
112 111
     public static void escapeHtml(Writer writer, String string) throws IOException {
113
-        if (writer == null ) {
114
-            throw new IllegalArgumentException ("The Writer must not be null.");
112
+        if (writer == null) {
113
+            throw new IllegalArgumentException("The Writer must not be null.");
115 114
         }
116 115
         if (string == null) {
117 116
             return;
@@ -141,7 +140,7 @@ public class StringEscapeUtils {
141 140
             return null;
142 141
         }
143 142
         try {
144
-            StringWriter writer = new StringWriter ((int)(str.length() * 1.5));
143
+            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
145 144
             unescapeHtml(writer, str);
146 145
             return writer.toString();
147 146
         } catch (IOException ioe) {
@@ -169,8 +168,8 @@ public class StringEscapeUtils {
169 168
      * @see #escapeHtml(String)
170 169
      */
171 170
     public static void unescapeHtml(Writer writer, String string) throws IOException {
172
-        if (writer == null ) {
173
-            throw new IllegalArgumentException ("The Writer must not be null.");
171
+        if (writer == null) {
172
+            throw new IllegalArgumentException("The Writer must not be null.");
174 173
         }
175 174
         if (string == null) {
176 175
             return;

+ 1
- 1
src/com/dmdirc/addons/lagdisplay/PingHistoryPanel.java View File

@@ -56,7 +56,7 @@ public class PingHistoryPanel extends JPanel {
56 56
     protected final RollingList<Long> history;
57 57
 
58 58
     /** The maximum ping value. */
59
-    protected long maximum = 0l;
59
+    protected long maximum = 0L;
60 60
 
61 61
     /**
62 62
      * Creates a new history panel for the specified plugin.

+ 0
- 1
src/com/dmdirc/addons/logging/LoggingCommand.java View File

@@ -57,7 +57,6 @@ public final class LoggingCommand extends Command implements IntelligentCommand,
57 57
     @Override
58 58
     public void execute(final FrameContainer<?> origin,
59 59
             final CommandArguments args, final CommandContext context) {
60
-        final Server server = ((ServerCommandContext) context).getServer();
61 60
         final PluginInfo pluginInfo = PluginManager.getPluginManager().getPluginInfoByName("logging");
62 61
         if (pluginInfo == null) {
63 62
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "Logging Plugin is not loaded.");

+ 1
- 1
src/com/dmdirc/addons/logging/ReverseFileReader.java View File

@@ -126,7 +126,7 @@ public class ReverseFileReader {
126 126
             throw new IOException("File has been closed.");
127 127
         }
128 128
         // Used to store result to output.
129
-//		StringBuilder line = new StringBuilder();
129
+
130 130
         final ArrayList<Byte> line = new ArrayList<Byte>(seekLength);
131 131
         // Used to store position in file pre-read
132 132
         long fp = 0;

+ 1
- 1
src/com/dmdirc/addons/mediasource_windows/DllSource.java View File

@@ -116,7 +116,7 @@ public class DllSource implements MediaSource {
116 116
     @Override
117 117
     public String getTitle() {
118 118
         if (useArtistTitle) {
119
-            String bits[] = getOutput("getArtistTitle").split("\\s-\\s", 2);
119
+            final String[] bits = getOutput("getArtistTitle").split("\\s-\\s", 2);
120 120
             return (bits.length > 1) ? bits[1] : "";
121 121
         } else {
122 122
             return getOutput("getTitle");

+ 2
- 2
src/com/dmdirc/addons/nickcolours/NickColourPanel.java View File

@@ -65,7 +65,7 @@ public class NickColourPanel extends JPanel implements ActionListener,
65 65
     /** The plugin we're associated with. */
66 66
     private final transient NickColourPlugin plugin;
67 67
     /** The table headings. */
68
-    private static final String[] headers = {"Network", "Nickname",
68
+    private static final String[] HEADERS = {"Network", "Nickname",
69 69
         "Text colour", "Nicklist colour"};
70 70
 
71 71
     /** Edit and delete buttons. */
@@ -83,7 +83,7 @@ public class NickColourPanel extends JPanel implements ActionListener,
83 83
 
84 84
         final Object[][] data = plugin.getData();
85 85
 
86
-        table = new JTable(new DefaultTableModel(data, headers)) {
86
+        table = new JTable(new DefaultTableModel(data, HEADERS)) {
87 87
 
88 88
             /**
89 89
              * A version number for this class. It should be changed whenever the class

+ 1
- 1
src/com/dmdirc/addons/nowplaying/ConfigPanel.java View File

@@ -261,7 +261,7 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
261 261
     /**
262 262
      * A dummy media source for use in previews.
263 263
      */
264
-    private class DummyMediaSource implements MediaSource {
264
+    private static class DummyMediaSource implements MediaSource {
265 265
 
266 266
         /** {@inheritDoc} */
267 267
         @Override

+ 31
- 31
src/com/dmdirc/addons/nowplaying/MediaSourceState.java View File

@@ -29,35 +29,35 @@ package com.dmdirc.addons.nowplaying;
29 29
  * @since 0.6.3m1
30 30
  */
31 31
 public enum MediaSourceState {
32
-	/** Media Source is closed. */
33
-	CLOSED ("Closed"),
34
-	/** Media Source is stopped. */
35
-	STOPPED ("Stopped"),
36
-	/** Media Source is paused. */
37
-	PAUSED ("Paused"),
38
-	/** Media Source is playing. */
39
-	PLAYING ("Playing"),
40
-	/** Media Source is giving an unknown state. */
41
-	NOTKNOWN ("Unknown");
42
-	
43
-	/** Nice name for this state. */
44
-	final String niceName;
45
-	
46
-	/**
47
-	 * Create a new MediaSourceState
48
-	 *
49
-	 * @param niceName Nice name for this state.
50
-	 */
51
-	MediaSourceState(final String niceName) {
52
-		this.niceName = niceName;
53
-	}
54
-	
55
-	/**
56
-	 * Get the nice name for this state.
57
-     *
58
-     * @return This state's nice name
59
-	 */
60
-	public String getNiceName() {
61
-		return niceName;
62
-	}
32
+    /** Media Source is closed. */
33
+    CLOSED ("Closed"),
34
+    /** Media Source is stopped. */
35
+    STOPPED ("Stopped"),
36
+    /** Media Source is paused. */
37
+    PAUSED ("Paused"),
38
+    /** Media Source is playing. */
39
+    PLAYING ("Playing"),
40
+    /** Media Source is giving an unknown state. */
41
+    NOTKNOWN ("Unknown");
42
+
43
+    /** Nice name for this state. */
44
+    final String niceName;
45
+
46
+    /**
47
+    * Create a new MediaSourceState
48
+    *
49
+    * @param niceName Nice name for this state.
50
+    */
51
+    MediaSourceState(final String niceName) {
52
+        this.niceName = niceName;
53
+    }
54
+
55
+    /**
56
+    * Get the nice name for this state.
57
+    *
58
+    * @return This state's nice name
59
+    */
60
+    public String getNiceName() {
61
+        return niceName;
62
+    }
63 63
 }

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/TwitterCallbackObject.java View File

@@ -42,7 +42,7 @@ import java.util.Map;
42 42
 public class TwitterCallbackObject extends CallbackObject {
43 43
 
44 44
     /** A map of interfaces to the classes which should be instansiated for them. */
45
-    protected static Map<Class<?>, Class<?>> IMPL_MAP = new HashMap<Class<?>, Class<?>>();
45
+    protected static final Map<Class<?>, Class<?>> IMPL_MAP = new HashMap<Class<?>, Class<?>>();
46 46
 
47 47
     static {
48 48
         IMPL_MAP.put(ChannelClientInfo.class, TwitterChannelClientInfo.class);

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/TwitterCallbackObjectSpecific.java View File

@@ -42,7 +42,7 @@ import java.util.Map;
42 42
 public class TwitterCallbackObjectSpecific extends CallbackObjectSpecific {
43 43
 
44 44
     /** A map of interfaces to the classes which should be instansiated for them. */
45
-    protected static Map<Class<?>, Class<?>> IMPL_MAP = new HashMap<Class<?>, Class<?>>();
45
+    protected static final Map<Class<?>, Class<?>> IMPL_MAP = new HashMap<Class<?>, Class<?>>();
46 46
 
47 47
     static {
48 48
         IMPL_MAP.put(ChannelClientInfo.class, TwitterChannelClientInfo.class);

+ 1
- 3
src/com/dmdirc/addons/parser_twitter/TwitterClientInfo.java View File

@@ -23,13 +23,11 @@
23 23
 package com.dmdirc.addons.parser_twitter;
24 24
 
25 25
 import com.dmdirc.addons.parser_twitter.api.TwitterUser;
26
-import com.dmdirc.config.IdentityManager;
27 26
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
28 27
 import com.dmdirc.parser.interfaces.LocalClientInfo;
29 28
 import com.dmdirc.parser.interfaces.Parser;
30
-import com.dmdirc.parser.interfaces.callbacks.ChannelNickChangeListener;
31
-import com.dmdirc.parser.interfaces.callbacks.ChannelUserModeChangeListener;
32 29
 import com.dmdirc.plugins.Plugin;
30
+
33 31
 import java.util.ArrayList;
34 32
 import java.util.HashMap;
35 33
 import java.util.List;

+ 9
- 10
src/com/dmdirc/addons/parser_twitter/api/commons/Entities.java View File

@@ -150,9 +150,9 @@ class Entities {
150 150
     };
151 151
 
152 152
     // package scoped for testing
153
-    static int ISO8859_1_ARRAY_LENGTH = ISO8859_1_ARRAY.length;
153
+    static final int ISO8859_1_ARRAY_LENGTH = ISO8859_1_ARRAY.length;
154 154
     
155
-    static String getISO8859_1(int i, int j) {
155
+    static String getISO88591(int i, int j) {
156 156
         return ISO8859_1_ARRAY[i][j];
157 157
     }
158 158
 
@@ -355,7 +355,7 @@ class Entities {
355 355
     };
356 356
     
357 357
     // package scoped for testing
358
-    static int HTML40_ARRAY_LENGTH = HTML40_ARRAY.length;
358
+    static final int HTML40_ARRAY_LENGTH = HTML40_ARRAY.length;
359 359
     
360 360
     static String getHTML40(int i, int j) {
361 361
         return HTML40_ARRAY[i][j];
@@ -481,7 +481,7 @@ class Entities {
481 481
         }
482 482
     }
483 483
 
484
-    static abstract class MapIntMap implements Entities.EntityMap {
484
+    abstract static class MapIntMap implements Entities.EntityMap {
485 485
         protected Map<String, Integer> mapNameToValue;
486 486
 
487 487
         protected Map<Integer, String> mapValueToName;
@@ -536,7 +536,7 @@ class Entities {
536 536
     static class LookupEntityMap extends PrimitiveEntityMap {
537 537
         private String[] lookupTable;
538 538
 
539
-        private int LOOKUP_TABLE_SIZE = 256;
539
+        private static final int LOOKUP_TABLE_SIZE = 256;
540 540
 
541 541
         /**
542 542
          * {@inheritDoc}
@@ -972,14 +972,13 @@ class Entities {
972 972
                             char isHexChar = entityContent.charAt(1);
973 973
                             try {
974 974
                                 switch (isHexChar) {
975
-                                    case 'X' :
976
-                                    case 'x' : {
975
+                                    case 'X':
976
+                                    case 'x':
977 977
                                         entityValue = Integer.parseInt(entityContent.substring(2), 16);
978 978
                                         break;
979
-                                    }
980
-                                    default : {
979
+                                    default:
981 980
                                         entityValue = Integer.parseInt(entityContent.substring(1), 10);
982
-                                    }
981
+                                        break;
983 982
                                 }
984 983
                                 if (entityValue > 0xFFFF) {
985 984
                                     entityValue = -1;

+ 9
- 9
src/com/dmdirc/addons/parser_twitter/api/commons/IntHashMap.java View File

@@ -40,7 +40,7 @@ class IntHashMap {
40 40
     /**
41 41
      * The hash table data.
42 42
      */
43
-    private transient Entry table[];
43
+    private transient Entry[] table;
44 44
 
45 45
     /**
46 46
      * The total number of entries in the hash table.
@@ -176,7 +176,7 @@ class IntHashMap {
176 176
             throw new NullPointerException();
177 177
         }
178 178
 
179
-        Entry tab[] = table;
179
+        Entry[] tab = table;
180 180
         for (int i = tab.length; i-- > 0;) {
181 181
             for (Entry e = tab[i]; e != null; e = e.next) {
182 182
                 if (e.value.equals(value)) {
@@ -213,7 +213,7 @@ class IntHashMap {
213 213
      * @see #contains(Object)
214 214
      */
215 215
     public boolean containsKey(int key) {
216
-        Entry tab[] = table;
216
+        Entry[] tab = table;
217 217
         int hash = key;
218 218
         int index = (hash & 0x7FFFFFFF) % tab.length;
219 219
         for (Entry e = tab[index]; e != null; e = e.next) {
@@ -234,7 +234,7 @@ class IntHashMap {
234 234
      * @see     #put(int, Object)
235 235
      */
236 236
     public Object get(int key) {
237
-        Entry tab[] = table;
237
+        Entry[] tab = table;
238 238
         int hash = key;
239 239
         int index = (hash & 0x7FFFFFFF) % tab.length;
240 240
         for (Entry e = tab[index]; e != null; e = e.next) {
@@ -256,10 +256,10 @@ class IntHashMap {
256 256
      */
257 257
     protected void rehash() {
258 258
         int oldCapacity = table.length;
259
-        Entry oldMap[] = table;
259
+        Entry[] oldMap = table;
260 260
 
261 261
         int newCapacity = oldCapacity * 2 + 1;
262
-        Entry newMap[] = new Entry[newCapacity];
262
+        Entry[] newMap = new Entry[newCapacity];
263 263
 
264 264
         threshold = (int) (newCapacity * loadFactor);
265 265
         table = newMap;
@@ -293,7 +293,7 @@ class IntHashMap {
293 293
      */
294 294
     public Object put(int key, Object value) {
295 295
         // Makes sure the key is not already in the hashtable.
296
-        Entry tab[] = table;
296
+        Entry[] tab = table;
297 297
         int hash = key;
298 298
         int index = (hash & 0x7FFFFFFF) % tab.length;
299 299
         for (Entry e = tab[index]; e != null; e = e.next) {
@@ -331,7 +331,7 @@ class IntHashMap {
331 331
      *          or <code>null</code> if the key did not have a mapping.
332 332
      */
333 333
     public Object remove(int key) {
334
-        Entry tab[] = table;
334
+        Entry[] tab = table;
335 335
         int hash = key;
336 336
         int index = (hash & 0x7FFFFFFF) % tab.length;
337 337
         for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) {
@@ -354,7 +354,7 @@ class IntHashMap {
354 354
      * <p>Clears this hashtable so that it contains no keys.</p>
355 355
      */
356 356
     public synchronized void clear() {
357
-        Entry tab[] = table;
357
+        Entry[] tab = table;
358 358
         for (int index = tab.length; --index >= 0;) {
359 359
             tab[index] = null;
360 360
         }

+ 6
- 6
src/com/dmdirc/addons/parser_twitter/api/commons/StringEscapeUtils.java View File

@@ -70,7 +70,7 @@ public class StringEscapeUtils {
70 70
             return null;
71 71
         }
72 72
         try {
73
-            StringWriter writer = new StringWriter ((int)(str.length() * 1.5));
73
+            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
74 74
             escapeHtml(writer, str);
75 75
             return writer.toString();
76 76
         } catch (IOException ioe) {
@@ -109,8 +109,8 @@ public class StringEscapeUtils {
109 109
      * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a>
110 110
      */
111 111
     public static void escapeHtml(Writer writer, String string) throws IOException {
112
-        if (writer == null ) {
113
-            throw new IllegalArgumentException ("The Writer must not be null.");
112
+        if (writer == null) {
113
+            throw new IllegalArgumentException("The Writer must not be null.");
114 114
         }
115 115
         if (string == null) {
116 116
             return;
@@ -140,7 +140,7 @@ public class StringEscapeUtils {
140 140
             return null;
141 141
         }
142 142
         try {
143
-            StringWriter writer = new StringWriter ((int)(str.length() * 1.5));
143
+            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
144 144
             unescapeHtml(writer, str);
145 145
             return writer.toString();
146 146
         } catch (IOException ioe) {
@@ -168,8 +168,8 @@ public class StringEscapeUtils {
168 168
      * @see #escapeHtml(String)
169 169
      */
170 170
     public static void unescapeHtml(Writer writer, String string) throws IOException {
171
-        if (writer == null ) {
172
-            throw new IllegalArgumentException ("The Writer must not be null.");
171
+        if (writer == null) {
172
+            throw new IllegalArgumentException("The Writer must not be null.");
173 173
         }
174 174
         if (string == null) {
175 175
             return;

+ 0
- 2
src/com/dmdirc/addons/relaybot/RelayChannelHandler.java View File

@@ -32,7 +32,6 @@ import com.dmdirc.parser.interfaces.callbacks.ChannelMessageListener;
32 32
 import com.dmdirc.parser.irc.IRCCallbackManager;
33 33
 import com.dmdirc.parser.irc.IRCChannelClientInfo;
34 34
 import com.dmdirc.parser.irc.IRCParser;
35
-import com.dmdirc.plugins.PluginClassLoader;
36 35
 import com.dmdirc.plugins.PluginInfo;
37 36
 import com.dmdirc.plugins.PluginManager;
38 37
 import com.dmdirc.ui.messages.Styliser;
@@ -205,7 +204,6 @@ public class RelayChannelHandler implements ChannelMessageListener {
205 204
             try {
206 205
                 final Method gpcl = PluginInfo.class.getDeclaredMethod("getPluginClassLoader");
207 206
                 gpcl.setAccessible(true);
208
-                final PluginClassLoader pcl = (PluginClassLoader) gpcl.invoke(nickColour);
209 207
 
210 208
                 final Class<?> nc = nickColour.getPlugin().getClass();
211 209
                 final Method colourClient = nc.getDeclaredMethod("colourClient", new Class<?>[]{String.class, ChannelClientInfo.class});

+ 11
- 10
src/com/dmdirc/addons/scriptplugin/JavaScriptHelper.java View File

@@ -21,7 +21,8 @@
21 21
  */
22 22
 
23 23
 package com.dmdirc.addons.scriptplugin;
24
-import java.util.Hashtable;
24
+import java.util.HashMap;
25
+import java.util.Map;
25 26
 
26 27
 /**
27 28
  * Used to allow the rhino javascript to do stuff that it otherwise can't, such
@@ -31,13 +32,13 @@ import java.util.Hashtable;
31 32
  */
32 33
 public class JavaScriptHelper {
33 34
     /** Used to identify the JavaScriptHelper. */
34
-    private static final String myIDString = "DMDIRC-JSH";
35
+    private static final String ID = "DMDIRC-JSH";
35 36
     
36 37
     /** Used to allow scripts to know if a specific function they need is available. */
37
-    private final int myVersion = 2;
38
+    private static final int VERSION = 2;
38 39
 
39
-    /** Hashtable for storing stufff. */
40
-    private static Hashtable<String,Object> globalSettings = new Hashtable<String,Object>();
40
+    /** Hashtable for storing stuff. */
41
+    private static final Map<String,Object> SETTINGS = new HashMap<String,Object>();
41 42
     
42 43
     /**
43 44
      * Method to set Stuff.
@@ -48,8 +49,8 @@ public class JavaScriptHelper {
48 49
     public void setGlobal(String setting, Object value) {
49 50
         if (setting.equals("")) { return; }
50 51
         setting = setting.toLowerCase();
51
-        if (globalSettings.containsKey(setting)) { globalSettings.remove(setting); }
52
-        if (value != null) { globalSettings.put(setting,value); }
52
+        if (SETTINGS.containsKey(setting)) { SETTINGS.remove(setting); }
53
+        if (value != null) { SETTINGS.put(setting,value); }
53 54
     }
54 55
     
55 56
     /**
@@ -61,7 +62,7 @@ public class JavaScriptHelper {
61 62
     public Object getGlobal(String setting) {
62 63
         if (setting.equals("")) { return ""; }
63 64
         setting = setting.toLowerCase();
64
-        if (globalSettings.containsKey(setting)) { return globalSettings.get(setting); }
65
+        if (SETTINGS.containsKey(setting)) { return SETTINGS.get(setting); }
65 66
         return null;
66 67
     }
67 68
     
@@ -86,7 +87,7 @@ public class JavaScriptHelper {
86 87
      *
87 88
      * @return JavaScriptHelper version
88 89
      */
89
-    public int getVersion() { return myVersion; }
90
+    public int getVersion() { return VERSION; }
90 91
     
91 92
     /**
92 93
      * Get the ID of this JavaScriptHelper.
@@ -94,5 +95,5 @@ public class JavaScriptHelper {
94 95
      *
95 96
      * @return JavaScriptHelper ID
96 97
      */
97
-    public String getID() { return myIDString; }
98
+    public String getID() { return ID; }
98 99
 }

+ 2
- 2
src/com/dmdirc/addons/scriptplugin/TypedProperties.java View File

@@ -465,13 +465,13 @@ public class TypedProperties extends Properties {
465 465
      */
466 466
     public void setListProperty(final String key, final List<String> value) {
467 467
         final StringBuilder val = new StringBuilder();
468
-        final String LF = "\n";
468
+        final String lf = "\n";
469 469
         boolean first = true;
470 470
         for (final String bit : value) {
471 471
             if (first) {
472 472
                 first = false;
473 473
             } else {
474
-                val.append(LF);
474
+                val.append(lf);
475 475
             }
476 476
             val.append(bit);
477 477
         }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/Apple.java View File

@@ -485,5 +485,5 @@ public final class Apple implements InvocationHandler, ActionListener {
485 485
      *
486 486
      * @return 0 on success, 1 on failure.
487 487
      */
488
-    private synchronized final native int registerOpenURLCallback();
488
+    private synchronized native int registerOpenURLCallback();
489 489
 }

+ 0
- 1
src/com/dmdirc/addons/ui_swing/SwingController.java View File

@@ -68,7 +68,6 @@ import com.dmdirc.ui.IconManager;
68 68
 import com.dmdirc.ui.WindowManager;
69 69
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
70 70
 import com.dmdirc.ui.interfaces.ChannelWindow;
71
-import com.dmdirc.ui.interfaces.FrameListener;
72 71
 import com.dmdirc.ui.interfaces.InputWindow;
73 72
 import com.dmdirc.ui.interfaces.QueryWindow;
74 73
 import com.dmdirc.ui.interfaces.ServerWindow;

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/MenuScroller.java View File

@@ -1,4 +1,3 @@
1
-
2 1
 /**
3 2
  * @(#)MenuScroller.java	1.3.0 05/04/09
4 3
  */
@@ -441,8 +440,9 @@ public class MenuScroller {
441 440
      * @see MenuScroller#dispose()
442 441
      */
443 442
     @Override
444
-    public void finalize() throws Throwable {
443
+    protected void finalize() throws Throwable {
445 444
         dispose();
445
+        super.finalize();
446 446
     }
447 447
 
448 448
     private void setMenuItems() {

+ 1
- 2
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java View File

@@ -59,7 +59,6 @@ import com.dmdirc.ui.IconManager;
59 59
 import com.dmdirc.ui.core.util.URLHandler;
60 60
 import com.dmdirc.ui.interfaces.InputWindow;
61 61
 import com.dmdirc.ui.interfaces.Window;
62
-import com.dmdirc.ui.messages.IRCDocument;
63 62
 import com.dmdirc.util.StringTranscoder;
64 63
 
65 64
 import java.awt.Container;
@@ -778,7 +777,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
778 777
     public void mouseClicked(final ClickTypeValue clicktype,
779 778
             final MouseEventType eventType, final MouseEvent event) {
780 779
         if (event.isPopupTrigger()) {
781
-            showPopupMenuInternal(clicktype, event.getPoint()   );
780
+            showPopupMenuInternal(clicktype, event.getPoint());
782 781
         }
783 782
         if (eventType == MouseEventType.CLICK
784 783
                 && event.getButton() == MouseEvent.BUTTON1) {

+ 0
- 2
src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer.java View File

@@ -25,10 +25,8 @@ package com.dmdirc.addons.ui_swing.components.renderers;
25 25
 import com.dmdirc.actions.interfaces.ActionType;
26 26
 
27 27
 import java.awt.Color;
28
-import java.awt.Component;
29 28
 import java.awt.Font;
30 29
 
31
-import javax.swing.JTable;
32 30
 import javax.swing.table.DefaultTableCellRenderer;
33 31
 
34 32
 /**

+ 1
- 3
src/com/dmdirc/addons/ui_swing/components/renderers/AddonCellRenderer.java View File

@@ -40,8 +40,6 @@ import javax.swing.ListCellRenderer;
40 40
 
41 41
 import net.miginfocom.swing.MigLayout;
42 42
 
43
-import static com.dmdirc.addons.ui_swing.UIUtilities.SMALL_BORDER;
44
-
45 43
 /**
46 44
  * Handles the rendering of the JList used for plugin and theme management.
47 45
  * @author chris
@@ -53,7 +51,7 @@ public final class AddonCellRenderer extends JPanel implements ListCellRenderer
53 51
      * structure is changed (or anything else that would prevent serialized
54 52
      * objects being unserialized with the new class).
55 53
      */
56
-    private static final long serialVersionUID = 1;    
54
+    private static final long serialVersionUID = 1;
57 55
     
58 56
     /** Creates a new instance of AddonCellRenderer. */
59 57
     public AddonCellRenderer() {

+ 1
- 2
src/com/dmdirc/addons/ui_swing/components/statusbar/ErrorPanel.java View File

@@ -24,7 +24,6 @@ package com.dmdirc.addons.ui_swing.components.statusbar;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.MainFrame;
26 26
 import com.dmdirc.addons.ui_swing.SwingController;
27
-import com.dmdirc.addons.ui_swing.dialogs.error.ErrorListDialog;
28 27
 import com.dmdirc.logger.ErrorLevel;
29 28
 import com.dmdirc.logger.ErrorListener;
30 29
 import com.dmdirc.logger.ErrorManager;
@@ -68,7 +67,7 @@ public class ErrorPanel extends StatusbarPopupPanel implements ErrorListener, Ac
68 67
     /** Swing status bar. */
69 68
     private SwingStatusBar statusBar;
70 69
     /** Error manager. */
71
-    private transient final ErrorManager errorManager = ErrorManager.getErrorManager();
70
+    private final transient ErrorManager errorManager = ErrorManager.getErrorManager();
72 71
     /** Dismiss menu. */
73 72
     private final JPopupMenu menu;
74 73
     /** Dismiss menu item. */

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java View File

@@ -58,7 +58,7 @@ public class SubstitutionLabel extends JButton implements MouseListener,
58 58
     /** Drag source. */
59 59
     private DragSource dragSource;
60 60
     /** Substitution. */
61
-    private transient final Substitution substitution;
61
+    private final transient Substitution substitution;
62 62
     /** Previously selected component. */
63 63
     private Component previousComponent;
64 64
 

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/vetoable/VetoableChangeEvent.java View File

@@ -43,7 +43,7 @@ public class VetoableChangeEvent extends ChangeEvent {
43 43
      * @param source Event source
44 44
      * @param newValue New value
45 45
      */
46
-    public VetoableChangeEvent(final Object source, final Object newValue ) {
46
+    public VetoableChangeEvent(final Object source, final Object newValue) {
47 47
         super(source);
48 48
         this.newValue = newValue;
49 49
     }

+ 6
- 6
src/com/dmdirc/addons/ui_swing/dialogs/FeedbackDialog.java View File

@@ -78,7 +78,7 @@ public class FeedbackDialog extends StandardDialog implements ActionListener,
78 78
     /** Server info checkbox. */
79 79
     private JCheckBox serverCheckbox;
80 80
     /** DMDirc info checkbox. */
81
-    private JCheckBox DMDircCheckbox;
81
+    private JCheckBox dmdircCheckbox;
82 82
     /** Sent. */
83 83
     private boolean sentReport = false;
84 84
 
@@ -156,7 +156,7 @@ public class FeedbackDialog extends StandardDialog implements ActionListener,
156 156
         feedback = new JTextArea();
157 157
         serverCheckbox =
158 158
                 new JCheckBox("Include information about connected servers.");
159
-        DMDircCheckbox = new JCheckBox("Include information about DMDirc.");
159
+        dmdircCheckbox = new JCheckBox("Include information about DMDirc.");
160 160
 
161 161
         UIUtilities.addUndoManager(name);
162 162
         UIUtilities.addUndoManager(email);
@@ -167,8 +167,8 @@ public class FeedbackDialog extends StandardDialog implements ActionListener,
167 167
     private void layoutComponents() {
168 168
         serverCheckbox.setMargin(new Insets(0, 0, 0, 0));
169 169
         serverCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
170
-        DMDircCheckbox.setMargin(new Insets(0, 0, 0, 0));
171
-        DMDircCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
170
+        dmdircCheckbox.setMargin(new Insets(0, 0, 0, 0));
171
+        dmdircCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
172 172
 
173 173
         setLayout(new MigLayout("fill, wmin 600, wmax 600, hmin 400, hmax 400"));
174 174
 
@@ -183,7 +183,7 @@ public class FeedbackDialog extends StandardDialog implements ActionListener,
183 183
         add(new JLabel("Feedback: "), "aligny top, shrink");
184 184
         add(new JScrollPane(feedback), "grow, push, wrap");
185 185
         add(serverCheckbox, "skip 1, growx, wrap");
186
-        add(DMDircCheckbox, "skip 1, growx, wrap");
186
+        add(dmdircCheckbox, "skip 1, growx, wrap");
187 187
 
188 188
         add(getCancelButton(), "skip, split 2, right, sg button");
189 189
         add(getOkButton(), "right, sg button");
@@ -249,7 +249,7 @@ public class FeedbackDialog extends StandardDialog implements ActionListener,
249 249
                 }
250 250
             }
251 251
         }
252
-        if (DMDircCheckbox.isSelected()) {
252
+        if (dmdircCheckbox.isSelected()) {
253 253
             dmdircInfo.append("DMDirc version: " + Info.getDMDircVersion()).
254 254
                     append("\n");
255 255
             dmdircInfo.append("Profile directory: " + Main.getConfigDir()).

+ 0
- 1
src/com/dmdirc/addons/ui_swing/dialogs/StandardDialog.java View File

@@ -31,7 +31,6 @@ import java.awt.Frame;
31 31
 import java.awt.Window;
32 32
 import java.awt.event.WindowAdapter;
33 33
 import java.awt.event.WindowEvent;
34
-import java.util.concurrent.Semaphore;
35 34
 
36 35
 import javax.swing.JButton;
37 36
 import javax.swing.JDialog;

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/StandardInputDialog.java View File

@@ -117,7 +117,7 @@ public abstract class StandardInputDialog extends StandardDialog {
117 117
     /**
118 118
      * Initialises the components.
119 119
      */
120
-    private final void initComponents() {
120
+    private void initComponents() {
121 121
         orderButtons(new JButton(), new JButton());
122 122
         textField = new ValidatingJTextField(validator);
123 123
         blurb = new TextLabel(message);
@@ -127,7 +127,7 @@ public abstract class StandardInputDialog extends StandardDialog {
127 127
     /**
128 128
      * Adds the listeners
129 129
      */
130
-    private final void addListeners() {
130
+    private void addListeners() {
131 131
         getOkButton().addActionListener(new ActionListener() {
132 132
 
133 133
             /** {@inheritDoc} */
@@ -201,7 +201,7 @@ public abstract class StandardInputDialog extends StandardDialog {
201 201
     /**
202 202
      * Lays out the components.
203 203
      */
204
-    private final void layoutComponents() {
204
+    private void layoutComponents() {
205 205
         setLayout(new MigLayout("fill, wrap 1"));
206 206
 
207 207
         add(blurb, "growx");

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/StandardMessageDialog.java View File

@@ -91,7 +91,7 @@ public class StandardMessageDialog extends StandardDialog {
91 91
     /**
92 92
      * Initialises the components.
93 93
      */
94
-    private final void initComponents() {
94
+    private void initComponents() {
95 95
         orderButtons(new JButton(), new JButton());
96 96
         getOkButton().setText("OK");
97 97
         blurb = new TextLabel(message);
@@ -100,7 +100,7 @@ public class StandardMessageDialog extends StandardDialog {
100 100
     /**
101 101
      * Adds the listeners
102 102
      */
103
-    private final void addListeners() {
103
+    private void addListeners() {
104 104
         final ActionListener listener = new ActionListener() {
105 105
 
106 106
             /** {@inheritDoc} */
@@ -132,7 +132,7 @@ public class StandardMessageDialog extends StandardDialog {
132 132
     /**
133 133
      * Lays out the components.
134 134
      */
135
-    private final void layoutComponents() {
135
+    private void layoutComponents() {
136 136
         setLayout(new MigLayout("fill, wrap 1, hidemode 3, wmax min(80sp, 500),"
137 137
                 + " wmin min(80sp, 500), pack"));
138 138
 

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/StandardQuestionDialog.java View File

@@ -83,7 +83,7 @@ public abstract class StandardQuestionDialog extends StandardDialog {
83 83
     /**
84 84
      * Initialises the components.
85 85
      */
86
-    private final void initComponents() {
86
+    private void initComponents() {
87 87
         orderButtons(new JButton(), new JButton());
88 88
         getOkButton().setText("Yes");
89 89
         getCancelButton().setText("No");
@@ -93,7 +93,7 @@ public abstract class StandardQuestionDialog extends StandardDialog {
93 93
     /**
94 94
      * Adds the listeners
95 95
      */
96
-    private final void addListeners() {
96
+    private void addListeners() {
97 97
         getOkButton().addActionListener(new ActionListener() {
98 98
 
99 99
             /** {@inheritDoc} */
@@ -133,7 +133,7 @@ public abstract class StandardQuestionDialog extends StandardDialog {
133 133
     /**
134 134
      * Lays out the components.
135 135
      */
136
-    private final void layoutComponents() {
136
+    private void layoutComponents() {
137 137
         setLayout(new MigLayout("fill, wrap 1, hidemode 3"));
138 138
 
139 139
         add(blurb, "growx");

+ 1
- 2
src/com/dmdirc/addons/ui_swing/dialogs/about/LicenceLoader.java View File

@@ -89,8 +89,7 @@ public class LicenceLoader extends LoggingSwingWorker<Void, Void> {
89 89
         final String licenceString = entry.getKey().substring(entry.getKey().
90 90
                 lastIndexOf('/') + 1);
91 91
         if (licenceString.length() > 1) {
92
-            final String licenceStringParts[] = licenceString.split(
93
-                    " - ");
92
+            final String[] licenceStringParts = licenceString.split(" - ");
94 93
             return new Licence(licenceStringParts[1], licenceStringParts[0],
95 94
                     "<html><h1>" + licenceStringParts[1] + "</h1><p>"
96 95
                     + readInputStream(entry.getValue()).replace("\n", "<br>")

+ 2
- 2
src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryLabel.java View File

@@ -27,7 +27,7 @@ import com.dmdirc.config.prefs.PreferencesCategory;
27 27
 import com.dmdirc.logger.ErrorLevel;
28 28
 import com.dmdirc.logger.Logger;
29 29
 import com.dmdirc.ui.IconManager;
30
-import java.awt.Color;
30
+
31 31
 import java.awt.Dimension;
32 32
 import java.util.concurrent.ExecutionException;
33 33
 import javax.swing.BorderFactory;
@@ -123,7 +123,7 @@ public class CategoryLabel extends JLabel {
123 123
         }
124 124
     }
125 125
 
126
-    private class IconLoader extends SwingWorker<Icon, Void> {
126
+    private static class IconLoader extends SwingWorker<Icon, Void> {
127 127
 
128 128
         private CategoryLabel label;
129 129
         private String icon;

+ 1
- 1
src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuInterface.java View File

@@ -34,5 +34,5 @@ public interface FrameContainerMenuInterface {
34 34
      *
35 35
      * @return Wrapped frame container
36 36
      */
37
-    public FrameContainer getFrame();
37
+    FrameContainer getFrame();
38 38
 }

+ 0
- 1
src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem.java View File

@@ -26,7 +26,6 @@ import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.interfaces.FrameInfoListener;
27 27
 import com.dmdirc.interfaces.SelectionListener;
28 28
 import com.dmdirc.ui.IconManager;
29
-import com.dmdirc.ui.WindowManager;
30 29
 
31 30
 import java.awt.Font;
32 31
 import java.awt.event.ActionEvent;

+ 3
- 6
src/com/dmdirc/addons/ui_swing/textpane/TextPaneCanvas.java View File

@@ -385,8 +385,8 @@ class TextPaneCanvas extends JPanel implements MouseInputListener,
385 385
             selectionStartChar = selection.getEndPos();
386 386
             selectionEndLine = selection.getStartLine();
387 387
             selectionEndChar = selection.getStartPos();
388
-        } else if (selection.getStartLine() == selection.getEndLine() && selection.
389
-                getStartPos() > selection.getEndPos()) {
388
+        } else if (selection.getStartLine() == selection.getEndLine()
389
+                && selection.getStartPos() > selection.getEndPos()) {
390 390
             // Just swap the chars
391 391
             selectionStartLine = selection.getStartLine();
392 392
             selectionStartChar = selection.getEndPos();
@@ -434,11 +434,8 @@ class TextPaneCanvas extends JPanel implements MouseInputListener,
434 434
 
435 435
                 final AttributedCharacterIterator iterator = document.
436 436
                         getStyledLine(line);
437
-                int lineHeight = document.getLineHeight(line);
438
-                lineHeight += lineHeight * 0.2;
439 437
                 final AttributedString as = new AttributedString(iterator,
440
-                        firstChar,
441
-                        lastChar);
438
+                        firstChar, lastChar);
442 439
 
443 440
                 as.addAttribute(TextAttribute.FOREGROUND,
444 441
                         textPane.getBackground());

+ 1
- 1
src/com/dmdirc/addons/ui_swing/wizard/Step.java View File

@@ -40,5 +40,5 @@ public abstract class Step extends JPanel {
40 40
      *
41 41
      * @return Step title
42 42
      */
43
-    abstract public String getTitle();
43
+    public abstract String getTitle();
44 44
 }

+ 15
- 15
src/com/dmdirc/addons/ui_web/DynamicRequestHandler.java View File

@@ -62,10 +62,10 @@ import org.mortbay.util.ajax.JSONObjectConvertor;
62 62
 public class DynamicRequestHandler extends AbstractHandler {
63 63
     
64 64
     /** Number of milliseconds before a client is timed out. */
65
-    private static long TIMEOUT = 1000 * 60 * 2; // Two minutes
65
+    private static final long TIMEOUT = 1000 * 60 * 2; // Two minutes
66 66
 
67 67
     /** The last time each client was seen. */
68
-    private static final Map<String, Client> clients = new HashMap<String, Client>();
68
+    private static final Map<String, Client> CLIENTS = new HashMap<String, Client>();
69 69
 
70 70
     /**
71 71
      * Creates a new instance of DynamicRequestHandler. Registers object
@@ -82,11 +82,11 @@ public class DynamicRequestHandler extends AbstractHandler {
82 82
         new Timer().schedule(new TimerTask() {
83 83
             @Override
84 84
             public void run() {
85
-                synchronized (clients) {
85
+                synchronized (CLIENTS) {
86 86
                     for (Map.Entry<String, Client> entry 
87
-                            : new HashMap<String, Client>(clients).entrySet()) {
87
+                            : new HashMap<String, Client>(CLIENTS).entrySet()) {
88 88
                         if (entry.getValue().getTime() > TIMEOUT) {
89
-                            clients.remove(entry.getKey());
89
+                            CLIENTS.remove(entry.getKey());
90 90
                         }
91 91
                     }
92 92
                 }
@@ -107,12 +107,12 @@ public class DynamicRequestHandler extends AbstractHandler {
107 107
         if (request.getParameter("clientID") != null) {
108 108
             final String clientID = request.getParameter("clientID");
109 109
             
110
-            if (!clients.containsKey(clientID)) {
111
-                clients.put(clientID, new Client(request.getRemoteHost()));
110
+            if (!CLIENTS.containsKey(clientID)) {
111
+                CLIENTS.put(clientID, new Client(request.getRemoteHost()));
112 112
             }
113 113
 
114
-            synchronized (clients) {
115
-                clients.get(clientID).touch();
114
+            synchronized (CLIENTS) {
115
+                CLIENTS.get(clientID).touch();
116 116
             }
117 117
         }
118 118
         
@@ -172,7 +172,7 @@ public class DynamicRequestHandler extends AbstractHandler {
172 172
         response.setStatus(HttpServletResponse.SC_OK);
173 173
         response.setContentType("application/json");
174 174
 
175
-        final Client client = clients.get(request.getParameter("clientID"));
175
+        final Client client = CLIENTS.get(request.getParameter("clientID"));
176 176
 
177 177
         synchronized (client.getMutex()) {
178 178
             List<Event> myEvents = client.retrieveEvents();
@@ -181,7 +181,7 @@ public class DynamicRequestHandler extends AbstractHandler {
181 181
                 Continuation continuation = ContinuationSupport.getContinuation(request,
182 182
                         client.getMutex());
183 183
                 client.setContinuation(continuation);
184
-                continuation.suspend(30000l);
184
+                continuation.suspend(30000L);
185 185
 
186 186
                 myEvents = client.retrieveEvents();
187 187
             }
@@ -322,7 +322,7 @@ public class DynamicRequestHandler extends AbstractHandler {
322 322
             final HttpServletResponse response) throws IOException {
323 323
         response.setStatus(HttpServletResponse.SC_OK);
324 324
         response.setContentType("application/json");
325
-        response.getWriter().write(JSON.toString(clients.values().toArray()));
325
+        response.getWriter().write(JSON.toString(CLIENTS.values().toArray()));
326 326
     }
327 327
     
328 328
     private void doJoinChannel(final HttpServletRequest request,
@@ -357,15 +357,15 @@ public class DynamicRequestHandler extends AbstractHandler {
357 357
     }
358 358
 
359 359
     public static void addEvent(final Event event) {
360
-        synchronized (clients) {
361
-            for (Client client : clients.values()) {
360
+        synchronized (CLIENTS) {
361
+            for (Client client : CLIENTS.values()) {
362 362
                 client.addEvent(event);
363 363
             }
364 364
         }
365 365
     }
366 366
 
367 367
     public static void addEvent(String clientID, Event event) {
368
-        clients.get(clientID).addEvent(event);
368
+        CLIENTS.get(clientID).addEvent(event);
369 369
     }
370 370
 
371 371
 }

+ 0
- 1
src/com/dmdirc/addons/ui_web/WebInterfaceUI.java View File

@@ -35,7 +35,6 @@ import com.dmdirc.addons.ui_web.uicomponents.WebServerWindow;
35 35
 import com.dmdirc.addons.ui_web.uicomponents.WebStatusBar;
36 36
 import com.dmdirc.addons.ui_web.uicomponents.WebWindow;
37 37
 import com.dmdirc.config.prefs.PreferencesInterface;
38
-import com.dmdirc.ui.WindowManager;
39 38
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
40 39
 import com.dmdirc.ui.interfaces.*;
41 40
 import com.dmdirc.updater.Update;

+ 0
- 1
test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java View File

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.mediasource_vlc;
24 24
 
25
-import com.dmdirc.addons.nowplaying.MediaSourceState;
26 25
 import com.dmdirc.util.TextFile;
27 26
 import java.io.IOException;
28 27
 import org.junit.Test;

+ 2
- 2
test/com/dmdirc/addons/ui_swing/UIUtilitiesTest.java View File

@@ -58,8 +58,8 @@ public class UIUtilitiesTest {
58 58
         //incorrect look and feel name = system
59 59
         assertEquals(sysLAF, UIUtilities.getLookAndFeel("incorrectName"));
60 60
         //Look and feel name -> class name
61
-        final LookAndFeelInfo[] LAFs = UIManager.getInstalledLookAndFeels();
62
-        for (LookAndFeelInfo lookAndFeel : LAFs) {
61
+        final LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();
62
+        for (LookAndFeelInfo lookAndFeel : lafs) {
63 63
             assertEquals(lookAndFeel.getClassName(), UIUtilities.getLookAndFeel(lookAndFeel.getName()));
64 64
         }
65 65
     }

+ 1
- 1
test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java View File

@@ -112,7 +112,7 @@ public class InputTextFrameTest extends DMDircUITestCase {
112 112
     /**
113 113
      * Creates a new paste dialog for the specified frame with the specified text.
114 114
      */
115
-    private class PasteDialogTrigger implements Trigger {
115
+    private static class PasteDialogTrigger implements Trigger {
116 116
 
117 117
         private InputTextFrame frame;
118 118
         private String text;

+ 2
- 0
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanelTest.java View File

@@ -47,6 +47,8 @@ public class ActionsGroupPanelTest extends UISpecTestCase {
47 47
     @Before
48 48
     @Override
49 49
     public void setUp() {
50
+        super.setUp();
51
+        
50 52
         action1 = mock(Action.class);
51 53
         when(action1.getName()).thenReturn("name 1");
52 54
         when(action1.getTriggers()).thenReturn(new ActionType[] {

+ 1
- 1
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsManagerDialogTest.java View File

@@ -157,7 +157,7 @@ public class ActionsManagerDialogTest extends FestSwingJUnitTestCase {
157 157
 
158 158
         newwin = WindowFinder.findDialog(StandardQuestionDialog.
159 159
                 class).withTimeout(5000).using(window.robot);
160
-        button = newwin.button(JButtonMatcher.withText("Yes")).click();
160
+        newwin.button(JButtonMatcher.withText("Yes")).click();
161 161
         
162 162
         assertTrue(window.list().selection().length != 1 ||   
163 163
                 !window.list().selection()[0].equals("amd-ui-test1"));

+ 1
- 1
test/com/dmdirc/harness/ui/DMDircUITestCase.java View File

@@ -33,7 +33,7 @@ import com.dmdirc.config.IdentityManager;
33 33
 import com.dmdirc.config.InvalidIdentityFileException;
34 34
 import com.dmdirc.plugins.PluginManager;
35 35
 import com.dmdirc.ui.messages.IRCDocument;
36
-import org.junit.Test;
36
+
37 37
 import org.uispec4j.UISpecTestCase;
38 38
 import static org.mockito.Mockito.*;
39 39
 

Loading…
Cancel
Save