Преглед изворни кода

Merge pull request #602 from csmith/master

Ensure module methods have unique names.
pull/603/head
Shane Mc Cormack пре 9 година
родитељ
комит
f07078b284

+ 1
- 1
src/com/dmdirc/commandline/CommandLineOptionsModule.java Прегледај датотеку

@@ -196,7 +196,7 @@ public class CommandLineOptionsModule {
196 196
     @Provides
197 197
     @Singleton
198 198
     @Directory(DirectoryType.TEMPORARY)
199
-    public Path getTempDirectory(@Directory(DirectoryType.BASE) final Path baseDirectory) {
199
+    public Path getTempPath(@Directory(DirectoryType.BASE) final Path baseDirectory) {
200 200
         return baseDirectory;
201 201
     }
202 202
 

+ 41
- 335
src/com/dmdirc/commandparser/commands/CommandModule.java Прегледај датотеку

@@ -80,325 +80,136 @@ import dagger.Provides;
80 80
 @Module(library = true, complete = false)
81 81
 public class CommandModule {
82 82
 
83
-    /**
84
-     * Provides the /me command.
85
-     *
86
-     * @param command The instantiated command.
87
-     *
88
-     * @return The command's details.
89
-     */
90 83
     @Provides(type = Provides.Type.SET)
91
-    public CommandDetails getCommand(final Me command) {
84
+    public CommandDetails getMeCommand(final Me command) {
92 85
         return new SimpleCommandDetails(command, Me.INFO);
93 86
     }
94 87
 
95
-    /**
96
-     * Provides the /ban command.
97
-     *
98
-     * @param command The instantiated command.
99
-     *
100
-     * @return The command's details.
101
-     */
102 88
     @Provides(type = Provides.Type.SET)
103
-    public CommandDetails getCommand(final Ban command) {
89
+    public CommandDetails getBanCommand(final Ban command) {
104 90
         return new SimpleCommandDetails(command, Ban.INFO);
105 91
     }
106 92
 
107
-    /**
108
-     * Provides the /cycle command.
109
-     *
110
-     * @param command The instantiated command.
111
-     *
112
-     * @return The command's details.
113
-     */
114 93
     @Provides(type = Provides.Type.SET)
115
-    public CommandDetails getCommand(final Cycle command) {
94
+    public CommandDetails getCycleCommand(final Cycle command) {
116 95
         return new SimpleCommandDetails(command, Cycle.INFO);
117 96
     }
118 97
 
119
-    /**
120
-     * Provides the /invite command.
121
-     *
122
-     * @param command The instantiated command.
123
-     *
124
-     * @return The command's details.
125
-     */
126 98
     @Provides(type = Provides.Type.SET)
127
-    public CommandDetails getCommand(final Invite command) {
99
+    public CommandDetails getInviteCommand(final Invite command) {
128 100
         return new SimpleCommandDetails(command, Invite.INFO);
129 101
     }
130 102
 
131
-    /**
132
-     * Provides the /kick command.
133
-     *
134
-     * @param command The instantiated command.
135
-     *
136
-     * @return The command's details.
137
-     */
138 103
     @Provides(type = Provides.Type.SET)
139
-    public CommandDetails getCommand(final KickReason command) {
104
+    public CommandDetails getKickCommand(final KickReason command) {
140 105
         return new SimpleCommandDetails(command, KickReason.INFO);
141 106
     }
142 107
 
143
-    /**
144
-     * Provides the /mode command.
145
-     *
146
-     * @param command The instantiated command.
147
-     *
148
-     * @return The command's details.
149
-     */
150 108
     @Provides(type = Provides.Type.SET)
151
-    public CommandDetails getCommand(final Mode command) {
109
+    public CommandDetails getModeCommand(final Mode command) {
152 110
         return new SimpleCommandDetails(command, Mode.INFO);
153 111
     }
154 112
 
155
-    /**
156
-     * Provides the /names command.
157
-     *
158
-     * @param command The instantiated command.
159
-     *
160
-     * @return The command's details.
161
-     */
162 113
     @Provides(type = Provides.Type.SET)
163
-    public CommandDetails getCommand(final Names command) {
114
+    public CommandDetails getNamesCommand(final Names command) {
164 115
         return new SimpleCommandDetails(command, Names.INFO);
165 116
     }
166 117
 
167
-    /**
168
-     * Provides the /part command.
169
-     *
170
-     * @param command The instantiated command.
171
-     *
172
-     * @return The command's details.
173
-     */
174 118
     @Provides(type = Provides.Type.SET)
175
-    public CommandDetails getCommand(final Part command) {
119
+    public CommandDetails getPartCommand(final Part command) {
176 120
         return new SimpleCommandDetails(command, Part.INFO);
177 121
     }
178 122
 
179
-    /**
180
-     * Provides the /setnickcolour command.
181
-     *
182
-     * @param command The instantiated command.
183
-     *
184
-     * @return The command's details.
185
-     */
186 123
     @Provides(type = Provides.Type.SET)
187
-    public CommandDetails getCommand(final SetNickColour command) {
124
+    public CommandDetails getNickColourCommand(final SetNickColour command) {
188 125
         return new SimpleCommandDetails(command, SetNickColour.INFO);
189 126
     }
190 127
 
191
-    /**
192
-     * Provides the /topic command.
193
-     *
194
-     * @param command The instantiated command.
195
-     *
196
-     * @return The command's details.
197
-     */
198 128
     @Provides(type = Provides.Type.SET)
199
-    public CommandDetails getCommand(final ShowTopic command) {
129
+    public CommandDetails getShowTopicCommand(final ShowTopic command) {
200 130
         return new SimpleCommandDetails(command, ShowTopic.INFO);
201 131
     }
202 132
 
203
-    /**
204
-     * Provides the /allchannels command.
205
-     *
206
-     * @param command The instantiated command.
207
-     *
208
-     * @return The command's details.
209
-     */
210 133
     @Provides(type = Provides.Type.SET)
211
-    public CommandDetails getCommand(final AllChannels command) {
134
+    public CommandDetails getAllChannelsCommand(final AllChannels command) {
212 135
         return new SimpleCommandDetails(command, AllChannels.INFO);
213 136
     }
214 137
 
215
-    /**
216
-     * Provides the /away command.
217
-     *
218
-     * @param command The instantiated command.
219
-     *
220
-     * @return The command's details.
221
-     */
222 138
     @Provides(type = Provides.Type.SET)
223
-    public CommandDetails getCommand(final Away command) {
139
+    public CommandDetails getAwayCommand(final Away command) {
224 140
         return new SimpleCommandDetails(command, Away.INFO);
225 141
     }
226 142
 
227
-    /**
228
-     * Provides the /back command.
229
-     *
230
-     * @param command The instantiated command.
231
-     *
232
-     * @return The command's details.
233
-     */
234 143
     @Provides(type = Provides.Type.SET)
235
-    public CommandDetails getCommand(final Back command) {
144
+    public CommandDetails getBackCommand(final Back command) {
236 145
         return new SimpleCommandDetails(command, Back.INFO);
237 146
     }
238 147
 
239
-    /**
240
-     * Provides the /server command.
241
-     *
242
-     * @param command The instantiated command.
243
-     *
244
-     * @return The command's details.
245
-     */
246 148
     @Provides(type = Provides.Type.SET)
247
-    public CommandDetails getCommand(final ChangeServer command) {
149
+    public CommandDetails getServerCommand(final ChangeServer command) {
248 150
         return new SimpleCommandDetails(command, ChangeServer.INFO);
249 151
     }
250 152
 
251
-    /**
252
-     * Provides the /ctcp command.
253
-     *
254
-     * @param command The instantiated command.
255
-     *
256
-     * @return The command's details.
257
-     */
258 153
     @Provides(type = Provides.Type.SET)
259
-    public CommandDetails getCommand(final Ctcp command) {
154
+    public CommandDetails getCtcpCommand(final Ctcp command) {
260 155
         return new SimpleCommandDetails(command, Ctcp.INFO);
261 156
     }
262 157
 
263
-    /**
264
-     * Provides the /disconnect command.
265
-     *
266
-     * @param command The instantiated command.
267
-     *
268
-     * @return The command's details.
269
-     */
270 158
     @Provides(type = Provides.Type.SET)
271
-    public CommandDetails getCommand(final Disconnect command) {
159
+    public CommandDetails getDisconnectCommand(final Disconnect command) {
272 160
         return new SimpleCommandDetails(command, Disconnect.INFO);
273 161
     }
274 162
 
275
-    /**
276
-     * Provides the /ignore command.
277
-     *
278
-     * @param command The instantiated command.
279
-     *
280
-     * @return The command's details.
281
-     */
282 163
     @Provides(type = Provides.Type.SET)
283
-    public CommandDetails getCommand(final Ignore command) {
164
+    public CommandDetails getIgnoreCommand(final Ignore command) {
284 165
         return new SimpleCommandDetails(command, Ignore.INFO);
285 166
     }
286 167
 
287
-    /**
288
-     * Provides the /join command.
289
-     *
290
-     * @param command The instantiated command.
291
-     *
292
-     * @return The command's details.
293
-     */
294 168
     @Provides(type = Provides.Type.SET)
295
-    public CommandDetails getCommand(final JoinChannelCommand command) {
169
+    public CommandDetails getJoinCommand(final JoinChannelCommand command) {
296 170
         return new SimpleCommandDetails(command, JoinChannelCommand.INFO);
297 171
     }
298 172
 
299
-    /**
300
-     * Provides the /msg command.
301
-     *
302
-     * @param command The instantiated command.
303
-     *
304
-     * @return The command's details.
305
-     */
306 173
     @Provides(type = Provides.Type.SET)
307
-    public CommandDetails getCommand(final Message command) {
174
+    public CommandDetails getMessageCommand(final Message command) {
308 175
         return new SimpleCommandDetails(command, Message.INFO);
309 176
     }
310 177
 
311
-    /**
312
-     * Provides the /nick command.
313
-     *
314
-     * @param command The instantiated command.
315
-     *
316
-     * @return The command's details.
317
-     */
318 178
     @Provides(type = Provides.Type.SET)
319
-    public CommandDetails getCommand(final Nick command) {
179
+    public CommandDetails getNickCommand(final Nick command) {
320 180
         return new SimpleCommandDetails(command, Nick.INFO);
321 181
     }
322 182
 
323
-    /**
324
-     * Provides the /notice command.
325
-     *
326
-     * @param command The instantiated command.
327
-     *
328
-     * @return The command's details.
329
-     */
330 183
     @Provides(type = Provides.Type.SET)
331
-    public CommandDetails getCommand(final Notice command) {
184
+    public CommandDetails getNoticeCommand(final Notice command) {
332 185
         return new SimpleCommandDetails(command, Notice.INFO);
333 186
     }
334 187
 
335
-    /**
336
-     * Provides the /query command.
337
-     *
338
-     * @param command The instantiated command.
339
-     *
340
-     * @return The command's details.
341
-     */
342 188
     @Provides(type = Provides.Type.SET)
343
-    public CommandDetails getCommand(final OpenQuery command) {
189
+    public CommandDetails getQueryCommand(final OpenQuery command) {
344 190
         return new SimpleCommandDetails(command, OpenQuery.INFO);
345 191
     }
346 192
 
347
-    /**
348
-     * Provides the /raw command.
349
-     *
350
-     * @param command The instantiated command.
351
-     *
352
-     * @return The command's details.
353
-     */
354 193
     @Provides(type = Provides.Type.SET)
355
-    public CommandDetails getCommand(final Raw command) {
194
+    public CommandDetails getRawCommand(final Raw command) {
356 195
         return new SimpleCommandDetails(command, Raw.INFO);
357 196
     }
358 197
 
359
-    /**
360
-     * Provides the /reconnect command.
361
-     *
362
-     * @param command The instantiated command.
363
-     *
364
-     * @return The command's details.
365
-     */
366 198
     @Provides(type = Provides.Type.SET)
367
-    public CommandDetails getCommand(final Reconnect command) {
199
+    public CommandDetails getReconnectCommand(final Reconnect command) {
368 200
         return new SimpleCommandDetails(command, Reconnect.INFO);
369 201
     }
370 202
 
371
-    /**
372
-     * Provides the /umode command.
373
-     *
374
-     * @param command The instantiated command.
375
-     *
376
-     * @return The command's details.
377
-     */
378 203
     @Provides(type = Provides.Type.SET)
379
-    public CommandDetails getCommand(final Umode command) {
204
+    public CommandDetails getUmodeCommand(final Umode command) {
380 205
         return new SimpleCommandDetails(command, Umode.INFO);
381 206
     }
382 207
 
383
-    /**
384
-     * Provides the /whois command.
385
-     *
386
-     * @param command The instantiated command.
387
-     *
388
-     * @return The command's details
389
-     */
390 208
     @Provides(type = Provides.Type.SET)
391
-    public CommandDetails getCommand(final Whois command) {
209
+    public CommandDetails getWhoisCommand(final Whois command) {
392 210
         return new SimpleCommandDetails(command, Whois.INFO);
393 211
     }
394 212
 
395
-    /**
396
-     * Provides a set of raw commands.
397
-     *
398
-     * @param controller The controller to use for command info.
399
-     *
400
-     * @return A set of the commands' details.
401
-     */
402 213
     @Provides(type = Provides.Type.SET_VALUES)
403 214
     public Set<CommandDetails> getRawCommands(final CommandController controller) {
404 215
         final Set<CommandDetails> results = new HashSet<>();
@@ -409,183 +220,78 @@ public class CommandModule {
409 220
         return results;
410 221
     }
411 222
 
412
-    /**
413
-     * Provides the /alias command.
414
-     *
415
-     * @param command The instantiated command.
416
-     *
417
-     * @return The command's details.
418
-     */
419 223
     @Provides(type = Provides.Type.SET)
420
-    public CommandDetails getCommand(final AliasCommand command) {
224
+    public CommandDetails getAliasCommand(final AliasCommand command) {
421 225
         return new SimpleCommandDetails(command, AliasCommand.INFO);
422 226
     }
423 227
 
424
-    /**
425
-     * Provides the /allservers command.
426
-     *
427
-     * @param command The instantiated command.
428
-     *
429
-     * @return The command's details.
430
-     */
431 228
     @Provides(type = Provides.Type.SET)
432
-    public CommandDetails getCommand(final AllServers command) {
229
+    public CommandDetails getAllServersCommand(final AllServers command) {
433 230
         return new SimpleCommandDetails(command, AllServers.INFO);
434 231
     }
435 232
 
436
-    /**
437
-     * Provides the /clear command.
438
-     *
439
-     * @param command The instantiated command.
440
-     *
441
-     * @return The command's details.
442
-     */
443 233
     @Provides(type = Provides.Type.SET)
444
-    public CommandDetails getCommand(final Clear command) {
234
+    public CommandDetails getClearCommand(final Clear command) {
445 235
         return new SimpleCommandDetails(command, Clear.INFO);
446 236
     }
447 237
 
448
-    /**
449
-     * Provides the /echo command.
450
-     *
451
-     * @param command The instantiated command.
452
-     *
453
-     * @return The command's details.
454
-     */
455 238
     @Provides(type = Provides.Type.SET)
456
-    public CommandDetails getCommand(final Echo command) {
239
+    public CommandDetails getEchoCommand(final Echo command) {
457 240
         return new SimpleCommandDetails(command, Echo.INFO);
458 241
     }
459 242
 
460
-    /**
461
-     * Provides the /exit command.
462
-     *
463
-     * @param command The instantiated command.
464
-     *
465
-     * @return The command's details.
466
-     */
467 243
     @Provides(type = Provides.Type.SET)
468
-    public CommandDetails getCommand(final Exit command) {
244
+    public CommandDetails getExitCommand(final Exit command) {
469 245
         return new SimpleCommandDetails(command, Exit.INFO);
470 246
     }
471 247
 
472
-    /**
473
-     * Provides the /Help command.
474
-     *
475
-     * @param command The instantiated command.
476
-     *
477
-     * @return The command's details.
478
-     */
479 248
     @Provides(type = Provides.Type.SET)
480
-    public CommandDetails getCommand(final Help command) {
249
+    public CommandDetails getHelpCommand(final Help command) {
481 250
         return new SimpleCommandDetails(command, Help.INFO);
482 251
     }
483 252
 
484
-    /**
485
-     * Provides the /ifplugin command.
486
-     *
487
-     * @param command The instantiated command.
488
-     *
489
-     * @return The command's details.
490
-     */
491 253
     @Provides(type = Provides.Type.SET)
492
-    public CommandDetails getCommand(final Ifplugin command) {
254
+    public CommandDetails getIfpluginCommand(final Ifplugin command) {
493 255
         return new SimpleCommandDetails(command, Ifplugin.INFO);
494 256
     }
495 257
 
496
-    /**
497
-     * Provides the /newserver command.
498
-     *
499
-     * @param command The instantiated command.
500
-     *
501
-     * @return The command's details.
502
-     */
503 258
     @Provides(type = Provides.Type.SET)
504
-    public CommandDetails getCommand(final NewServer command) {
259
+    public CommandDetails getNewServerCommand(final NewServer command) {
505 260
         return new SimpleCommandDetails(command, NewServer.INFO);
506 261
     }
507 262
 
508
-    /**
509
-     * Provides the /loadplugin command.
510
-     *
511
-     * @param command The instantiated command.
512
-     *
513
-     * @return The command's details.
514
-     */
515 263
     @Provides(type = Provides.Type.SET)
516
-    public CommandDetails getCommand(final LoadPlugin command) {
264
+    public CommandDetails getLoadPluginCommand(final LoadPlugin command) {
517 265
         return new SimpleCommandDetails(command, LoadPlugin.INFO);
518 266
     }
519 267
 
520
-    /**
521
-     * Provides the /unloadplugin command.
522
-     *
523
-     * @param command The instantiated command.
524
-     *
525
-     * @return The command's details.
526
-     */
527 268
     @Provides(type = Provides.Type.SET)
528
-    public CommandDetails getCommand(final UnloadPlugin command) {
269
+    public CommandDetails getUnloadPluginCommand(final UnloadPlugin command) {
529 270
         return new SimpleCommandDetails(command, UnloadPlugin.INFO);
530 271
     }
531 272
 
532
-    /**
533
-     * Provides the /openwindow command.
534
-     *
535
-     * @param command The instantiated command.
536
-     *
537
-     * @return The command's details.
538
-     */
539 273
     @Provides(type = Provides.Type.SET)
540
-    public CommandDetails getCommand(final OpenWindow command) {
274
+    public CommandDetails getOpenWindowCommand(final OpenWindow command) {
541 275
         return new SimpleCommandDetails(command, OpenWindow.INFO);
542 276
     }
543 277
 
544
-    /**
545
-     * Provides the /reloadidentities command.
546
-     *
547
-     * @param command The instantiated command.
548
-     *
549
-     * @return The command's details.
550
-     */
551 278
     @Provides(type = Provides.Type.SET)
552
-    public CommandDetails getCommand(final ReloadIdentities command) {
279
+    public CommandDetails getReloadIdentitiesCommand(final ReloadIdentities command) {
553 280
         return new SimpleCommandDetails(command, ReloadIdentities.INFO);
554 281
     }
555 282
 
556
-    /**
557
-     * Provides the /reloadplugin command.
558
-     *
559
-     * @param command The instantiated command.
560
-     *
561
-     * @return The command's details.
562
-     */
563 283
     @Provides(type = Provides.Type.SET)
564
-    public CommandDetails getCommand(final ReloadPlugin command) {
284
+    public CommandDetails getReloadPluginCommand(final ReloadPlugin command) {
565 285
         return new SimpleCommandDetails(command, ReloadPlugin.INFO);
566 286
     }
567 287
 
568
-    /**
569
-     * Provides the /saveconfig command.
570
-     *
571
-     * @param command The instantiated command.
572
-     *
573
-     * @return The command's details.
574
-     */
575 288
     @Provides(type = Provides.Type.SET)
576
-    public CommandDetails getCommand(final SaveConfig command) {
289
+    public CommandDetails getSaveConfigCommand(final SaveConfig command) {
577 290
         return new SimpleCommandDetails(command, SaveConfig.INFO);
578 291
     }
579 292
 
580
-    /**
581
-     * Provides the /set command.
582
-     *
583
-     * @param command The instantiated command.
584
-     *
585
-     * @return The command's details.
586
-     */
587 293
     @Provides(type = Provides.Type.SET)
588
-    public CommandDetails getCommand(final SetCommand command) {
294
+    public CommandDetails getSetCommand(final SetCommand command) {
589 295
         return new SimpleCommandDetails(command, SetCommand.INFO);
590 296
     }
591 297
 

+ 12
- 12
src/com/dmdirc/ui/messages/sink/MessagesModule.java Прегледај датотеку

@@ -47,62 +47,62 @@ public class MessagesModule {
47 47
     }
48 48
 
49 49
     @Provides(type = Provides.Type.SET)
50
-    public MessageSink getMessageSink(final AllMessageSink sink) {
50
+    public MessageSink getAllMessageSink(final AllMessageSink sink) {
51 51
         return sink;
52 52
     }
53 53
 
54 54
     @Provides(type = Provides.Type.SET)
55
-    public MessageSink getMessageSink(final ChannelMessageSink sink) {
55
+    public MessageSink getChannelMessageSink(final ChannelMessageSink sink) {
56 56
         return sink;
57 57
     }
58 58
 
59 59
     @Provides(type = Provides.Type.SET)
60
-    public MessageSink getMessageSink(final CommonChannelsMessageSink sink) {
60
+    public MessageSink getCommonChannelsMessageSink(final CommonChannelsMessageSink sink) {
61 61
         return sink;
62 62
     }
63 63
 
64 64
     @Provides(type = Provides.Type.SET)
65
-    public MessageSink getMessageSink(final CustomWindowMessageSink sink) {
65
+    public MessageSink getCustomWindowMessageSink(final CustomWindowMessageSink sink) {
66 66
         return sink;
67 67
     }
68 68
 
69 69
     @Provides(type = Provides.Type.SET)
70
-    public MessageSink getMessageSink(final ForkMessageSink sink) {
70
+    public MessageSink getForkMessageSink(final ForkMessageSink sink) {
71 71
         return sink;
72 72
     }
73 73
 
74 74
     @Provides(type = Provides.Type.SET)
75
-    public MessageSink getMessageSink(final FormatMessageSink sink) {
75
+    public MessageSink getFormatMessageSink(final FormatMessageSink sink) {
76 76
         return sink;
77 77
     }
78 78
 
79 79
     @Provides(type = Provides.Type.SET)
80
-    public MessageSink getMessageSink(final GroupMessageSink sink) {
80
+    public MessageSink getGroupMessageSink(final GroupMessageSink sink) {
81 81
         return sink;
82 82
     }
83 83
 
84 84
     @Provides(type = Provides.Type.SET)
85
-    public MessageSink getMessageSink(final LastCommandMessageSink sink) {
85
+    public MessageSink getLastCommandMessageSink(final LastCommandMessageSink sink) {
86 86
         return sink;
87 87
     }
88 88
 
89 89
     @Provides(type = Provides.Type.SET)
90
-    public MessageSink getMessageSink(final NullMessageSink sink) {
90
+    public MessageSink getNullMessageSink(final NullMessageSink sink) {
91 91
         return sink;
92 92
     }
93 93
 
94 94
     @Provides(type = Provides.Type.SET)
95
-    public MessageSink getMessageSink(final SelfMessageSink sink) {
95
+    public MessageSink getSelfMessageSink(final SelfMessageSink sink) {
96 96
         return sink;
97 97
     }
98 98
 
99 99
     @Provides(type = Provides.Type.SET)
100
-    public MessageSink getMessageSink(final ServerMessageSink sink) {
100
+    public MessageSink getServerMessageSink(final ServerMessageSink sink) {
101 101
         return sink;
102 102
     }
103 103
 
104 104
     @Provides(type = Provides.Type.SET)
105
-    public MessageSink getMessageSink(final StatusBarMessageSink sink) {
105
+    public MessageSink getStatusBarMessageSink(final StatusBarMessageSink sink) {
106 106
         return sink;
107 107
     }
108 108
 

Loading…
Откажи
Сачувај