Browse Source

Tidying.

Remove pointless super() calls.
Remove redundant interface decs.
Remove unnecessary enum annotations.
Change .length == 0 to .isEmpty.

Change-Id: Idf6909061c246072af786d9292dc2f5ecd0ed337
Reviewed-on: http://gerrit.dmdirc.com/3841
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
pull/1/head
Chris Smith 9 years ago
parent
commit
460601925a

+ 1
- 1
src/com/dmdirc/actions/Action.java View File

@@ -221,7 +221,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
221 221
         }
222 222
 
223 223
         if (config.isFlatDomain(DOMAIN_CONDITIONTREE)
224
-                && config.getFlatDomain(DOMAIN_CONDITIONTREE).size() > 0) {
224
+                && !config.getFlatDomain(DOMAIN_CONDITIONTREE).isEmpty()) {
225 225
             conditionTree = ConditionTree.parseString(
226 226
                     config.getFlatDomain(DOMAIN_CONDITIONTREE).get(0));
227 227
 

+ 0
- 2
src/com/dmdirc/actions/ActionCondition.java View File

@@ -52,7 +52,6 @@ public class ActionCondition {
52 52
      */
53 53
     public ActionCondition(final int arg, final ActionComponent component,
54 54
             final ActionComparison comparison, final String target) {
55
-        super();
56 55
 
57 56
         this.arg = arg;
58 57
         this.component = component;
@@ -69,7 +68,6 @@ public class ActionCondition {
69 68
      */
70 69
     public ActionCondition(final String starget, final ActionComparison comparison,
71 70
             final String target) {
72
-        super();
73 71
 
74 72
         this.arg = -1;
75 73
         this.starget = starget;

+ 0
- 1
src/com/dmdirc/actions/ActionGroup.java View File

@@ -63,7 +63,6 @@ public class ActionGroup implements Iterable<Action> {
63 63
      * @param name The name of this action group
64 64
      */
65 65
     public ActionGroup(final String name) {
66
-        super();
67 66
 
68 67
         this.name = name;
69 68
     }

+ 1
- 1
src/com/dmdirc/actions/ConditionTree.java View File

@@ -31,7 +31,7 @@ import java.util.Deque;
31 31
 public final class ConditionTree {
32 32
 
33 33
     /** The possible operations on a condition tree. */
34
-    public static enum OPERATION {
34
+    public enum OPERATION {
35 35
 
36 36
         /** Only passes if both subtrees are true. */
37 37
         AND,

+ 1
- 1
src/com/dmdirc/actions/ConditionTreeFactory.java View File

@@ -48,7 +48,7 @@ public abstract class ConditionTreeFactory {
48 48
     /**
49 49
      * The possible types of ConditionTreeFactories.
50 50
      */
51
-    public static enum ConditionTreeFactoryType {
51
+    public enum ConditionTreeFactoryType {
52 52
 
53 53
         /** Factories that produce disjunction (OR) trees. */
54 54
         DISJUNCTION,

+ 2
- 2
src/com/dmdirc/commandparser/PopupManager.java View File

@@ -82,7 +82,7 @@ public class PopupManager {
82 82
         final PopupMenu res = new PopupMenu();
83 83
 
84 84
         for (String item : configManager.getOptionList("popups", menuName)) {
85
-            if (item.length() > 0 && item.charAt(0) == '<') {
85
+            if (!item.isEmpty() && item.charAt(0) == '<') {
86 86
                 res.addAll(getMenu(item.substring(1), type, configManager).getItems());
87 87
             } else {
88 88
                 res.add(getItem(item, type, configManager));
@@ -118,7 +118,7 @@ public class PopupManager {
118 118
             final String name = item.substring(0, colon);
119 119
             final String command = item.substring(colon + 1);
120 120
 
121
-            if (command.length() > 0 && command.charAt(0) == '<') {
121
+            if (!command.isEmpty() && command.charAt(0) == '<') {
122 122
                 res = new PopupMenuItem(commandController,
123 123
                         name, getMenu(command.substring(1),
124 124
                                 type, configManager));

+ 1
- 1
src/com/dmdirc/commandparser/PopupType.java View File

@@ -107,7 +107,7 @@ public enum PopupType {
107 107
      *
108 108
      * @param arity The arity of the type
109 109
      */
110
-    private PopupType(final int arity) {
110
+    PopupType(final int arity) {
111 111
         this.arity = arity;
112 112
     }
113 113
 

+ 1
- 1
src/com/dmdirc/commandparser/commands/global/Help.java View File

@@ -122,7 +122,7 @@ public class Help extends Command implements IntelligentCommand {
122 122
             final String name) {
123 123
         final Map.Entry<CommandInfo, Command> command;
124 124
 
125
-        if (name.length() > 0 && name.charAt(0) == getController().getCommandChar()) {
125
+        if (!name.isEmpty() && name.charAt(0) == getController().getCommandChar()) {
126 126
             command = getController().getCommand(name.substring(1));
127 127
         } else {
128 128
             command = getController().getCommand(name);

+ 1
- 1
src/com/dmdirc/config/ConfigTarget.java View File

@@ -34,7 +34,7 @@ import javax.annotation.Nonnull;
34 34
 public class ConfigTarget implements Comparable<ConfigTarget>, Serializable {
35 35
 
36 36
     /** The possible target types. */
37
-    public static enum TYPE {
37
+    public enum TYPE {
38 38
 
39 39
         /** Client-wide default settings. */
40 40
         GLOBALDEFAULT,

+ 0
- 1
src/com/dmdirc/config/InvalidIdentityFileException.java View File

@@ -32,7 +32,6 @@ public class InvalidIdentityFileException extends Exception {
32 32
 
33 33
     /** Creates a new instance of InvalidIdentityFileException. */
34 34
     public InvalidIdentityFileException() {
35
-        super();
36 35
     }
37 36
 
38 37
     /**

+ 21
- 30
src/com/dmdirc/interfaces/ActionController.java View File

@@ -44,7 +44,7 @@ public interface ActionController {
44 44
      *
45 45
      * @param action The action to be registered
46 46
      */
47
-    @Precondition(value = "The specified action is not null")
47
+    @Precondition("The specified action is not null")
48 48
     void addAction(final Action action);
49 49
 
50 50
     /**
@@ -60,13 +60,9 @@ public interface ActionController {
60 60
      * @param oldName The old name of the group
61 61
      * @param newName The new name of the group
62 62
      */
63
-    @Precondition(value = {
64
-        "The old name is non-null and not empty",
65
-        "The old name is an existing group",
66
-        "The new name is non-null and not empty",
67
-        "The new name is not an existing group",
68
-        "The old name does not equal the new name"
69
-    })
63
+    @Precondition({"The old name is non-null and not empty", "The old name is an existing group",
64
+            "The new name is non-null and not empty", "The new name is not an existing group",
65
+            "The old name does not equal the new name"})
70 66
     void changeGroupName(final String oldName, final String newName);
71 67
 
72 68
     /**
@@ -76,10 +72,8 @@ public interface ActionController {
76 72
      *
77 73
      * @return The newly created group
78 74
      */
79
-    @Precondition(value = {
80
-        "The specified group is non-null and not empty",
81
-        "The specified group is not an existing group"
82
-    })
75
+    @Precondition({"The specified group is non-null and not empty",
76
+            "The specified group is not an existing group"})
83 77
     ActionGroup createGroup(final String group);
84 78
 
85 79
     /**
@@ -87,10 +81,8 @@ public interface ActionController {
87 81
      *
88 82
      * @param group The group to be removed
89 83
      */
90
-    @Precondition(value = {
91
-        "The specified group is non-null and not empty",
92
-        "The specified group is an existing group"
93
-    })
84
+    @Precondition({"The specified group is non-null and not empty",
85
+            "The specified group is an existing group"})
94 86
     void deleteGroup(final String group);
95 87
 
96 88
     /**
@@ -100,7 +92,7 @@ public interface ActionController {
100 92
      *
101 93
      * @return A list of compatible action comparisons
102 94
      */
103
-    @Precondition(value = "The specified target is not null")
95
+    @Precondition("The specified target is not null")
104 96
     List<ActionComparison> findCompatibleComparisons(final Class<?> target);
105 97
 
106 98
     /**
@@ -110,7 +102,7 @@ public interface ActionController {
110 102
      *
111 103
      * @return A list of compatible action components
112 104
      */
113
-    @Precondition(value = "The specified target is not null")
105
+    @Precondition("The specified target is not null")
114 106
     List<ActionComponent> findCompatibleComponents(final Class<?> target);
115 107
 
116 108
     /**
@@ -120,7 +112,7 @@ public interface ActionController {
120 112
      *
121 113
      * @return A list of compatible action types
122 114
      */
123
-    @Precondition(value = "The specified type is not null")
115
+    @Precondition("The specified type is not null")
124 116
     List<ActionType> findCompatibleTypes(final ActionType type);
125 117
 
126 118
     /**
@@ -131,7 +123,7 @@ public interface ActionController {
131 123
      *
132 124
      * @return The actiontype with the specified name, or null on failure
133 125
      */
134
-    @Precondition(value = "The specified type is non-null and not empty")
126
+    @Precondition("The specified type is non-null and not empty")
135 127
     ActionComparison getComparison(final String type);
136 128
 
137 129
     /**
@@ -142,7 +134,7 @@ public interface ActionController {
142 134
      *
143 135
      * @return The actioncomponent with the specified name, or null on failure
144 136
      */
145
-    @Precondition(value = "The specified type is non-null and not empty")
137
+    @Precondition("The specified type is non-null and not empty")
146 138
     ActionComponent getComponent(final String type);
147 139
 
148 140
     /**
@@ -189,7 +181,7 @@ public interface ActionController {
189 181
      *
190 182
      * @param comps An array of ActionComparisons to be registered
191 183
      */
192
-    @Precondition(value = "None of the specified ActionComparisons are null")
184
+    @Precondition("None of the specified ActionComparisons are null")
193 185
     void registerComparisons(final ActionComparison[] comps);
194 186
 
195 187
     /**
@@ -197,7 +189,7 @@ public interface ActionController {
197 189
      *
198 190
      * @param comps An array of ActionComponents to be registered
199 191
      */
200
-    @Precondition(value = "None of the specified ActionComponents are null")
192
+    @Precondition("None of the specified ActionComponents are null")
201 193
     void registerComponents(final ActionComponent[] comps);
202 194
 
203 195
     /**
@@ -221,7 +213,7 @@ public interface ActionController {
221 213
      *
222 214
      * @param newTypes An array of ActionTypes to be registered
223 215
      */
224
-    @Precondition(value = "None of the specified ActionTypes are null")
216
+    @Precondition("None of the specified ActionTypes are null")
225 217
     void registerTypes(final ActionType[] newTypes);
226 218
 
227 219
     /**
@@ -229,7 +221,7 @@ public interface ActionController {
229 221
      *
230 222
      * @param action The action to be unregistered
231 223
      */
232
-    @Precondition(value = "The specified action is not null")
224
+    @Precondition("The specified action is not null")
233 225
     void removeAction(final Action action);
234 226
 
235 227
     /**
@@ -255,11 +247,10 @@ public interface ActionController {
255 247
      * @return True if the event should be processed, or false if an action listener has requested
256 248
      *         the event be skipped.
257 249
      */
258
-    @Precondition(value = {
259
-        "The specified ActionType is not null",
260
-        "The specified ActionType has a valid ActionMetaType",
261
-        "The length of the arguments array equals the arity of the ActionType's ActionMetaType"
262
-    })
250
+    @Precondition({"The specified ActionType is not null",
251
+            "The specified ActionType has a valid ActionMetaType",
252
+            "The length of the arguments array equals the arity of the ActionType's " +
253
+                    "ActionMetaType"})
263 254
     boolean triggerEvent(final ActionType type, final StringBuffer format, final Object... arguments);
264 255
 
265 256
     /**

+ 4
- 4
src/com/dmdirc/interfaces/config/IdentityFactory.java View File

@@ -40,8 +40,8 @@ public interface IdentityFactory {
40 40
      *
41 41
      * @return A config provider for the channel
42 42
      */
43
-    @Precondition(value = {"The specified network is non-null and not empty",
44
-        "The specified channel is non-null and not empty"})
43
+    @Precondition({"The specified network is non-null and not empty",
44
+            "The specified channel is non-null and not empty"})
45 45
     ConfigProvider createChannelConfig(String network, String channel);
46 46
 
47 47
     /**
@@ -51,7 +51,7 @@ public interface IdentityFactory {
51 51
      *
52 52
      * @return A config provider for the network
53 53
      */
54
-    @Precondition(value = "The specified network is non-null and not empty")
54
+    @Precondition("The specified network is non-null and not empty")
55 55
     ConfigProvider createNetworkConfig(String network);
56 56
 
57 57
     /**
@@ -61,7 +61,7 @@ public interface IdentityFactory {
61 61
      *
62 62
      * @return A config provider for the server
63 63
      */
64
-    @Precondition(value = "The specified server is non-null and not empty")
64
+    @Precondition("The specified server is non-null and not empty")
65 65
     ConfigProvider createServerConfig(String server);
66 66
 
67 67
     /**

+ 0
- 1
src/com/dmdirc/plugins/GlobalClassLoader.java View File

@@ -45,7 +45,6 @@ public final class GlobalClassLoader extends ClassLoader {
45 45
      * @param manager Plugin Manager that this GCL is used by.
46 46
      */
47 47
     public GlobalClassLoader(final PluginManager manager) {
48
-        super();
49 48
         this.manager = manager;
50 49
     }
51 50
 

+ 0
- 1
src/com/dmdirc/plugins/implementations/PluginFilesHelper.java View File

@@ -46,7 +46,6 @@ public class PluginFilesHelper {
46 46
      * @param pluginInfo This plugin's information object
47 47
      */
48 48
     public PluginFilesHelper(final PluginInfo pluginInfo) {
49
-        super();
50 49
         this.pluginInfo = pluginInfo;
51 50
         this.metaData = pluginInfo.getMetaData();
52 51
         filesDir = initFilesDir();

+ 1
- 1
src/com/dmdirc/tls/TrustResult.java View File

@@ -44,7 +44,7 @@ public enum TrustResult {
44 44
      *
45 45
      * @param trusted Whether or not this result means the cert chain is trusted.
46 46
      */
47
-    private TrustResult(final boolean trusted) {
47
+    TrustResult(final boolean trusted) {
48 48
         this.trusted = trusted;
49 49
     }
50 50
 

+ 4
- 4
src/com/dmdirc/ui/Colour.java View File

@@ -28,13 +28,13 @@ package com.dmdirc.ui;
28 28
 public class Colour {
29 29
 
30 30
     /** The colour white. */
31
-    public final static Colour WHITE = new Colour(255, 255, 255);
31
+    public static final Colour WHITE = new Colour(255, 255, 255);
32 32
     /** The colour light gray. */
33
-    public final static Colour LIGHT_GRAY = new Colour(192, 192, 192);
33
+    public static final Colour LIGHT_GRAY = new Colour(192, 192, 192);
34 34
     /** The colour gray. */
35
-    public final static Colour GRAY = new Colour(128, 128, 128);
35
+    public static final Colour GRAY = new Colour(128, 128, 128);
36 36
     /** The colour dark gray. */
37
-    public final static Colour DARK_GRAY = new Colour(64, 64, 64);
37
+    public static final Colour DARK_GRAY = new Colour(64, 64, 64);
38 38
     /** The colour black. */
39 39
     public static final Colour BLACK = new Colour(0, 0, 0);
40 40
     /** The colour red. */

+ 1
- 1
src/com/dmdirc/ui/core/components/WindowComponent.java View File

@@ -47,7 +47,7 @@ public enum WindowComponent {
47 47
      *
48 48
      * @param identifier The identifier for this window component
49 49
      */
50
-    private WindowComponent(final String identifier) {
50
+    WindowComponent(final String identifier) {
51 51
         this.identifier = identifier;
52 52
     }
53 53
 

+ 0
- 1
src/com/dmdirc/ui/core/dialogs/sslcertificate/CertificateChainEntry.java View File

@@ -45,7 +45,6 @@ public class CertificateChainEntry {
45 45
      */
46 46
     public CertificateChainEntry(final String name, final boolean trusted,
47 47
             final boolean invalid) {
48
-        super();
49 48
         this.name = name;
50 49
         this.trusted = trusted;
51 50
         this.invalid = invalid;

+ 0
- 1
src/com/dmdirc/ui/core/dialogs/sslcertificate/CertificateInformationEntry.java View File

@@ -48,7 +48,6 @@ public class CertificateInformationEntry {
48 48
      */
49 49
     public CertificateInformationEntry(final String title, final String value,
50 50
             final boolean invalid, final boolean missing) {
51
-        super();
52 51
         this.title = title;
53 52
         this.value = value;
54 53
         this.invalid = invalid;

+ 1
- 1
src/com/dmdirc/updater/manager/UpdateStatus.java View File

@@ -51,7 +51,7 @@ public enum UpdateStatus {
51 51
     /** Textual description of the status. */
52 52
     private final String description;
53 53
 
54
-    private UpdateStatus(final String description) {
54
+    UpdateStatus(final String description) {
55 55
         this.description = description;
56 56
     }
57 57
 

+ 1
- 1
src/com/dmdirc/util/URIParser.java View File

@@ -149,7 +149,7 @@ public class URIParser {
149 149
 
150 150
             host = portParts[0];
151 151
 
152
-            if (portParts[1].length() > 0 && portParts[1].charAt(0) == '+') {
152
+            if (!portParts[1].isEmpty() && portParts[1].charAt(0) == '+') {
153 153
                 ssl = true;
154 154
                 portParts[1] = portParts[1].substring(1);
155 155
             }

+ 0
- 1
src/com/dmdirc/util/resourcemanager/FileResourceManager.java View File

@@ -49,7 +49,6 @@ public final class FileResourceManager extends ResourceManager {
49 49
      * @param basePath Base path for the resource manager
50 50
      */
51 51
     protected FileResourceManager(final String basePath) {
52
-        super();
53 52
 
54 53
         this.basePath = basePath;
55 54
     }

+ 0
- 1
src/com/dmdirc/util/resourcemanager/ZipResourceManager.java View File

@@ -74,7 +74,6 @@ public final class ZipResourceManager extends ResourceManager {
74 74
      * @param file ZipFile to load
75 75
      */
76 76
     protected ZipResourceManager(final ZipFile file) {
77
-        super();
78 77
         zipFile = file;
79 78
         entries = new ArrayList<>();
80 79
         final Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();

Loading…
Cancel
Save