Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
6b0a81a27b
55 değiştirilmiş dosya ile 167 ekleme ve 190 silme
  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 Dosyayı Görüntüle

188
         final long time = getElapsedTime();
188
         final long time = getElapsedTime();
189
 
189
 
190
         synchronized (this) {
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 Dosyayı Görüntüle

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

+ 4
- 4
src/com/dmdirc/addons/dcc/kde/KDialogProcess.java Dosyayı Görüntüle

32
 public class KDialogProcess {
32
 public class KDialogProcess {
33
 
33
 
34
     /** Is kdialog in /bin? */
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
     /** Does KDialog exist? */
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
     /** Stream for the stdout stream for this process */
40
     /** Stream for the stdout stream for this process */
41
     private final StreamReader stdOutputStream;
41
     private final StreamReader stdOutputStream;
54
     public KDialogProcess(final String[] params) throws IOException {
54
     public KDialogProcess(final String[] params) throws IOException {
55
         final String[] exec = new String[params.length + 1];
55
         final String[] exec = new String[params.length + 1];
56
         System.arraycopy(params, 0, exec, 1, params.length);
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
         process = Runtime.getRuntime().exec(exec);
58
         process = Runtime.getRuntime().exec(exec);
59
         stdOutputStream = new StreamReader(process.getInputStream(), new ArrayList<String>());
59
         stdOutputStream = new StreamReader(process.getInputStream(), new ArrayList<String>());
60
         stdErrorStream = new StreamReader(process.getErrorStream(), new ArrayList<String>());
60
         stdErrorStream = new StreamReader(process.getErrorStream(), new ArrayList<String>());
68
      * @return True if kdialog was found, else false
68
      * @return True if kdialog was found, else false
69
      */
69
      */
70
     public static boolean hasKDialog() {
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 Dosyayı Görüntüle

35
 public class EmptyWindow extends TextFrame {
35
 public class EmptyWindow extends TextFrame {
36
 
36
 
37
     /** A version number for this class. */
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
      * Creates a new empty window for the specified UI controller and owner.
41
      * Creates a new empty window for the specified UI controller and owner.

+ 1
- 1
src/com/dmdirc/addons/dcc/ui/PlaceholderWindow.java Dosyayı Görüntüle

36
 public class PlaceholderWindow extends EmptyWindow {
36
 public class PlaceholderWindow extends EmptyWindow {
37
 
37
 
38
     /** A version number for this class. */
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
      * Creates a new placeholder window for the specified UI controller and owner.
42
      * Creates a new placeholder window for the specified UI controller and owner.

+ 1
- 1
src/com/dmdirc/addons/dcc/ui/TransferWindow.java Dosyayı Görüntüle

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

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

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

+ 4
- 6
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java Dosyayı Görüntüle

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

+ 9
- 10
src/com/dmdirc/addons/freedesktop_notifications/commons/Entities.java Dosyayı Görüntüle

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

+ 9
- 9
src/com/dmdirc/addons/freedesktop_notifications/commons/IntHashMap.java Dosyayı Görüntüle

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

+ 6
- 7
src/com/dmdirc/addons/freedesktop_notifications/commons/StringEscapeUtils.java Dosyayı Görüntüle

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

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

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

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

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

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

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

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

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

+ 2
- 2
src/com/dmdirc/addons/nickcolours/NickColourPanel.java Dosyayı Görüntüle

65
     /** The plugin we're associated with. */
65
     /** The plugin we're associated with. */
66
     private final transient NickColourPlugin plugin;
66
     private final transient NickColourPlugin plugin;
67
     /** The table headings. */
67
     /** The table headings. */
68
-    private static final String[] headers = {"Network", "Nickname",
68
+    private static final String[] HEADERS = {"Network", "Nickname",
69
         "Text colour", "Nicklist colour"};
69
         "Text colour", "Nicklist colour"};
70
 
70
 
71
     /** Edit and delete buttons. */
71
     /** Edit and delete buttons. */
83
 
83
 
84
         final Object[][] data = plugin.getData();
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
              * A version number for this class. It should be changed whenever the class
89
              * A version number for this class. It should be changed whenever the class

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

261
     /**
261
     /**
262
      * A dummy media source for use in previews.
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
         /** {@inheritDoc} */
266
         /** {@inheritDoc} */
267
         @Override
267
         @Override

+ 31
- 31
src/com/dmdirc/addons/nowplaying/MediaSourceState.java Dosyayı Görüntüle

29
  * @since 0.6.3m1
29
  * @since 0.6.3m1
30
  */
30
  */
31
 public enum MediaSourceState {
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 Dosyayı Görüntüle

42
 public class TwitterCallbackObject extends CallbackObject {
42
 public class TwitterCallbackObject extends CallbackObject {
43
 
43
 
44
     /** A map of interfaces to the classes which should be instansiated for them. */
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
     static {
47
     static {
48
         IMPL_MAP.put(ChannelClientInfo.class, TwitterChannelClientInfo.class);
48
         IMPL_MAP.put(ChannelClientInfo.class, TwitterChannelClientInfo.class);

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

42
 public class TwitterCallbackObjectSpecific extends CallbackObjectSpecific {
42
 public class TwitterCallbackObjectSpecific extends CallbackObjectSpecific {
43
 
43
 
44
     /** A map of interfaces to the classes which should be instansiated for them. */
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
     static {
47
     static {
48
         IMPL_MAP.put(ChannelClientInfo.class, TwitterChannelClientInfo.class);
48
         IMPL_MAP.put(ChannelClientInfo.class, TwitterChannelClientInfo.class);

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

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

+ 9
- 10
src/com/dmdirc/addons/parser_twitter/api/commons/Entities.java Dosyayı Görüntüle

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

+ 9
- 9
src/com/dmdirc/addons/parser_twitter/api/commons/IntHashMap.java Dosyayı Görüntüle

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

+ 6
- 6
src/com/dmdirc/addons/parser_twitter/api/commons/StringEscapeUtils.java Dosyayı Görüntüle

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

+ 0
- 2
src/com/dmdirc/addons/relaybot/RelayChannelHandler.java Dosyayı Görüntüle

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

+ 11
- 10
src/com/dmdirc/addons/scriptplugin/JavaScriptHelper.java Dosyayı Görüntüle

21
  */
21
  */
22
 
22
 
23
 package com.dmdirc.addons.scriptplugin;
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
  * Used to allow the rhino javascript to do stuff that it otherwise can't, such
28
  * Used to allow the rhino javascript to do stuff that it otherwise can't, such
31
  */
32
  */
32
 public class JavaScriptHelper {
33
 public class JavaScriptHelper {
33
     /** Used to identify the JavaScriptHelper. */
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
     /** Used to allow scripts to know if a specific function they need is available. */
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
      * Method to set Stuff.
44
      * Method to set Stuff.
48
     public void setGlobal(String setting, Object value) {
49
     public void setGlobal(String setting, Object value) {
49
         if (setting.equals("")) { return; }
50
         if (setting.equals("")) { return; }
50
         setting = setting.toLowerCase();
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
     public Object getGlobal(String setting) {
62
     public Object getGlobal(String setting) {
62
         if (setting.equals("")) { return ""; }
63
         if (setting.equals("")) { return ""; }
63
         setting = setting.toLowerCase();
64
         setting = setting.toLowerCase();
64
-        if (globalSettings.containsKey(setting)) { return globalSettings.get(setting); }
65
+        if (SETTINGS.containsKey(setting)) { return SETTINGS.get(setting); }
65
         return null;
66
         return null;
66
     }
67
     }
67
     
68
     
86
      *
87
      *
87
      * @return JavaScriptHelper version
88
      * @return JavaScriptHelper version
88
      */
89
      */
89
-    public int getVersion() { return myVersion; }
90
+    public int getVersion() { return VERSION; }
90
     
91
     
91
     /**
92
     /**
92
      * Get the ID of this JavaScriptHelper.
93
      * Get the ID of this JavaScriptHelper.
94
      *
95
      *
95
      * @return JavaScriptHelper ID
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 Dosyayı Görüntüle

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

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

485
      *
485
      *
486
      * @return 0 on success, 1 on failure.
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 Dosyayı Görüntüle

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

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/MenuScroller.java Dosyayı Görüntüle

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

+ 1
- 2
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java Dosyayı Görüntüle

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

+ 0
- 2
src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer.java Dosyayı Görüntüle

25
 import com.dmdirc.actions.interfaces.ActionType;
25
 import com.dmdirc.actions.interfaces.ActionType;
26
 
26
 
27
 import java.awt.Color;
27
 import java.awt.Color;
28
-import java.awt.Component;
29
 import java.awt.Font;
28
 import java.awt.Font;
30
 
29
 
31
-import javax.swing.JTable;
32
 import javax.swing.table.DefaultTableCellRenderer;
30
 import javax.swing.table.DefaultTableCellRenderer;
33
 
31
 
34
 /**
32
 /**

+ 1
- 3
src/com/dmdirc/addons/ui_swing/components/renderers/AddonCellRenderer.java Dosyayı Görüntüle

40
 
40
 
41
 import net.miginfocom.swing.MigLayout;
41
 import net.miginfocom.swing.MigLayout;
42
 
42
 
43
-import static com.dmdirc.addons.ui_swing.UIUtilities.SMALL_BORDER;
44
-
45
 /**
43
 /**
46
  * Handles the rendering of the JList used for plugin and theme management.
44
  * Handles the rendering of the JList used for plugin and theme management.
47
  * @author chris
45
  * @author chris
53
      * structure is changed (or anything else that would prevent serialized
51
      * structure is changed (or anything else that would prevent serialized
54
      * objects being unserialized with the new class).
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
     /** Creates a new instance of AddonCellRenderer. */
56
     /** Creates a new instance of AddonCellRenderer. */
59
     public AddonCellRenderer() {
57
     public AddonCellRenderer() {

+ 1
- 2
src/com/dmdirc/addons/ui_swing/components/statusbar/ErrorPanel.java Dosyayı Görüntüle

24
 
24
 
25
 import com.dmdirc.addons.ui_swing.MainFrame;
25
 import com.dmdirc.addons.ui_swing.MainFrame;
26
 import com.dmdirc.addons.ui_swing.SwingController;
26
 import com.dmdirc.addons.ui_swing.SwingController;
27
-import com.dmdirc.addons.ui_swing.dialogs.error.ErrorListDialog;
28
 import com.dmdirc.logger.ErrorLevel;
27
 import com.dmdirc.logger.ErrorLevel;
29
 import com.dmdirc.logger.ErrorListener;
28
 import com.dmdirc.logger.ErrorListener;
30
 import com.dmdirc.logger.ErrorManager;
29
 import com.dmdirc.logger.ErrorManager;
68
     /** Swing status bar. */
67
     /** Swing status bar. */
69
     private SwingStatusBar statusBar;
68
     private SwingStatusBar statusBar;
70
     /** Error manager. */
69
     /** Error manager. */
71
-    private transient final ErrorManager errorManager = ErrorManager.getErrorManager();
70
+    private final transient ErrorManager errorManager = ErrorManager.getErrorManager();
72
     /** Dismiss menu. */
71
     /** Dismiss menu. */
73
     private final JPopupMenu menu;
72
     private final JPopupMenu menu;
74
     /** Dismiss menu item. */
73
     /** Dismiss menu item. */

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java Dosyayı Görüntüle

58
     /** Drag source. */
58
     /** Drag source. */
59
     private DragSource dragSource;
59
     private DragSource dragSource;
60
     /** Substitution. */
60
     /** Substitution. */
61
-    private transient final Substitution substitution;
61
+    private final transient Substitution substitution;
62
     /** Previously selected component. */
62
     /** Previously selected component. */
63
     private Component previousComponent;
63
     private Component previousComponent;
64
 
64
 

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/vetoable/VetoableChangeEvent.java Dosyayı Görüntüle

43
      * @param source Event source
43
      * @param source Event source
44
      * @param newValue New value
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
         super(source);
47
         super(source);
48
         this.newValue = newValue;
48
         this.newValue = newValue;
49
     }
49
     }

+ 6
- 6
src/com/dmdirc/addons/ui_swing/dialogs/FeedbackDialog.java Dosyayı Görüntüle

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

+ 0
- 1
src/com/dmdirc/addons/ui_swing/dialogs/StandardDialog.java Dosyayı Görüntüle

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

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/StandardInputDialog.java Dosyayı Görüntüle

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

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/StandardMessageDialog.java Dosyayı Görüntüle

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

+ 3
- 3
src/com/dmdirc/addons/ui_swing/dialogs/StandardQuestionDialog.java Dosyayı Görüntüle

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

+ 1
- 2
src/com/dmdirc/addons/ui_swing/dialogs/about/LicenceLoader.java Dosyayı Görüntüle

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

+ 2
- 2
src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryLabel.java Dosyayı Görüntüle

27
 import com.dmdirc.logger.ErrorLevel;
27
 import com.dmdirc.logger.ErrorLevel;
28
 import com.dmdirc.logger.Logger;
28
 import com.dmdirc.logger.Logger;
29
 import com.dmdirc.ui.IconManager;
29
 import com.dmdirc.ui.IconManager;
30
-import java.awt.Color;
30
+
31
 import java.awt.Dimension;
31
 import java.awt.Dimension;
32
 import java.util.concurrent.ExecutionException;
32
 import java.util.concurrent.ExecutionException;
33
 import javax.swing.BorderFactory;
33
 import javax.swing.BorderFactory;
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
         private CategoryLabel label;
128
         private CategoryLabel label;
129
         private String icon;
129
         private String icon;

+ 1
- 1
src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuInterface.java Dosyayı Görüntüle

34
      *
34
      *
35
      * @return Wrapped frame container
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 Dosyayı Görüntüle

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

+ 3
- 6
src/com/dmdirc/addons/ui_swing/textpane/TextPaneCanvas.java Dosyayı Görüntüle

385
             selectionStartChar = selection.getEndPos();
385
             selectionStartChar = selection.getEndPos();
386
             selectionEndLine = selection.getStartLine();
386
             selectionEndLine = selection.getStartLine();
387
             selectionEndChar = selection.getStartPos();
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
             // Just swap the chars
390
             // Just swap the chars
391
             selectionStartLine = selection.getStartLine();
391
             selectionStartLine = selection.getStartLine();
392
             selectionStartChar = selection.getEndPos();
392
             selectionStartChar = selection.getEndPos();
434
 
434
 
435
                 final AttributedCharacterIterator iterator = document.
435
                 final AttributedCharacterIterator iterator = document.
436
                         getStyledLine(line);
436
                         getStyledLine(line);
437
-                int lineHeight = document.getLineHeight(line);
438
-                lineHeight += lineHeight * 0.2;
439
                 final AttributedString as = new AttributedString(iterator,
437
                 final AttributedString as = new AttributedString(iterator,
440
-                        firstChar,
441
-                        lastChar);
438
+                        firstChar, lastChar);
442
 
439
 
443
                 as.addAttribute(TextAttribute.FOREGROUND,
440
                 as.addAttribute(TextAttribute.FOREGROUND,
444
                         textPane.getBackground());
441
                         textPane.getBackground());

+ 1
- 1
src/com/dmdirc/addons/ui_swing/wizard/Step.java Dosyayı Görüntüle

40
      *
40
      *
41
      * @return Step title
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 Dosyayı Görüntüle

62
 public class DynamicRequestHandler extends AbstractHandler {
62
 public class DynamicRequestHandler extends AbstractHandler {
63
     
63
     
64
     /** Number of milliseconds before a client is timed out. */
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
     /** The last time each client was seen. */
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
      * Creates a new instance of DynamicRequestHandler. Registers object
71
      * Creates a new instance of DynamicRequestHandler. Registers object
82
         new Timer().schedule(new TimerTask() {
82
         new Timer().schedule(new TimerTask() {
83
             @Override
83
             @Override
84
             public void run() {
84
             public void run() {
85
-                synchronized (clients) {
85
+                synchronized (CLIENTS) {
86
                     for (Map.Entry<String, Client> entry 
86
                     for (Map.Entry<String, Client> entry 
87
-                            : new HashMap<String, Client>(clients).entrySet()) {
87
+                            : new HashMap<String, Client>(CLIENTS).entrySet()) {
88
                         if (entry.getValue().getTime() > TIMEOUT) {
88
                         if (entry.getValue().getTime() > TIMEOUT) {
89
-                            clients.remove(entry.getKey());
89
+                            CLIENTS.remove(entry.getKey());
90
                         }
90
                         }
91
                     }
91
                     }
92
                 }
92
                 }
107
         if (request.getParameter("clientID") != null) {
107
         if (request.getParameter("clientID") != null) {
108
             final String clientID = request.getParameter("clientID");
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
         response.setStatus(HttpServletResponse.SC_OK);
172
         response.setStatus(HttpServletResponse.SC_OK);
173
         response.setContentType("application/json");
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
         synchronized (client.getMutex()) {
177
         synchronized (client.getMutex()) {
178
             List<Event> myEvents = client.retrieveEvents();
178
             List<Event> myEvents = client.retrieveEvents();
181
                 Continuation continuation = ContinuationSupport.getContinuation(request,
181
                 Continuation continuation = ContinuationSupport.getContinuation(request,
182
                         client.getMutex());
182
                         client.getMutex());
183
                 client.setContinuation(continuation);
183
                 client.setContinuation(continuation);
184
-                continuation.suspend(30000l);
184
+                continuation.suspend(30000L);
185
 
185
 
186
                 myEvents = client.retrieveEvents();
186
                 myEvents = client.retrieveEvents();
187
             }
187
             }
322
             final HttpServletResponse response) throws IOException {
322
             final HttpServletResponse response) throws IOException {
323
         response.setStatus(HttpServletResponse.SC_OK);
323
         response.setStatus(HttpServletResponse.SC_OK);
324
         response.setContentType("application/json");
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
     private void doJoinChannel(final HttpServletRequest request,
328
     private void doJoinChannel(final HttpServletRequest request,
357
     }
357
     }
358
 
358
 
359
     public static void addEvent(final Event event) {
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
                 client.addEvent(event);
362
                 client.addEvent(event);
363
             }
363
             }
364
         }
364
         }
365
     }
365
     }
366
 
366
 
367
     public static void addEvent(String clientID, Event event) {
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 Dosyayı Görüntüle

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

+ 0
- 1
test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java Dosyayı Görüntüle

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

+ 2
- 2
test/com/dmdirc/addons/ui_swing/UIUtilitiesTest.java Dosyayı Görüntüle

58
         //incorrect look and feel name = system
58
         //incorrect look and feel name = system
59
         assertEquals(sysLAF, UIUtilities.getLookAndFeel("incorrectName"));
59
         assertEquals(sysLAF, UIUtilities.getLookAndFeel("incorrectName"));
60
         //Look and feel name -> class name
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
             assertEquals(lookAndFeel.getClassName(), UIUtilities.getLookAndFeel(lookAndFeel.getName()));
63
             assertEquals(lookAndFeel.getClassName(), UIUtilities.getLookAndFeel(lookAndFeel.getName()));
64
         }
64
         }
65
     }
65
     }

+ 1
- 1
test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java Dosyayı Görüntüle

112
     /**
112
     /**
113
      * Creates a new paste dialog for the specified frame with the specified text.
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
         private InputTextFrame frame;
117
         private InputTextFrame frame;
118
         private String text;
118
         private String text;

+ 2
- 0
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanelTest.java Dosyayı Görüntüle

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

+ 1
- 1
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsManagerDialogTest.java Dosyayı Görüntüle

157
 
157
 
158
         newwin = WindowFinder.findDialog(StandardQuestionDialog.
158
         newwin = WindowFinder.findDialog(StandardQuestionDialog.
159
                 class).withTimeout(5000).using(window.robot);
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
         assertTrue(window.list().selection().length != 1 ||   
162
         assertTrue(window.list().selection().length != 1 ||   
163
                 !window.list().selection()[0].equals("amd-ui-test1"));
163
                 !window.list().selection()[0].equals("amd-ui-test1"));

+ 1
- 1
test/com/dmdirc/harness/ui/DMDircUITestCase.java Dosyayı Görüntüle

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

Loading…
İptal
Kaydet