ソースを参照

Misc style fixes

Change-Id: I08ec70d6f469892c62a20147a279b9d5e7dc643d
Reviewed-on: http://gerrit.dmdirc.com/1533
Automatic-Compile: Greg Holmes <greg@dmdirc.com>
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.6.5
Chris Smith 13年前
コミット
48d6cca2a0

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCCommandParser.java ファイルの表示

@@ -31,7 +31,7 @@ import com.dmdirc.commandparser.parsers.GlobalCommandParser;
31 31
 /**
32 32
  * DCC CommandParser
33 33
  */
34
-public class DCCCommandParser extends GlobalCommandParser {
34
+public final class DCCCommandParser extends GlobalCommandParser {
35 35
 
36 36
     /** The singleton instance of the DCC command parser. */
37 37
     private static DCCCommandParser me;

+ 1
- 1
src/com/dmdirc/addons/dcc/kde/KFileChooser.java ファイルの表示

@@ -54,7 +54,7 @@ import javax.swing.filechooser.FileSystemView;
54 54
  *   and kdialog is in either /usr/bin or /bin
55 55
  * - Selection mode FILES_AND_DIRECTORIES can not be used
56 56
  */
57
-public class KFileChooser extends JFileChooser {
57
+public final class KFileChooser extends JFileChooser {
58 58
 
59 59
     /**
60 60
      * A version number for this class.

+ 19
- 20
src/com/dmdirc/addons/parser_twitter/TwitterClientInfo.java ファイルの表示

@@ -27,6 +27,7 @@ import com.dmdirc.parser.interfaces.ChannelClientInfo;
27 27
 import com.dmdirc.parser.interfaces.LocalClientInfo;
28 28
 import com.dmdirc.parser.interfaces.Parser;
29 29
 import com.dmdirc.plugins.Plugin;
30
+
30 31
 import java.util.ArrayList;
31 32
 import java.util.HashMap;
32 33
 import java.util.List;
@@ -74,21 +75,23 @@ public class TwitterClientInfo implements LocalClientInfo {
74 75
      * @param plugin Plugin to use to get domain from.
75 76
      * @return String array of nick, ident and host.
76 77
      */
77
-    static String[] parseHostFull(String hostname, final Plugin plugin, final Twitter parser) {
78
+    static String[] parseHostFull(final String hostname, final Plugin plugin, final Twitter parser) {
78 79
         boolean hadAt = false;
79
-        if (plugin != null && parser != null && parser.getConfigManager().getOptionBool(plugin.getDomain(), "autoAt")) {
80
-            if (!hostname.isEmpty() && hostname.charAt(0) == '@') {
81
-                hostname = hostname.substring(1);
82
-                hadAt = true;
83
-            }
80
+        String sanitisedHostname = hostname;
81
+
82
+        if (plugin != null && parser != null
83
+                && parser.getConfigManager().getOptionBool(plugin.getDomain(), "autoAt")
84
+                && !sanitisedHostname.isEmpty() && sanitisedHostname.charAt(0) == '@') {
85
+            sanitisedHostname = sanitisedHostname.substring(1);
86
+            hadAt = true;
84 87
         }
85 88
 
86 89
         String[] temp = null;
87 90
         final String[] result = new String[3];
88
-        if (!hostname.isEmpty() && hostname.charAt(0) == ':') {
89
-            hostname = hostname.substring(1);
91
+        if (!sanitisedHostname.isEmpty() && sanitisedHostname.charAt(0) == ':') {
92
+            sanitisedHostname = sanitisedHostname.substring(1);
90 93
         }
91
-        temp = hostname.split("@", 2);
94
+        temp = sanitisedHostname.split("@", 2);
92 95
         if (temp.length == 1) {
93 96
             result[2] = "";
94 97
         } else {
@@ -153,11 +156,7 @@ public class TwitterClientInfo implements LocalClientInfo {
153 156
     /** {@inheritDoc} */
154 157
     @Override
155 158
     public void setNickname(final String name) {
156
-        if (this == myParser.getLocalClient()) {
157
-            // TODO: throw new UnsupportedOperationException("Not supported yet.");
158
-        } else {
159
-            // TODO: throw new UnsupportedOperationException("Can not set nickname on non-local clients");
160
-        }
159
+        // TODO: Implement?
161 160
     }
162 161
 
163 162
     /**
@@ -217,25 +216,25 @@ public class TwitterClientInfo implements LocalClientInfo {
217 216
     /** {@inheritDoc} */
218 217
     @Override
219 218
     public void setAway(final String reason) {
220
-        return;
219
+        // Do nothing
221 220
     }
222 221
 
223 222
     /** {@inheritDoc} */
224 223
     @Override
225 224
     public void setBack() {
226
-        return;
225
+        // Do nothing
227 226
     }
228 227
 
229 228
     /** {@inheritDoc} */
230 229
     @Override
231 230
     public void alterMode(final boolean add, final Character mode) {
232
-        return;
231
+        // Do nothing
233 232
     }
234 233
 
235 234
     /** {@inheritDoc} */
236 235
     @Override
237 236
     public void flushModes() {
238
-        return;
237
+        // Do nothing
239 238
     }
240 239
 
241 240
     /** {@inheritDoc} */
@@ -278,7 +277,7 @@ public class TwitterClientInfo implements LocalClientInfo {
278 277
 
279 278
     /**
280 279
      * Get a list of all the channel clients associated with this user.
281
-     * 
280
+     *
282 281
      * @return Channel Clients for this Client.
283 282
      */
284 283
     public List<ChannelClientInfo> getChannelClients() {
@@ -301,7 +300,7 @@ public class TwitterClientInfo implements LocalClientInfo {
301 300
 
302 301
     /**
303 302
      * Add a channelClient to this Client.
304
-     * 
303
+     *
305 304
      * @param channelClient channelClient to add as us.
306 305
      */
307 306
     public void addChannelClient(final TwitterChannelClientInfo channelClient) {

+ 5
- 6
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java ファイルの表示

@@ -283,14 +283,13 @@ public abstract class TextFrame extends JInternalFrame implements Window,
283 283
                     TextFrame.super.setVisible(true);
284 284
                 }
285 285
                 try {
286
-                    if (pref || controller.getMainFrame().getMaximised()) {
287
-                        if (!isMaximum()) {
288
-                            setMaximum(true);
289
-                        }
286
+                    if ((pref || controller.getMainFrame().getMaximised()) && !isMaximum()) {
287
+                        setMaximum(true);
290 288
                     }
291 289
                 } catch (PropertyVetoException ex) {
292 290
                     //Ignore
293 291
                 }
292
+
294 293
                 try {
295 294
                     if (!isSelected()) {
296 295
                         setSelected(true);
@@ -679,7 +678,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
679 678
 
680 679
             /** {@inheritDoc} */
681 680
             @Override
682
-            protected Object doInBackground() throws Exception {
681
+            protected Object doInBackground() {
683 682
                 frameParent.windowClosing();
684 683
                 return null;
685 684
             }
@@ -738,7 +737,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
738 737
 
739 738
             /** {@inheritDoc} */
740 739
             @Override
741
-            protected Object doInBackground() throws Exception {
740
+            protected Object doInBackground() {
742 741
                 LOGGER.finer(getName()
743 742
                         + ": internalFrameActivated(): doInBackground");
744 743
                 frameParent.windowActivated();

+ 4
- 6
src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryLabel.java ファイルの表示

@@ -31,11 +31,13 @@ import com.dmdirc.ui.IconManager;
31 31
 
32 32
 import java.awt.Dimension;
33 33
 import java.util.concurrent.ExecutionException;
34
+
34 35
 import javax.swing.BorderFactory;
35 36
 import javax.swing.Icon;
36 37
 import javax.swing.JLabel;
37 38
 import javax.swing.JList;
38 39
 import javax.swing.UIManager;
40
+
39 41
 import net.miginfocom.layout.PlatformDefaults;
40 42
 
41 43
 /**
@@ -50,11 +52,9 @@ public class CategoryLabel extends JLabel {
50 52
      */
51 53
     private static final long serialVersionUID = -1659415238166842265L;
52 54
     /** Panel gap. */
53
-    private final int padding = (int) (1.5 * PlatformDefaults.getUnitValueX(
54
-            "related").getValue());
55
-    private PreferencesCategory category;
55
+    private final int padding = (int)
56
+            (1.5 * PlatformDefaults.getUnitValueX("related").getValue());
56 57
     private JList parentList;
57
-    private int index;
58 58
 
59 59
     /**
60 60
      * 
@@ -66,8 +66,6 @@ public class CategoryLabel extends JLabel {
66 66
     public CategoryLabel(final JList parentList,
67 67
             final PreferencesCategory category, final int numCats, final int index) {
68 68
         this.parentList = parentList;
69
-        this.category = category;
70
-        this.index = index;
71 69
 
72 70
         setText(category.getTitle());
73 71
         new IconLoader(this, category.getIcon()).executeInExecutor();

+ 4
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/SwingPreferencesDialog.java ファイルの表示

@@ -76,11 +76,11 @@ public final class SwingPreferencesDialog extends StandardDialog implements
76 76
     /** Preferences Manager. */
77 77
     private PreferencesManager manager;
78 78
     /** Manager loading swing worker. */
79
-    private LoggingSwingWorker worker;
79
+    private LoggingSwingWorker<PreferencesManager, Void> worker;
80 80
     /** Parent window. */
81 81
     private MainFrame parentWindow;
82 82
     /** Panel size. */
83
-    protected int panelSize = 0;
83
+    private int panelSize = 0;
84 84
 
85 85
     /**
86 86
      * Creates a new instance of SwingPreferencesDialog.
@@ -272,10 +272,10 @@ public final class SwingPreferencesDialog extends StandardDialog implements
272 272
             saveOptions();
273 273
         }
274 274
 
275
-        new LoggingSwingWorker() {
275
+        new LoggingSwingWorker<Void, Void>() {
276 276
 
277 277
             @Override
278
-            protected Object doInBackground() throws Exception {
278
+            protected Void doInBackground() {
279 279
                 if (manager != null) {
280 280
                     manager.dismiss();
281 281
                 }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/url/URLDialog.java ファイルの表示

@@ -37,7 +37,7 @@ import javax.swing.JButton;
37 37
 import net.miginfocom.swing.MigLayout;
38 38
 
39 39
 /** URL Protocol dialog. */
40
-public class URLDialog extends StandardDialog implements ActionListener {
40
+public final class URLDialog extends StandardDialog implements ActionListener {
41 41
 
42 42
     /**
43 43
      * A version number for this class. It should be changed whenever the class

読み込み中…
キャンセル
保存