Quellcode durchsuchen

Style fixes and more deprecation work

tags/0.6.3m1rc1
Chris Smith vor 15 Jahren
Ursprung
Commit
bd2cbccb30

+ 1
- 1
src/com/dmdirc/Main.java Datei anzeigen

@@ -208,7 +208,7 @@ public final class Main {
208 208
                     getUI().showFeedbackNag();
209 209
                 }
210 210
             }, FEEDBACK_DELAY);
211
-        } else if (IdentityManager.getGlobalConfig().hasOption("general", "addonrevision")) {
211
+        } else if (IdentityManager.getGlobalConfig().hasOptionInt("general", "addonrevision")) {
212 212
             // @Deprecated - can be removed after 0.6 is released
213 213
             IdentityManager.getConfigIdentity().unsetOption("general", "addonrevision");
214 214
             getUI().showMigrationWizard();

+ 36
- 9
src/com/dmdirc/actions/CoreActionComparison.java Datei anzeigen

@@ -38,6 +38,7 @@ public enum CoreActionComparison implements ActionComparison {
38 38
     /** Compares a string to another using a regular expression. */
39 39
     STRING_REGEX {
40 40
         /** {@inheritDoc} */
41
+        @Override
41 42
         public boolean test(final Object arg1, final Object arg2) {
42 43
             try {
43 44
                 return ((String) arg1).matches((String) arg2);
@@ -46,110 +47,137 @@ public enum CoreActionComparison implements ActionComparison {
46 47
             }
47 48
         }
48 49
         /** {@inheritDoc} */
50
+        @Override
49 51
         public Class appliesTo() { return String.class; }
50 52
         /** {@inheritDoc} */
53
+        @Override
51 54
         public String getName() { return "matches regex"; }
52 55
     },
53 56
     
54 57
     /** Compares if two strings content are the same, case insensitive. */
55 58
     STRING_EQUALS {
56 59
         /** {@inheritDoc} */
60
+        @Override
57 61
         public boolean test(final Object arg1, final Object arg2) {
58 62
             return ((String) arg1).equalsIgnoreCase((String) arg2);
59 63
         }
60 64
         /** {@inheritDoc} */
65
+        @Override
61 66
         public Class appliesTo() { return String.class; }
62 67
         /** {@inheritDoc} */
68
+        @Override
63 69
         public String getName() { return "equals"; }
64 70
     },
65 71
     
66 72
     /** Compares if two strings content aren't the same, case insensitive. */
67 73
     STRING_NEQUALS {
68 74
         /** {@inheritDoc} */
75
+        @Override
69 76
         public boolean test(final Object arg1, final Object arg2) {
70 77
             return !STRING_EQUALS.test(arg1, arg2);
71 78
         }
72 79
         /** {@inheritDoc} */
80
+        @Override
73 81
         public Class appliesTo() { return String.class; }
74 82
         /** {@inheritDoc} */
83
+        @Override
75 84
         public String getName() { return "does not equal"; }
76 85
     },
77 86
     
78 87
     /** Checks if the string starts with another strings. */
79 88
     STRING_STARTSWITH {
80 89
         /** {@inheritDoc} */
90
+        @Override
81 91
         public boolean test(final Object arg1, final Object arg2) {
82 92
             return ((String) arg1).startsWith((String) arg2);
83 93
         }
84 94
         /** {@inheritDoc} */
95
+        @Override
85 96
         public Class appliesTo() { return String.class; }
86 97
         /** {@inheritDoc} */
98
+        @Override
87 99
         public String getName() { return "starts with"; }
88 100
     },
89 101
     
90 102
     /** Checks if the string containts another string. */
91 103
     STRING_CONTAINS {
92 104
         /** {@inheritDoc} */
105
+        @Override
93 106
         public boolean test(final Object arg1, final Object arg2) {
94 107
             return ((String) arg1).indexOf((String) arg2) != -1;
95 108
         }
96 109
         /** {@inheritDoc} */
110
+        @Override
97 111
         public Class appliesTo() { return String.class; }
98 112
         /** {@inheritDoc} */
113
+        @Override
99 114
         public String getName() { return "contains"; }
100 115
     },
101 116
 
102 117
     /** Checks if the string doesn't containt another string. */
103 118
     STRING_NCONTAINS {
104 119
         /** {@inheritDoc} */
120
+        @Override
105 121
         public boolean test(final Object arg1, final Object arg2) {
106 122
             return ((String) arg1).indexOf((String) arg2) == -1;
107 123
         }
108 124
         /** {@inheritDoc} */
125
+        @Override
109 126
         public Class appliesTo() { return String.class; }
110 127
         /** {@inheritDoc} */
128
+        @Override
111 129
         public String getName() { return "doesn't contain"; }
112 130
     },
113 131
     
114 132
     /** Checks if two boolean values are equal. */
115 133
     BOOL_IS {
116 134
         /** {@inheritDoc} */
135
+        @Override
117 136
         public boolean test(final Object arg1, final Object arg2) {
118 137
             return ((Boolean) arg1).equals(Boolean.valueOf((String) arg2));
119 138
         }
120 139
         /** {@inheritDoc} */
140
+        @Override
121 141
         public Class appliesTo() { return Boolean.class; }
122 142
         /** {@inheritDoc} */
143
+        @Override
123 144
         public String getName() { return "is"; }
124 145
     },
125 146
     
126 147
     /** Checks if the colour is the same as another colour. */
127 148
     COLOUR_EQUALS {
128 149
         /** {@inheritDoc} */
150
+        @Override
129 151
         public boolean test(final Object arg1, final Object arg2) {
130 152
             return ((Color) arg1).equals(ColourManager.parseColour((String) arg2));
131 153
         }
132 154
         /** {@inheritDoc} */
155
+        @Override
133 156
         public Class appliesTo() { return Color.class; }
134 157
         /** {@inheritDoc} */
158
+        @Override
135 159
         public String getName() { return "equals"; }
136 160
     },
137 161
     
138 162
     /** Checks if the colour is not the same as another colour. */
139 163
     COLOUR_NEQUALS {
140 164
         /** {@inheritDoc} */
165
+        @Override
141 166
         public boolean test(final Object arg1, final Object arg2) {
142 167
             return !COLOUR_EQUALS.test(arg1, arg2);
143 168
         }
144 169
         /** {@inheritDoc} */
170
+        @Override
145 171
         public Class appliesTo() { return Color.class; }
146 172
         /** {@inheritDoc} */
173
+        @Override
147 174
         public String getName() { return "does not equal"; }
148 175
     },
149 176
     
150 177
     /** Checks if the int is equals to another int. */
151 178
     INT_EQUALS {
152 179
         /** {@inheritDoc} */
180
+        @Override
153 181
         public boolean test(final Object arg1, final Object arg2) {
154 182
             try {
155 183
                 return 0 == ((Integer) arg1).compareTo(Integer.parseInt((String) arg2));
@@ -158,14 +186,17 @@ public enum CoreActionComparison implements ActionComparison {
158 186
             }
159 187
         }
160 188
         /** {@inheritDoc} */
189
+        @Override
161 190
         public Class appliesTo() { return Integer.class; }
162 191
         /** {@inheritDoc} */
192
+        @Override
163 193
         public String getName() { return "equals"; }
164 194
     },
165 195
     
166 196
     /** Checks if the int is larger than another int. */
167 197
     INT_GREATER {
168 198
         /** {@inheritDoc} */
199
+        @Override
169 200
         public boolean test(final Object arg1, final Object arg2) {
170 201
             try {
171 202
                 return 0 < ((Integer) arg1).compareTo(Integer.parseInt((String) arg2));
@@ -174,14 +205,17 @@ public enum CoreActionComparison implements ActionComparison {
174 205
             }
175 206
         }
176 207
         /** {@inheritDoc} */
208
+        @Override
177 209
         public Class appliesTo() { return Integer.class; }
178 210
         /** {@inheritDoc} */
211
+        @Override
179 212
         public String getName() { return "is greater than"; }
180 213
     },
181 214
     
182 215
     /** Checks if the int is smaller than another int. */
183 216
     INT_LESS {
184 217
         /** {@inheritDoc} */
218
+        @Override
185 219
         public boolean test(final Object arg1, final Object arg2) {
186 220
             try {
187 221
                 return 0 > ((Integer) arg1).compareTo(Integer.parseInt((String) arg2));
@@ -190,18 +224,11 @@ public enum CoreActionComparison implements ActionComparison {
190 224
             }
191 225
         }
192 226
         /** {@inheritDoc} */
227
+        @Override
193 228
         public Class appliesTo() { return Integer.class; }
194 229
         /** {@inheritDoc} */
230
+        @Override
195 231
         public String getName() { return "is less than"; }
196 232
     };
197 233
     
198
-    /** {@inheritDoc} */
199
-    public abstract boolean test(final Object arg1, final Object arg2);
200
-    
201
-    /** {@inheritDoc} */
202
-    public abstract Class appliesTo();
203
-    
204
-    /** {@inheritDoc} */
205
-    public abstract String getName();
206
-    
207 234
 }

+ 4
- 0
src/com/dmdirc/actions/metatypes/ChannelEvents.java Datei anzeigen

@@ -66,21 +66,25 @@ public enum ChannelEvents implements ActionMetaType {
66 66
     }
67 67
 
68 68
     /** {@inheritDoc} */
69
+    @Override
69 70
     public int getArity() {
70 71
         return argNames.length;
71 72
     }
72 73
 
73 74
     /** {@inheritDoc} */
75
+    @Override
74 76
     public Class[] getArgTypes() {
75 77
         return argTypes;
76 78
     }
77 79
 
78 80
     /** {@inheritDoc} */
81
+    @Override
79 82
     public String[] getArgNames() {
80 83
         return argNames;
81 84
     }
82 85
 
83 86
     /** {@inheritDoc} */
87
+    @Override
84 88
     public String getGroup() {
85 89
         return "Channel Events";
86 90
     }

+ 4
- 0
src/com/dmdirc/actions/metatypes/ClientEvents.java Datei anzeigen

@@ -75,21 +75,25 @@ public enum ClientEvents implements ActionMetaType {
75 75
     }
76 76
     
77 77
     /** {@inheritDoc} */
78
+    @Override
78 79
     public int getArity() {
79 80
         return argNames.length;
80 81
     }
81 82
     
82 83
     /** {@inheritDoc} */
84
+    @Override
83 85
     public Class[] getArgTypes() {
84 86
         return argTypes;
85 87
     }
86 88
     
87 89
     /** {@inheritDoc} */
90
+    @Override
88 91
     public String[] getArgNames() {
89 92
         return argNames;
90 93
     }
91 94
     
92 95
     /** {@inheritDoc} */
96
+    @Override
93 97
     public String getGroup() {
94 98
         return "General Events";
95 99
     }    

+ 4
- 0
src/com/dmdirc/actions/metatypes/PluginEvents.java Datei anzeigen

@@ -52,21 +52,25 @@ public enum PluginEvents implements ActionMetaType {
52 52
     }
53 53
     
54 54
     /** {@inheritDoc} */
55
+    @Override
55 56
     public int getArity() {
56 57
         return argNames.length;
57 58
     }
58 59
     
59 60
     /** {@inheritDoc} */
61
+    @Override
60 62
     public Class[] getArgTypes() {
61 63
         return argTypes;
62 64
     }
63 65
     
64 66
     /** {@inheritDoc} */
67
+    @Override
65 68
     public String[] getArgNames() {
66 69
         return argNames;
67 70
     }
68 71
     
69 72
     /** {@inheritDoc} */
73
+    @Override
70 74
     public String getGroup() {
71 75
         return "Plugin Events";
72 76
     }    

+ 4
- 0
src/com/dmdirc/actions/metatypes/QueryEvents.java Datei anzeigen

@@ -54,21 +54,25 @@ public enum QueryEvents implements ActionMetaType {
54 54
     }
55 55
     
56 56
     /** {@inheritDoc} */
57
+    @Override
57 58
     public int getArity() {
58 59
         return argNames.length;
59 60
     }
60 61
     
61 62
     /** {@inheritDoc} */
63
+    @Override
62 64
     public Class[] getArgTypes() {
63 65
         return argTypes;
64 66
     }
65 67
     
66 68
     /** {@inheritDoc} */
69
+    @Override
67 70
     public String[] getArgNames() {
68 71
         return argNames;
69 72
     }
70 73
     
71 74
     /** {@inheritDoc} */
75
+    @Override
72 76
     public String getGroup() {
73 77
         return "Query Events";
74 78
     }    

+ 4
- 0
src/com/dmdirc/actions/metatypes/ServerEvents.java Datei anzeigen

@@ -69,21 +69,25 @@ public enum ServerEvents implements ActionMetaType {
69 69
     }
70 70
     
71 71
     /** {@inheritDoc} */
72
+    @Override
72 73
     public int getArity() {
73 74
         return argNames.length;
74 75
     }
75 76
     
76 77
     /** {@inheritDoc} */
78
+    @Override
77 79
     public Class[] getArgTypes() {
78 80
         return argTypes;
79 81
     }
80 82
     
81 83
     /** {@inheritDoc} */
84
+    @Override
82 85
     public String[] getArgNames() {
83 86
         return argNames;
84 87
     }
85 88
     
86 89
     /** {@inheritDoc} */
90
+    @Override
87 91
     public String getGroup() {
88 92
         return "Server/Private Events";
89 93
     }    

+ 8
- 11
src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java Datei anzeigen

@@ -46,30 +46,27 @@ public final class ChannelSettings extends ChannelCommand implements Intelligent
46 46
         CommandManager.registerCommand(this);
47 47
     }
48 48
     
49
-    /**
50
-     * Executes this command.
51
-     * @param origin The frame in which this command was issued
52
-     * @param server The server object that this command is associated with
53
-     * @param channel The channel object that this command is associated with
54
-     * @param isSilent Whether this command is silenced or not
55
-     * @param args The user supplied arguments
56
-     */
49
+    /** {@inheritDoc} */
50
+    @Override
57 51
     public void execute(final InputWindow origin, final Server server,
58 52
             final Channel channel, final boolean isSilent, final String... args) {
59 53
         Main.getUI().showChannelSettingsDialog(channel);
60 54
     }
61 55
     
62
-    /** {@inheritDoc}. */
56
+    /** {@inheritDoc} */
57
+    @Override
63 58
     public String getName() {
64 59
         return "channelsettings";
65 60
     }
66 61
     
67
-    /** {@inheritDoc}. */
62
+    /** {@inheritDoc} */
63
+    @Override
68 64
     public boolean showInHelp() {
69 65
         return true;
70 66
     }
71 67
     
72
-    /** {@inheritDoc}. */
68
+    /** {@inheritDoc} */
69
+    @Override
73 70
     public String getHelp() {
74 71
         return "channelsettings - opens the channel settings window";
75 72
     }

+ 9
- 11
src/com/dmdirc/commandparser/commands/channel/Cycle.java Datei anzeigen

@@ -30,6 +30,7 @@ import com.dmdirc.ui.interfaces.InputWindow;
30 30
 
31 31
 /**
32 32
  * The cycle command allows users to rapidly part and rejoin a channel.
33
+ *
33 34
  * @author chris
34 35
  */
35 36
 public final class Cycle extends ChannelCommand {
@@ -41,14 +42,8 @@ public final class Cycle extends ChannelCommand {
41 42
         CommandManager.registerCommand(this);
42 43
     }
43 44
     
44
-    /**
45
-     * Executes this command.
46
-     * @param origin The frame in which this command was issued
47
-     * @param server The server object that this command is associated with
48
-     * @param channel The channel object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
52 47
     public void execute(final InputWindow origin, final Server server,
53 48
             final Channel channel, final boolean isSilent, final String... args) {
54 49
         channel.part(args.length > 0 ? implodeArgs(args)
@@ -56,17 +51,20 @@ public final class Cycle extends ChannelCommand {
56 51
         channel.join();
57 52
     }
58 53
     
59
-    /** {@inheritDoc}. */
54
+    /** {@inheritDoc} */
55
+    @Override
60 56
     public String getName() {
61 57
         return "cycle";
62 58
     }
63 59
     
64
-    /** {@inheritDoc}. */
60
+    /** {@inheritDoc} */
61
+    @Override
65 62
     public boolean showInHelp() {
66 63
         return true;
67 64
     }
68 65
     
69
-    /** {@inheritDoc}. */
66
+    /** {@inheritDoc} */
67
+    @Override
70 68
     public String getHelp() {
71 69
         return "cycle [message] - parts and rejoins the channel";
72 70
     }

+ 8
- 12
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java Datei anzeigen

@@ -51,15 +51,8 @@ public final class SetNickColour extends ChannelCommand implements IntelligentCo
51 51
         CommandManager.registerCommand(this);
52 52
     }
53 53
     
54
-    /**
55
-     * Executes this command.
56
-     * @param origin The frame in which this command was issued
57
-     * @param server The server object that this command is associated with
58
-     * @param channel The channel object that this command is associated with
59
-     * @param isSilent Whether this command is silenced or not
60
-     * @param args The user supplied arguments
61
-     */
62
-    @SuppressWarnings("unchecked")
54
+    /** {@inheritDoc} */
55
+    @SuppressWarnings("unchecked") @Override
63 56
     public void execute(final InputWindow origin, final Server server,
64 57
             final Channel channel, final boolean isSilent, final String... args) {
65 58
         
@@ -114,17 +107,20 @@ public final class SetNickColour extends ChannelCommand implements IntelligentCo
114 107
         }
115 108
     }
116 109
     
117
-    /** {@inheritDoc}. */
110
+    /** {@inheritDoc} */
111
+    @Override
118 112
     public String getName() {
119 113
         return "setnickcolour";
120 114
     }
121 115
     
122
-    /** {@inheritDoc}. */
116
+    /** {@inheritDoc} */
117
+    @Override
123 118
     public boolean showInHelp() {
124 119
         return true;
125 120
     }
126 121
     
127
-    /** {@inheritDoc}. */
122
+    /** {@inheritDoc} */
123
+    @Override
128 124
     public String getHelp() {
129 125
         return "setnickcolour [--nicklist|--text] <nick> [colour] - "
130 126
                 + "set the specified person's display colour";

+ 7
- 3
src/com/dmdirc/commandparser/commands/global/Active.java Datei anzeigen

@@ -48,6 +48,7 @@ public final class Active extends GlobalCommand implements IntelligentCommand {
48 48
     }
49 49
     
50 50
     /** {@inheritDoc} */
51
+    @Override
51 52
     public void execute(final InputWindow origin, final boolean isSilent,
52 53
             final String... args) {
53 54
         final String command = implodeArgs(args);
@@ -60,17 +61,20 @@ public final class Active extends GlobalCommand implements IntelligentCommand {
60 61
     }
61 62
     
62 63
     
63
-    /** {@inheritDoc}. */
64
+    /** {@inheritDoc} */
65
+    @Override
64 66
     public String getName() {
65 67
         return "active";
66 68
     }
67 69
     
68
-    /** {@inheritDoc}. */
70
+    /** {@inheritDoc} */
71
+    @Override
69 72
     public boolean showInHelp() {
70 73
         return true;
71 74
     }
72 75
     
73
-    /** {@inheritDoc}. */
76
+    /** {@inheritDoc} */
77
+    @Override
74 78
     public String getHelp() {
75 79
         return "active <command> - executes the command as though it had been" +
76 80
                 " typed in the active window";

Laden…
Abbrechen
Speichern