Browse Source

Fully configure the NB formatter and let it loose.

Change-Id: I7e8052839daa79fa113b89fd0b8c1c892a605b73
Reviewed-on: http://gerrit.dmdirc.com/3122
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.8rc1
Chris Smith 10 years ago
parent
commit
f538c53f86
100 changed files with 1796 additions and 1435 deletions
  1. 36
    0
      nbproject/project.properties
  2. 39
    58
      src/com/dmdirc/Channel.java
  3. 0
    3
      src/com/dmdirc/ChannelClientProperty.java
  4. 23
    3
      src/com/dmdirc/ChannelEventHandler.java
  5. 60
    42
      src/com/dmdirc/ClientModule.java
  6. 4
    5
      src/com/dmdirc/CorePluginExtractor.java
  7. 6
    6
      src/com/dmdirc/CustomWindow.java
  8. 6
    7
      src/com/dmdirc/EventHandler.java
  9. 54
    59
      src/com/dmdirc/FrameContainer.java
  10. 9
    7
      src/com/dmdirc/FrameContainerComparator.java
  11. 15
    15
      src/com/dmdirc/GlobalWindow.java
  12. 4
    5
      src/com/dmdirc/Invite.java
  13. 18
    31
      src/com/dmdirc/Main.java
  14. 2
    3
      src/com/dmdirc/MessageEncoder.java
  15. 10
    11
      src/com/dmdirc/MessageTarget.java
  16. 8
    8
      src/com/dmdirc/MissingModeAliasException.java
  17. 12
    6
      src/com/dmdirc/ParserFactory.java
  18. 2
    3
      src/com/dmdirc/Precondition.java
  19. 21
    23
      src/com/dmdirc/Query.java
  20. 7
    7
      src/com/dmdirc/Raw.java
  21. 59
    90
      src/com/dmdirc/Server.java
  22. 16
    18
      src/com/dmdirc/ServerManager.java
  23. 26
    31
      src/com/dmdirc/ServerState.java
  24. 13
    16
      src/com/dmdirc/ServerStatus.java
  25. 0
    1
      src/com/dmdirc/SystemLifecycleController.java
  26. 2
    2
      src/com/dmdirc/Topic.java
  27. 33
    33
      src/com/dmdirc/WritableFrameContainer.java
  28. 31
    32
      src/com/dmdirc/actions/Action.java
  29. 7
    8
      src/com/dmdirc/actions/ActionComponentChain.java
  30. 11
    13
      src/com/dmdirc/actions/ActionCondition.java
  31. 0
    4
      src/com/dmdirc/actions/ActionErrorType.java
  32. 18
    16
      src/com/dmdirc/actions/ActionFactory.java
  33. 7
    12
      src/com/dmdirc/actions/ActionGroup.java
  34. 31
    41
      src/com/dmdirc/actions/ActionManager.java
  35. 39
    51
      src/com/dmdirc/actions/ActionModel.java
  36. 46
    44
      src/com/dmdirc/actions/ActionSubstitutor.java
  37. 3
    3
      src/com/dmdirc/actions/ActionTypeComparator.java
  38. 25
    6
      src/com/dmdirc/actions/ColourActionComparison.java
  39. 46
    49
      src/com/dmdirc/actions/ConditionTree.java
  40. 10
    7
      src/com/dmdirc/actions/ConditionTreeFactory.java
  41. 84
    32
      src/com/dmdirc/actions/CoreActionComparison.java
  42. 485
    167
      src/com/dmdirc/actions/CoreActionComponent.java
  43. 16
    35
      src/com/dmdirc/actions/CoreActionType.java
  44. 13
    16
      src/com/dmdirc/actions/internal/WhoisNumericFormatter.java
  45. 1
    2
      src/com/dmdirc/actions/metatypes/ActionEvents.java
  46. 14
    8
      src/com/dmdirc/actions/metatypes/ChannelEvents.java
  47. 13
    8
      src/com/dmdirc/actions/metatypes/ClientEvents.java
  48. 1
    0
      src/com/dmdirc/actions/metatypes/LinkEvents.java
  49. 1
    2
      src/com/dmdirc/actions/metatypes/PluginEvents.java
  50. 3
    3
      src/com/dmdirc/actions/metatypes/QueryEvents.java
  51. 13
    8
      src/com/dmdirc/actions/metatypes/ServerEvents.java
  52. 2
    1
      src/com/dmdirc/actions/validators/ActionNameValidator.java
  53. 2
    2
      src/com/dmdirc/actions/validators/ConditionRuleValidator.java
  54. 10
    13
      src/com/dmdirc/actions/wrappers/Alias.java
  55. 4
    6
      src/com/dmdirc/actions/wrappers/AliasWrapper.java
  56. 2
    2
      src/com/dmdirc/actions/wrappers/PerformType.java
  57. 28
    22
      src/com/dmdirc/actions/wrappers/PerformWrapper.java
  58. 13
    3
      src/com/dmdirc/commandline/CommandLineOptionsModule.java
  59. 18
    29
      src/com/dmdirc/commandline/CommandLineParser.java
  60. 1
    0
      src/com/dmdirc/commandline/RemoteInterface.java
  61. 3
    5
      src/com/dmdirc/commandline/RemoteServer.java
  62. 2
    4
      src/com/dmdirc/commandparser/BaseCommandInfo.java
  63. 31
    35
      src/com/dmdirc/commandparser/CommandArguments.java
  64. 8
    8
      src/com/dmdirc/commandparser/CommandInfo.java
  65. 1
    3
      src/com/dmdirc/commandparser/CommandInfoPair.java
  66. 23
    27
      src/com/dmdirc/commandparser/CommandManager.java
  67. 9
    7
      src/com/dmdirc/commandparser/CommandType.java
  68. 10
    7
      src/com/dmdirc/commandparser/PopupManager.java
  69. 10
    9
      src/com/dmdirc/commandparser/PopupMenuItem.java
  70. 1
    14
      src/com/dmdirc/commandparser/PopupType.java
  71. 18
    19
      src/com/dmdirc/commandparser/commands/Command.java
  72. 44
    3
      src/com/dmdirc/commandparser/commands/CommandModule.java
  73. 7
    6
      src/com/dmdirc/commandparser/commands/ExternalCommand.java
  74. 7
    8
      src/com/dmdirc/commandparser/commands/IntelligentCommand.java
  75. 0
    1
      src/com/dmdirc/commandparser/commands/PreviousCommand.java
  76. 6
    3
      src/com/dmdirc/commandparser/commands/ValidatingCommand.java
  77. 5
    5
      src/com/dmdirc/commandparser/commands/WrappableCommand.java
  78. 1
    0
      src/com/dmdirc/commandparser/commands/channel/Ban.java
  79. 2
    2
      src/com/dmdirc/commandparser/commands/channel/KickReason.java
  80. 1
    1
      src/com/dmdirc/commandparser/commands/channel/Part.java
  81. 5
    4
      src/com/dmdirc/commandparser/commands/channel/SetNickColour.java
  82. 5
    3
      src/com/dmdirc/commandparser/commands/channel/ShowTopic.java
  83. 1
    0
      src/com/dmdirc/commandparser/commands/chat/Me.java
  84. 3
    4
      src/com/dmdirc/commandparser/commands/context/ChannelCommandContext.java
  85. 3
    2
      src/com/dmdirc/commandparser/commands/context/ChatCommandContext.java
  86. 3
    4
      src/com/dmdirc/commandparser/commands/context/CommandContext.java
  87. 3
    4
      src/com/dmdirc/commandparser/commands/context/QueryCommandContext.java
  88. 2
    2
      src/com/dmdirc/commandparser/commands/context/ServerCommandContext.java
  89. 14
    18
      src/com/dmdirc/commandparser/commands/flags/CommandFlag.java
  90. 37
    35
      src/com/dmdirc/commandparser/commands/flags/CommandFlagHandler.java
  91. 13
    10
      src/com/dmdirc/commandparser/commands/flags/CommandFlagResult.java
  92. 4
    6
      src/com/dmdirc/commandparser/commands/global/AliasCommand.java
  93. 1
    2
      src/com/dmdirc/commandparser/commands/global/AllServers.java
  94. 1
    2
      src/com/dmdirc/commandparser/commands/global/Echo.java
  95. 3
    5
      src/com/dmdirc/commandparser/commands/global/Exit.java
  96. 6
    6
      src/com/dmdirc/commandparser/commands/global/Help.java
  97. 4
    6
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  98. 1
    2
      src/com/dmdirc/commandparser/commands/global/LoadPlugin.java
  99. 15
    15
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  100. 0
    0
      src/com/dmdirc/commandparser/commands/global/Notify.java

+ 36
- 0
nbproject/project.properties View File

@@ -9,12 +9,48 @@ auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=8
9 9
 auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=100
10 10
 auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
11 11
 auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
12
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignJavadocExceptionDescriptions=true
13
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignJavadocParameterDescriptions=true
14
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignJavadocReturnDescription=true
12 15
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.allowConvertToStarImport=false
16
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLineAfterJavadocParameterDescriptions=true
17
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLineAfterJavadocReturnTag=true
18
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClassClosingBrace=1
19
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforePackage=1
13 20
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classMembersOrder=STATIC_INIT;STATIC FIELD;FIELD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC METHOD;STATIC CLASS;CLASS
14 21
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.countForUsingStaticStarImport=1
22
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.enableBlockCommentFormatting=true
23
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=true
15 24
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=com.dmdirc;com.google;java;javax;net.miginfocom;org;*;static *
25
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
16 26
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateStaticImports=true
27
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
28
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=8
29
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width=100
30
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap=words
31
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAnnotationArgs=WRAP_IF_LONG
32
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAnnotations=WRAP_IF_LONG
33
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapArrayInit=WRAP_IF_LONG
34
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAssert=WRAP_IF_LONG
35
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapAssignOps=WRAP_IF_LONG
36
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapBinaryOps=WRAP_IF_LONG
37
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapChainedMethodCalls=WRAP_IF_LONG
38
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapDisjunctiveCatchTypes=WRAP_IF_LONG
39
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapDoWhileStatement=WRAP_IF_LONG
40
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapEnumConstants=WRAP_IF_LONG
41
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapExtendsImplementsKeyword=WRAP_IF_LONG
42
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapExtendsImplementsList=WRAP_IF_LONG
43
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapFor=WRAP_IF_LONG
44
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapForStatement=WRAP_IF_LONG
45
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapIfStatement=WRAP_IF_LONG
46
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapMethodCallArgs=WRAP_IF_LONG
47
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapMethodParams=WRAP_IF_LONG
17 48
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapOneLineComment=false
49
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapTernaryOps=WRAP_IF_LONG
50
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapThrowsKeyword=WRAP_IF_LONG
51
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapThrowsList=WRAP_IF_LONG
52
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapTryResources=WRAP_IF_LONG
53
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapWhileStatement=WRAP_IF_LONG
18 54
 auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
19 55
 endorsed.classpath=
20 56
 javac.classpath=

+ 39
- 58
src/com/dmdirc/Channel.java View File

@@ -59,56 +59,46 @@ import java.util.Map;
59 59
 import javax.annotation.Nonnull;
60 60
 
61 61
 /**
62
- * The Channel class represents the client's view of the channel. It handles
63
- * callbacks for channel events from the parser, maintains the corresponding
64
- * ChannelWindow, and handles user input for the channel.
62
+ * The Channel class represents the client's view of the channel. It handles callbacks for channel
63
+ * events from the parser, maintains the corresponding ChannelWindow, and handles user input for the
64
+ * channel.
65 65
  */
66 66
 @Factory(inject = true, providers = true, singleton = true)
67 67
 public class Channel extends MessageTarget implements ConfigChangeListener {
68 68
 
69 69
     /** List of registered listeners. */
70 70
     private final ListenerList listenerList = new ListenerList();
71
-
72 71
     /** The parser's pChannel class. */
73 72
     private ChannelInfo channelInfo;
74
-
75 73
     /** The server this channel is on. */
76 74
     private final Server server;
77
-
78 75
     /** The tabcompleter used for this channel. */
79 76
     private final TabCompleter tabCompleter;
80
-
81 77
     /** A list of previous topics we've seen. */
82 78
     private final RollingList<Topic> topics;
83
-
84 79
     /** Our event handler. */
85 80
     private final ChannelEventHandler eventHandler;
86
-
87 81
     /** The migrator to use to migrate our config provider. */
88 82
     private final ConfigProviderMigrator configMigrator;
89
-
90 83
     /** Whether we're in this channel or not. */
91 84
     private boolean isOnChannel;
92
-
93 85
     /** Whether we should send WHO requests for this channel. */
94 86
     private volatile boolean sendWho;
95
-
96 87
     /** Whether we should show mode prefixes in text. */
97 88
     private volatile boolean showModePrefix;
98
-
99 89
     /** Whether we should show colours in nicks. */
100 90
     private volatile boolean showColours;
101 91
 
102 92
     /**
103 93
      * Creates a new instance of Channel.
104 94
      *
105
-     * @param newServer The server object that this channel belongs to
106
-     * @param newChannelInfo The parser's channel object that corresponds to this channel
107
-     * @param configMigrator The config migrator which provides the config for this channel.
95
+     * @param newServer           The server object that this channel belongs to
96
+     * @param newChannelInfo      The parser's channel object that corresponds to this channel
97
+     * @param configMigrator      The config migrator which provides the config for this channel.
108 98
      * @param tabCompleterFactory The factory to use to create tab completers.
109
-     * @param commandController The controller to load commands from.
110
-     * @param messageSinkManager The sink manager to use to despatch messages.
111
-     * @param urlBuilder The URL builder to use when finding icons.
99
+     * @param commandController   The controller to load commands from.
100
+     * @param messageSinkManager  The sink manager to use to despatch messages.
101
+     * @param urlBuilder          The URL builder to use when finding icons.
112 102
      */
113 103
     public Channel(
114 104
             @Unbound final Server newServer,
@@ -125,9 +115,9 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
125 115
                 messageSinkManager,
126 116
                 urlBuilder,
127 117
                 Arrays.asList(WindowComponent.TEXTAREA.getIdentifier(),
128
-                    WindowComponent.INPUTFIELD.getIdentifier(),
129
-                    WindowComponent.TOPICBAR.getIdentifier(),
130
-                    WindowComponent.USERLIST.getIdentifier()));
118
+                WindowComponent.INPUTFIELD.getIdentifier(),
119
+                WindowComponent.TOPICBAR.getIdentifier(),
120
+                WindowComponent.USERLIST.getIdentifier()));
131 121
 
132 122
         this.configMigrator = configMigrator;
133 123
         channelInfo = newChannelInfo;
@@ -241,9 +231,9 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
241 231
     }
242 232
 
243 233
     /**
244
-     * Sets this object's ChannelInfo reference to the one supplied. This only
245
-     * needs to be done if the channel window (and hence this channel object)
246
-     * has stayed open while the user has been out of the channel.
234
+     * Sets this object's ChannelInfo reference to the one supplied. This only needs to be done if
235
+     * the channel window (and hence this channel object) has stayed open while the user has been
236
+     * out of the channel.
247 237
      *
248 238
      * @param newChannelInfo The new ChannelInfo object
249 239
      */
@@ -269,8 +259,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
269 259
     }
270 260
 
271 261
     /**
272
-     * Updates the title of the channel window, and of the main window if
273
-     * appropriate.
262
+     * Updates the title of the channel window, and of the main window if appropriate.
274 263
      */
275 264
     private void updateTitle() {
276 265
         String temp = Styliser.stipControlCodes(channelInfo.getName());
@@ -283,16 +272,14 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
283 272
     }
284 273
 
285 274
     /**
286
-     * Joins the specified channel. This only makes sense if used after a call
287
-     * to part().
275
+     * Joins the specified channel. This only makes sense if used after a call to part().
288 276
      */
289 277
     public void join() {
290 278
         server.getParser().joinChannel(channelInfo.getName());
291 279
     }
292 280
 
293 281
     /**
294
-     * Parts this channel with the specified message. Parting does NOT close the
295
-     * channel window.
282
+     * Parts this channel with the specified message. Parting does NOT close the channel window.
296 283
      *
297 284
      * @param reason The reason for parting the channel
298 285
      */
@@ -349,8 +336,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
349 336
     }
350 337
 
351 338
     /**
352
-     * Called every {general.whotime} seconds to check if the channel needs
353
-     * to send a who request.
339
+     * Called every {general.whotime} seconds to check if the channel needs to send a who request.
354 340
      */
355 341
     public void checkWho() {
356 342
         if (isOnChannel && sendWho) {
@@ -385,8 +371,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
385 371
     }
386 372
 
387 373
     /**
388
-     * Replaces the list of known clients on this channel with the specified
389
-     * one.
374
+     * Replaces the list of known clients on this channel with the specified one.
390 375
      *
391 376
      * @param clients The list of clients to use
392 377
      */
@@ -413,8 +398,8 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
413 398
     }
414 399
 
415 400
     /**
416
-     * Refreshes the list of clients stored by this channel. Should be called
417
-     * when (visible) user modes or nicknames change.
401
+     * Refreshes the list of clients stored by this channel. Should be called when (visible) user
402
+     * modes or nicknames change.
418 403
      */
419 404
     public void refreshClients() {
420 405
         if (!isOnChannel) {
@@ -425,12 +410,12 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
425 410
     }
426 411
 
427 412
     /**
428
-     * Returns a string containing the most important mode for the specified
429
-     * client.
413
+     * Returns a string containing the most important mode for the specified client.
430 414
      *
431 415
      * @param channelClient The channel client to check.
432
-     * @return A string containing the most important mode, or an empty string
433
-     * if there are no (known) modes.
416
+     *
417
+     * @return A string containing the most important mode, or an empty string if there are no
418
+     *         (known) modes.
434 419
      */
435 420
     private String getModes(final ChannelClientInfo channelClient) {
436 421
         if (channelClient == null || !showModePrefix) {
@@ -457,25 +442,24 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
457 442
     }
458 443
 
459 444
     /**
460
-     * Returns a string[] containing the nickname/ident/host of a channel
461
-     * client.
445
+     * Returns a string[] containing the nickname/ident/host of a channel client.
462 446
      *
463 447
      * @param client The channel client to check
448
+     *
464 449
      * @return A string[] containing displayable components
465 450
      */
466 451
     private String[] getDetails(final ChannelClientInfo client) {
467 452
         if (client == null) {
468 453
             // WTF?
469 454
             throw new UnsupportedOperationException("getDetails called with"
470
-                     + " null ChannelClientInfo");
455
+                    + " null ChannelClientInfo");
471 456
         }
472 457
 
473
-        final String[] res = new String[] {
458
+        final String[] res = new String[]{
474 459
             getModes(client),
475 460
             Styliser.CODE_NICKNAME + client.getClient().getNickname() + Styliser.CODE_NICKNAME,
476 461
             client.getClient().getUsername(),
477
-            client.getClient().getHostname(),
478
-        };
462
+            client.getClient().getHostname(),};
479 463
 
480 464
         if (showColours) {
481 465
             final Map<?, ?> map = client.getMap();
@@ -484,11 +468,11 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
484 468
                 String prefix;
485 469
 
486 470
                 if (map.containsKey(ChannelClientProperty.TEXT_BACKGROUND)) {
487
-                    prefix = "," + ColourManager.getHex((Colour)
488
-                            map.get(ChannelClientProperty.TEXT_BACKGROUND));
471
+                    prefix = "," + ColourManager.getHex((Colour) map.get(
472
+                            ChannelClientProperty.TEXT_BACKGROUND));
489 473
                 } else {
490
-                    prefix = Styliser.CODE_HEXCOLOUR + ColourManager.getHex((Colour)
491
-                            map.get(ChannelClientProperty.TEXT_FOREGROUND));
474
+                    prefix = Styliser.CODE_HEXCOLOUR + ColourManager.getHex((Colour) map.get(
475
+                            ChannelClientProperty.TEXT_FOREGROUND));
492 476
                 }
493 477
 
494 478
                 res[1] = prefix + res[1] + Styliser.CODE_HEXCOLOUR;
@@ -541,7 +525,6 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
541 525
     }
542 526
 
543 527
     // ---------------------------------------------------- TOPIC HANDLING -----
544
-
545 528
     /**
546 529
      * Adds the specified topic to this channel's topic list.
547 530
      *
@@ -554,7 +537,6 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
554 537
         updateTitle();
555 538
 
556 539
         new Thread(new Runnable() {
557
-
558 540
             /** {@inheritDoc} */
559 541
             @Override
560 542
             public void run() {
@@ -567,8 +549,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
567 549
     /**
568 550
      * Retrieve the topics that have been seen on this channel.
569 551
      *
570
-     * @return A list of topics that have been seen on this channel, including
571
-     * the current one.
552
+     * @return A list of topics that have been seen on this channel, including the current one.
572 553
      */
573 554
     public List<Topic> getTopics() {
574 555
         synchronized (topics) {
@@ -592,12 +573,10 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
592 573
     }
593 574
 
594 575
     // ------------------------------------------ PARSER METHOD DELEGATION -----
595
-
596 576
     /**
597 577
      * Attempts to set the topic of this channel.
598 578
      *
599
-     * @param topic The new topic to be used. An empty string will clear the
600
-     * current topic
579
+     * @param topic The new topic to be used. An empty string will clear the current topic
601 580
      */
602 581
     public void setTopic(final String topic) {
603 582
         channelInfo.setTopic(topic);
@@ -607,6 +586,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
607 586
      * Retrieves the maximum length that a topic on this channel can be.
608 587
      *
609 588
      * @return The maximum length that this channel's topic may be
589
+     *
610 590
      * @since 0.6.3
611 591
      */
612 592
     public int getMaxTopicLength() {
@@ -655,4 +635,5 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
655 635
     public Connection getConnection() {
656 636
         return server;
657 637
     }
638
+
658 639
 }

+ 0
- 3
src/com/dmdirc/ChannelClientProperty.java View File

@@ -29,13 +29,10 @@ public enum ChannelClientProperty {
29 29
 
30 30
     /** Nicklist client foreground colour. */
31 31
     NICKLIST_FOREGROUND,
32
-
33 32
     /** Nicklist client background colour. */
34 33
     NICKLIST_BACKGROUND,
35
-
36 34
     /** Textpane client foreground colour. */
37 35
     TEXT_FOREGROUND,
38
-
39 36
     /** Textpane client background colour. */
40 37
     TEXT_BACKGROUND;
41 38
 

+ 23
- 3
src/com/dmdirc/ChannelEventHandler.java View File

@@ -31,7 +31,24 @@ import com.dmdirc.parser.interfaces.ChannelClientInfo;
31 31
 import com.dmdirc.parser.interfaces.ChannelInfo;
32 32
 import com.dmdirc.parser.interfaces.ClientInfo;
33 33
 import com.dmdirc.parser.interfaces.Parser;
34
-import com.dmdirc.parser.interfaces.callbacks.*; //NOPMD
34
+import com.dmdirc.parser.interfaces.callbacks.CallbackInterface;
35
+import com.dmdirc.parser.interfaces.callbacks.ChannelActionListener;
36
+import com.dmdirc.parser.interfaces.callbacks.ChannelCtcpListener;
37
+import com.dmdirc.parser.interfaces.callbacks.ChannelJoinListener;
38
+import com.dmdirc.parser.interfaces.callbacks.ChannelKickListener;
39
+import com.dmdirc.parser.interfaces.callbacks.ChannelListModeListener;
40
+import com.dmdirc.parser.interfaces.callbacks.ChannelMessageListener;
41
+import com.dmdirc.parser.interfaces.callbacks.ChannelModeChangeListener;
42
+import com.dmdirc.parser.interfaces.callbacks.ChannelModeNoticeListener;
43
+import com.dmdirc.parser.interfaces.callbacks.ChannelNamesListener;
44
+import com.dmdirc.parser.interfaces.callbacks.ChannelNickChangeListener;
45
+import com.dmdirc.parser.interfaces.callbacks.ChannelNonUserModeChangeListener;
46
+import com.dmdirc.parser.interfaces.callbacks.ChannelNoticeListener;
47
+import com.dmdirc.parser.interfaces.callbacks.ChannelPartListener;
48
+import com.dmdirc.parser.interfaces.callbacks.ChannelQuitListener;
49
+import com.dmdirc.parser.interfaces.callbacks.ChannelTopicListener;
50
+import com.dmdirc.parser.interfaces.callbacks.ChannelUserModeChangeListener;
51
+import com.dmdirc.parser.interfaces.callbacks.OtherAwayStateListener;
35 52
 
36 53
 import java.util.Date;
37 54
 
@@ -76,6 +93,7 @@ public class ChannelEventHandler extends EventHandler implements
76 93
      * Determines if the specified client represents us.
77 94
      *
78 95
      * @param client The client to be tested
96
+     *
79 97
      * @return True if the client is ourself, false otherwise.
80 98
      */
81 99
     protected boolean isMyself(final ChannelClientInfo client) {
@@ -117,7 +135,9 @@ public class ChannelEventHandler extends EventHandler implements
117 135
             if (newTopic.getTopic().isEmpty()) {
118 136
                 owner.doNotification(date, "channelNoTopic", CoreActionType.CHANNEL_NOTOPIC);
119 137
             } else {
120
-                owner.doNotification(date, "channelTopicDiscovered", CoreActionType.CHANNEL_GOTTOPIC,
138
+                owner.
139
+                        doNotification(date, "channelTopicDiscovered",
140
+                        CoreActionType.CHANNEL_GOTTOPIC,
121 141
                         newTopic);
122 142
             }
123 143
         } else {
@@ -253,7 +273,7 @@ public class ChannelEventHandler extends EventHandler implements
253 273
     /** {@inheritDoc} */
254 274
     @Override
255 275
     public void onChannelCTCP(final Parser parser, final Date date,
256
-            final ChannelInfo channel,  final ChannelClientInfo client,
276
+            final ChannelInfo channel, final ChannelClientInfo client,
257 277
             final String type, final String message, final String host) {
258 278
         checkParser(parser);
259 279
 

+ 60
- 42
src/com/dmdirc/ClientModule.java View File

@@ -84,29 +84,30 @@ import dagger.Provides;
84 84
  * Provides dependencies for the client.
85 85
  */
86 86
 @Module(
87
-    injects = {Main.class, CommandLineParser.class},
88
-    includes = {CommandLineOptionsModule.class, CommandModule.class, UpdaterModule.class},
89
-    library = true
90
-)
87
+        injects = {Main.class, CommandLineParser.class},
88
+        includes = {CommandLineOptionsModule.class, CommandModule.class, UpdaterModule.class},
89
+        library = true)
91 90
 public class ClientModule {
92 91
 
93 92
     /** Qualifier that identities a global configuration source. */
94 93
     @Qualifier
95
-    public @interface GlobalConfig {}
94
+    public @interface GlobalConfig {
95
+    }
96 96
 
97 97
     /** Qualifier that identities the user settings config provider. */
98 98
     @Qualifier
99
-    public @interface UserConfig {}
100
-
99
+    public @interface UserConfig {
100
+    }
101 101
     /** The object graph to inject where necessary. */
102 102
     private ObjectGraph objectGraph;
103 103
 
104 104
     /**
105 105
      * Provides an identity manager for the client.
106 106
      *
107
-     * @param baseDirectory The base directory to load settings from.
107
+     * @param baseDirectory       The base directory to load settings from.
108 108
      * @param identitiesDirectory The directory to store and read identities in.
109
-     * @param commandLineParser The CLI parser to read command line settings from.
109
+     * @param commandLineParser   The CLI parser to read command line settings from.
110
+     *
110 111
      * @return An initialised {@link IdentityManager}.
111 112
      */
112 113
     @Provides
@@ -138,6 +139,7 @@ public class ClientModule {
138 139
      * Provides an identity controller.
139 140
      *
140 141
      * @param manager The identity manager to use as a controller.
142
+     *
141 143
      * @return An identity controller to use.
142 144
      */
143 145
     @Provides
@@ -149,6 +151,7 @@ public class ClientModule {
149 151
      * Provides a global config provider.
150 152
      *
151 153
      * @param controller The controller to retrieve the config from.
154
+     *
152 155
      * @return A global configuration provider.
153 156
      */
154 157
     @Provides
@@ -161,7 +164,8 @@ public class ClientModule {
161 164
      * Provides an icon manager backed by the global configuration.
162 165
      *
163 166
      * @param globalConfig The global configuration provider.
164
-     * @param urlBuilder The builder to use to construct icon URLs.
167
+     * @param urlBuilder   The builder to use to construct icon URLs.
168
+     *
165 169
      * @return An icon manager backed by the global config.
166 170
      */
167 171
     @Provides
@@ -177,6 +181,7 @@ public class ClientModule {
177 181
      * Provides the user's configuration provider.
178 182
      *
179 183
      * @param controller The controller to retrieve the config from.
184
+     *
180 185
      * @return The user's configuration provider.
181 186
      */
182 187
     @Provides
@@ -188,12 +193,13 @@ public class ClientModule {
188 193
     /**
189 194
      * Provides an action manager.
190 195
      *
191
-     * @param serverManager The server manager to use to iterate servers.
192
-     * @param identityController The identity controller to use to look up settings.
193
-     * @param actionFactory The factory to use to create actions.
196
+     * @param serverManager          The server manager to use to iterate servers.
197
+     * @param identityController     The identity controller to use to look up settings.
198
+     * @param actionFactory          The factory to use to create actions.
194 199
      * @param actionWrappersProvider Provider of action wrappers.
195
-     * @param updateManagerProvider Provider of an update manager.
196
-     * @param directory The directory to read and write actions in.
200
+     * @param updateManagerProvider  Provider of an update manager.
201
+     * @param directory              The directory to read and write actions in.
202
+     *
197 203
      * @return An unitialised action manager.
198 204
      */
199 205
     @Provides
@@ -215,6 +221,7 @@ public class ClientModule {
215 221
      * Provides an action controller.
216 222
      *
217 223
      * @param actionManager The action manager to use as a controller.
224
+     *
218 225
      * @return An action controller to use.
219 226
      */
220 227
     @Provides
@@ -226,6 +233,7 @@ public class ClientModule {
226 233
      * Provides a lifecycle controller.
227 234
      *
228 235
      * @param controller The concrete implementation to use.
236
+     *
229 237
      * @return The lifecycle controller the app should use.
230 238
      */
231 239
     @Provides
@@ -237,8 +245,9 @@ public class ClientModule {
237 245
      * Gets the message sink manager for the client.
238 246
      *
239 247
      * @param statusBarManager The status bar manager to use for status bar sinks.
240
-     * @param windowManager The window manager to use for sinks that iterate windows.
241
-     * @param urlBuilder The URL Builder to use when creating new containers.
248
+     * @param windowManager    The window manager to use for sinks that iterate windows.
249
+     * @param urlBuilder       The URL Builder to use when creating new containers.
250
+     *
242 251
      * @return The message sink manager the client should use.
243 252
      */
244 253
     @Provides
@@ -256,7 +265,8 @@ public class ClientModule {
256 265
      * Gets the command manager the client should use.
257 266
      *
258 267
      * @param serverManager The manager to use to iterate servers.
259
-     * @param globalConfig The global configuration provider to read settings from.
268
+     * @param globalConfig  The global configuration provider to read settings from.
269
+     *
260 270
      * @return The command manager the client should use.
261 271
      */
262 272
     @Provides
@@ -273,6 +283,7 @@ public class ClientModule {
273 283
      * Gets a command controller for use in the client.
274 284
      *
275 285
      * @param commandManager The manager to use as a controller.
286
+     *
276 287
      * @return The command controller the client should use.
277 288
      */
278 289
     @Provides
@@ -283,12 +294,13 @@ public class ClientModule {
283 294
     /**
284 295
      * Gets an initialised plugin manager for the client.
285 296
      *
286
-     * @param identityController The controller to read settings from.
287
-     * @param actionController The action controller to use for events.
288
-     * @param updateManager The update manager to inform about plugins.
297
+     * @param identityController  The controller to read settings from.
298
+     * @param actionController    The action controller to use for events.
299
+     * @param updateManager       The update manager to inform about plugins.
289 300
      * @param initialiserProvider Provider to use to create plugin initialisers.
290
-     * @param objectGraph The graph to provide to plugins for DI purposes.
291
-     * @param directory The directory to load and save plugins in.
301
+     * @param objectGraph         The graph to provide to plugins for DI purposes.
302
+     * @param directory           The directory to load and save plugins in.
303
+     *
292 304
      * @return An initialised plugin manager for the client.
293 305
      */
294 306
     @Provides
@@ -321,6 +333,7 @@ public class ClientModule {
321 333
      * Provides a service manager.
322 334
      *
323 335
      * @param pluginManager The plugin manager to use as the service manager implementation.
336
+     *
324 337
      * @return A service manager.
325 338
      */
326 339
     @Provides
@@ -332,7 +345,8 @@ public class ClientModule {
332 345
      * Gets a core plugin extractor.
333 346
      *
334 347
      * @param pluginManager The plugin manager to notify about updates.
335
-     * @param directory The directory to extract plugins to.
348
+     * @param directory     The directory to extract plugins to.
349
+     *
336 350
      * @return A plugin extractor for the client to use.
337 351
      */
338 352
     @Provides
@@ -346,7 +360,8 @@ public class ClientModule {
346 360
      * Gets a theme manager for the client.
347 361
      *
348 362
      * @param controller The identity controller to use to access settings.
349
-     * @param directory The directory to load themes from.
363
+     * @param directory  The directory to load themes from.
364
+     *
350 365
      * @return An initialised theme manager instance.
351 366
      */
352 367
     @Provides
@@ -363,6 +378,7 @@ public class ClientModule {
363 378
      * Gets the alias actions wrapper entry for the actions wrapper set.
364 379
      *
365 380
      * @param aliasWrapper The wrapper to use in the set.
381
+     *
366 382
      * @return An alias wrapper to use in the client.
367 383
      */
368 384
     @Provides(type = Provides.Type.SET)
@@ -387,6 +403,7 @@ public class ClientModule {
387 403
      * Gets the colour manager.
388 404
      *
389 405
      * @param globalConfig A global configuration provider to read settings from.
406
+     *
390 407
      * @return A colour manager for the client.
391 408
      */
392 409
     @Provides
@@ -409,6 +426,7 @@ public class ClientModule {
409 426
      * Gets a server factory.
410 427
      *
411 428
      * @param serverManager The manager to use as a factory.
429
+     *
412 430
      * @return A server factory.
413 431
      */
414 432
     @Provides
@@ -419,7 +437,8 @@ public class ClientModule {
419 437
     /**
420 438
      * Gets an identity factory.
421 439
      *
422
-     * @param identityManager  The manager to use as a factory.
440
+     * @param identityManager The manager to use as a factory.
441
+     *
423 442
      * @return An identity factory.
424 443
      */
425 444
     @Provides
@@ -459,14 +478,14 @@ public class ClientModule {
459 478
     }
460 479
 
461 480
     /**
462
-     * Called when the global config cannot be loaded due to an error. This
463
-     * method informs the user of the problem and installs a new default config
464
-     * file, backing up the old one.
481
+     * Called when the global config cannot be loaded due to an error. This method informs the user
482
+     * of the problem and installs a new default config file, backing up the old one.
465 483
      *
466 484
      * @param identityManager The identity manager to re-initialise after installing defaults.
467
-     * @param configdir The directory to extract default settings into.
485
+     * @param configdir       The directory to extract default settings into.
468 486
      */
469
-    private void handleInvalidConfigFile(final IdentityManager identityManager, final String configdir) {
487
+    private void handleInvalidConfigFile(final IdentityManager identityManager,
488
+            final String configdir) {
470 489
         final String date = new SimpleDateFormat("yyyyMMddkkmmss").format(new Date());
471 490
 
472 491
         final String message = "DMDirc has detected that your config file "
@@ -504,14 +523,13 @@ public class ClientModule {
504 523
     }
505 524
 
506 525
     /**
507
-     * Ensures that there is at least one provider of the specified
508
-     * service type by extracting matching core plugins. Plugins must be named
509
-     * so that their file name starts with the service type, and then an
510
-     * underscore.
526
+     * Ensures that there is at least one provider of the specified service type by extracting
527
+     * matching core plugins. Plugins must be named so that their file name starts with the service
528
+     * type, and then an underscore.
511 529
      *
512 530
      * @param corePluginExtractor Extractor to use if the service doesn't exist
513
-     * @param pm The plugin manager to use to access services
514
-     * @param serviceType The type of service that should exist
531
+     * @param pm                  The plugin manager to use to access services
532
+     * @param serviceType         The type of service that should exist
515 533
      */
516 534
     public void ensureExists(
517 535
             final CorePluginExtractor corePluginExtractor,
@@ -524,13 +542,13 @@ public class ClientModule {
524 542
     }
525 543
 
526 544
     /**
527
-     * Checks whether the plugins bundled with this release of DMDirc are newer
528
-     * than the plugins known by the specified {@link PluginManager}. If the
529
-     * bundled plugins are newer, they are automatically extracted.
545
+     * Checks whether the plugins bundled with this release of DMDirc are newer than the plugins
546
+     * known by the specified {@link PluginManager}. If the bundled plugins are newer, they are
547
+     * automatically extracted.
530 548
      *
531 549
      * @param corePluginExtractor Extractor to use if plugins need updating.
532
-     * @param pm The plugin manager to use to check plugins
533
-     * @param config The configuration source for bundled versions
550
+     * @param pm                  The plugin manager to use to check plugins
551
+     * @param config              The configuration source for bundled versions
534 552
      */
535 553
     private void checkBundledPlugins(
536 554
             final CorePluginExtractor corePluginExtractor,

+ 4
- 5
src/com/dmdirc/CorePluginExtractor.java View File

@@ -46,7 +46,7 @@ public class CorePluginExtractor {
46 46
      * Creates a new instance of {@link CorePluginExtractor}.
47 47
      *
48 48
      * @param pluginManager The plugin manager to inform when plugins are updated.
49
-     * @param pluginDir The directory to extract plugins to.
49
+     * @param pluginDir     The directory to extract plugins to.
50 50
      */
51 51
     public CorePluginExtractor(final PluginManager pluginManager, final String pluginDir) {
52 52
         this.pluginManager = pluginManager;
@@ -54,11 +54,10 @@ public class CorePluginExtractor {
54 54
     }
55 55
 
56 56
     /**
57
-     * Extracts plugins bundled with DMDirc to the user's profile's plugin
58
-     * directory.
57
+     * Extracts plugins bundled with DMDirc to the user's profile's plugin directory.
59 58
      *
60
-     * @param prefix If non-null, only plugins whose file name starts with
61
-     * this prefix will be extracted.
59
+     * @param prefix If non-null, only plugins whose file name starts with this prefix will be
60
+     *               extracted.
62 61
      */
63 62
     public void extractCorePlugins(final String prefix) {
64 63
         final Map<String, byte[]> resources = ResourceManager.getResourceManager()

+ 6
- 6
src/com/dmdirc/CustomWindow.java View File

@@ -37,9 +37,9 @@ public class CustomWindow extends FrameContainer {
37 37
     /**
38 38
      * Creates a new custom window as a child of the specified window.
39 39
      *
40
-     * @param name The name of this custom window
41
-     * @param title The title of this custom window
42
-     * @param parent The parent of this custom window
40
+     * @param name       The name of this custom window
41
+     * @param title      The title of this custom window
42
+     * @param parent     The parent of this custom window
43 43
      * @param urlBuilder The URL builder to use when finding icons.
44 44
      */
45 45
     public CustomWindow(
@@ -54,10 +54,10 @@ public class CustomWindow extends FrameContainer {
54 54
     /**
55 55
      * Creates a new custom window as a top-level window.
56 56
      *
57
-     * @param name The name of this custom window
58
-     * @param title The parent of this custom window
57
+     * @param name           The name of this custom window
58
+     * @param title          The parent of this custom window
59 59
      * @param configProvider The config provider to read settings from.
60
-     * @param urlBuilder The URL builder to use when finding icons.
60
+     * @param urlBuilder     The URL builder to use when finding icons.
61 61
      */
62 62
     public CustomWindow(
63 63
             final String name,

+ 6
- 7
src/com/dmdirc/EventHandler.java View File

@@ -38,8 +38,7 @@ import javax.annotation.Nonnull;
38 38
 public abstract class EventHandler implements CallbackInterface {
39 39
 
40 40
     /**
41
-     * Registers all callbacks that this event handler implements with the
42
-     * owner's parser.
41
+     * Registers all callbacks that this event handler implements with the owner's parser.
43 42
      */
44 43
     public void registerCallbacks() {
45 44
         final CallbackManager cbm = getConnection().getParser().getCallbackManager();
@@ -68,9 +67,10 @@ public abstract class EventHandler implements CallbackInterface {
68 67
     /**
69 68
      * Adds a callback to this event handler.
70 69
      *
71
-     * @param <T> The type of callback to be added
72
-     * @param cbm The callback manager to use
70
+     * @param <T>  The type of callback to be added
71
+     * @param cbm  The callback manager to use
73 72
      * @param type The type of the callback to be added
73
+     *
74 74
      * @throws CallbackNotFoundException if the specified callback isn't found
75 75
      */
76 76
     protected abstract <T extends CallbackInterface> void addCallback(
@@ -86,9 +86,8 @@ public abstract class EventHandler implements CallbackInterface {
86 86
     protected abstract Connection getConnection();
87 87
 
88 88
     /**
89
-     * Checks that the specified parser is the same as the one the server is
90
-     * currently claiming to be using. If it isn't, we raise an exception to
91
-     * prevent further (erroneous) processing.
89
+     * Checks that the specified parser is the same as the one the server is currently claiming to
90
+     * be using. If it isn't, we raise an exception to prevent further (erroneous) processing.
92 91
      *
93 92
      * @param parser The parser to check
94 93
      */

+ 54
- 59
src/com/dmdirc/FrameContainer.java View File

@@ -49,66 +49,52 @@ import java.util.Set;
49 49
 import java.util.concurrent.CopyOnWriteArrayList;
50 50
 
51 51
 /**
52
- * The frame container implements basic methods that should be present in
53
- * all objects that handle a frame.
52
+ * The frame container implements basic methods that should be present in all objects that handle a
53
+ * frame.
54 54
  */
55 55
 public abstract class FrameContainer {
56 56
 
57 57
     /** Listeners not yet using ListenerSupport. */
58 58
     protected final ListenerList listeners = new ListenerList();
59
-
60 59
     /** The colour of our frame's notifications. */
61 60
     private Colour notification = Colour.BLACK;
62
-
63 61
     /** The document used to store this container's content. */
64 62
     private IRCDocument document;
65
-
66 63
     /** The children of this frame. */
67
-    private final Collection<FrameContainer> children
68
-            = new CopyOnWriteArrayList<>();
69
-
64
+    private final Collection<FrameContainer> children = new CopyOnWriteArrayList<>();
70 65
     /** The parent of this frame. */
71 66
     private FrameContainer parent;
72
-
73 67
     /** The name of the icon being used for this container's frame. */
74 68
     private String icon;
75
-
76 69
     /** The name of this container. */
77 70
     private String name;
78
-
79 71
     /** The title of this container. */
80 72
     private String title;
81
-
82 73
     /** The config manager for this container. */
83 74
     private final AggregateConfigProvider configManager;
84
-
85 75
     /** The IconChanger for this container. */
86 76
     private final IconChanger changer = new IconChanger();
87
-
88 77
     /** The UI components that this frame requires. */
89 78
     private final Set<String> components;
90
-
91 79
     /** The styliser used by this container. */
92 80
     private Styliser styliser;
93
-
94 81
     /** Object used to synchronise styliser access. */
95 82
     private final Object styliserSync = new Object();
96
-
97 83
     /** Object used to synchronise styliser access. */
98 84
     private final Object documentSync = new Object();
99
-
100 85
     /** The icon manager to use for this container. */
101 86
     private final IconManager iconManager;
102 87
 
103 88
     /**
104 89
      * Instantiate new frame container.
105 90
      *
106
-     * @param icon The icon to use for this container
107
-     * @param name The name of this container
108
-     * @param title The title of this container
109
-     * @param config The config manager for this container
91
+     * @param icon       The icon to use for this container
92
+     * @param name       The name of this container
93
+     * @param title      The title of this container
94
+     * @param config     The config manager for this container
110 95
      * @param urlBuilder The URL builder to use when finding icons.
111 96
      * @param components The UI components that this frame requires
97
+     *
112 98
      * @since 0.6.4
113 99
      */
114 100
     protected FrameContainer(
@@ -155,6 +141,7 @@ public abstract class FrameContainer {
155 141
      * Returns a collection of direct children of this frame.
156 142
      *
157 143
      * @return This frame's children
144
+     *
158 145
      * @since 0.6.4
159 146
      */
160 147
     public Collection<FrameContainer> getChildren() {
@@ -162,10 +149,11 @@ public abstract class FrameContainer {
162 149
     }
163 150
 
164 151
     /**
165
-     * Determines whether the specified target is a child of this container.
166
-     * Children may be indirect (i.e., a child of another child).
152
+     * Determines whether the specified target is a child of this container. Children may be
153
+     * indirect (i.e., a child of another child).
167 154
      *
168 155
      * @param target The window to be tested
156
+     *
169 157
      * @return True if the specified container is a child of this one
170 158
      */
171 159
     public boolean isChild(final FrameContainer target) {
@@ -186,6 +174,7 @@ public abstract class FrameContainer {
186 174
      * Adds a new child window to this frame.
187 175
      *
188 176
      * @param child The window to be added
177
+     *
189 178
      * @since 0.6.4
190 179
      */
191 180
     public void addChild(final FrameContainer child) {
@@ -197,6 +186,7 @@ public abstract class FrameContainer {
197 186
      * Removes a child window from this frame.
198 187
      *
199 188
      * @param child The window to be removed
189
+     *
200 190
      * @since 0.6.4
201 191
      */
202 192
     public void removeChild(final FrameContainer child) {
@@ -204,11 +194,11 @@ public abstract class FrameContainer {
204 194
     }
205 195
 
206 196
     /**
207
-     * Sets the parent of this container to the one specified. If this
208
-     * container already had a parent, it will deregister itself with the
209
-     * old parent.
197
+     * Sets the parent of this container to the one specified. If this container already had a
198
+     * parent, it will deregister itself with the old parent.
210 199
      *
211 200
      * @param parent The new parent for this container
201
+     *
212 202
      * @since 0.6.4
213 203
      */
214 204
     public synchronized void setParent(final FrameContainer parent) {
@@ -232,7 +222,9 @@ public abstract class FrameContainer {
232 222
      * Gets an icon manager for this container.
233 223
      *
234 224
      * @param urlBuilder The builder to use to construct icon URLs.
225
+     *
235 226
      * @return An icon manager for this container.
227
+     *
236 228
      * @deprecated Don't bother passing in a URL builder. That was a bad idea.
237 229
      */
238 230
     @Deprecated
@@ -244,6 +236,7 @@ public abstract class FrameContainer {
244 236
      * Retrieves the {@link IRCDocument} used to store this frame's content.
245 237
      *
246 238
      * @return This frame's document
239
+     *
247 240
      * @since 0.6.4
248 241
      */
249 242
     public IRCDocument getDocument() {
@@ -256,8 +249,8 @@ public abstract class FrameContainer {
256 249
     }
257 250
 
258 251
     /**
259
-     * Changes the name of this container, and notifies any
260
-     * {@link FrameInfoListener}s of the change.
252
+     * Changes the name of this container, and notifies any {@link FrameInfoListener}s of the
253
+     * change.
261 254
      *
262 255
      * @param name The new name for this frame.
263 256
      */
@@ -268,8 +261,8 @@ public abstract class FrameContainer {
268 261
     }
269 262
 
270 263
     /**
271
-     * Changes the title of this container, and notifies any
272
-     * {@link FrameInfoListener}s of the change.
264
+     * Changes the title of this container, and notifies any {@link FrameInfoListener}s of the
265
+     * change.
273 266
      *
274 267
      * @param title The new title for this frame.
275 268
      */
@@ -280,8 +273,8 @@ public abstract class FrameContainer {
280 273
     }
281 274
 
282 275
     /**
283
-     * Returns the collection of UI component identifiers that this frame
284
-     * container requires for its display.
276
+     * Returns the collection of UI component identifiers that this frame container requires for its
277
+     * display.
285 278
      *
286 279
      * @since 0.6.6
287 280
      * @return Collection of UI component identifiers
@@ -395,16 +388,17 @@ public abstract class FrameContainer {
395 388
     }
396 389
 
397 390
     /**
398
-     * Adds a line to this container's window. If the window is null for some
399
-     * reason, the line is silently discarded.
391
+     * Adds a line to this container's window. If the window is null for some reason, the line is
392
+     * silently discarded.
400 393
      *
401
-     * @param type The message type to use
394
+     * @param type      The message type to use
402 395
      * @param timestamp The timestamp to use for this line
403
-     * @param args The message's arguments
396
+     * @param args      The message's arguments
397
+     *
404 398
      * @since 0.6.4
405 399
      */
406 400
     public void addLine(final String type, final Date timestamp,
407
-            final Object ... args) {
401
+            final Object... args) {
408 402
         if (type != null && !type.isEmpty()) {
409 403
             addLine(Formatter.formatMessage(getConfigManager(), type, args),
410 404
                     timestamp);
@@ -412,47 +406,48 @@ public abstract class FrameContainer {
412 406
     }
413 407
 
414 408
     /**
415
-     * Adds a line to this container's window. If the window is null for some
416
-     * reason, the line is silently discarded.
409
+     * Adds a line to this container's window. If the window is null for some reason, the line is
410
+     * silently discarded.
417 411
      *
418 412
      * @param type The message type to use
419 413
      * @param args The message's arguments
420 414
      */
421
-    public void addLine(final String type, final Object ... args) {
415
+    public void addLine(final String type, final Object... args) {
422 416
         addLine(type, new Date(), args);
423 417
     }
424 418
 
425 419
     /**
426
-     * Adds a line to this container's window. If the window is null for some
427
-     * reason, the line is silently discarded.
420
+     * Adds a line to this container's window. If the window is null for some reason, the line is
421
+     * silently discarded.
428 422
      *
429
-     * @param type The message type to use
423
+     * @param type      The message type to use
430 424
      * @param timestamp The timestamp to use for this line
431
-     * @param args The message's arguments
425
+     * @param args      The message's arguments
426
+     *
432 427
      * @since 0.6.4
433 428
      */
434 429
     public void addLine(final StringBuffer type, final Date timestamp,
435
-            final Object ... args) {
430
+            final Object... args) {
436 431
         if (type != null) {
437 432
             addLine(type.toString(), timestamp, args);
438 433
         }
439 434
     }
440 435
 
441 436
     /**
442
-     * Adds a line to this container's window. If the window is null for some
443
-     * reason, the line is silently discarded.
437
+     * Adds a line to this container's window. If the window is null for some reason, the line is
438
+     * silently discarded.
444 439
      *
445 440
      * @param type The message type to use
446 441
      * @param args The message's arguments
447 442
      */
448
-    public void addLine(final StringBuffer type, final Object ... args) {
443
+    public void addLine(final StringBuffer type, final Object... args) {
449 444
         addLine(type, new Date(), args);
450 445
     }
451 446
 
452 447
     /**
453 448
      * Adds the specified raw line to the window, without using a formatter.
454 449
      *
455
-     * @param line The line to be added
450
+     * @param line      The line to be added
456 451
      * @param timestamp Whether or not to display the timestamp for this line
457 452
      */
458 453
     public void addLine(final String line, final boolean timestamp) {
@@ -460,12 +455,13 @@ public abstract class FrameContainer {
460 455
     }
461 456
 
462 457
     /**
463
-     * Adds the specified raw line to the window, without using a formatter,
464
-     * and using the specified timestamp. If the timestamp is <code>null</code>,
465
-     * no timestamp is added.
458
+     * Adds the specified raw line to the window, without using a formatter, and using the specified
459
+     * timestamp. If the timestamp is
460
+     * <code>null</code>, no timestamp is added.
466 461
      *
467
-     * @param line The line to be added
462
+     * @param line      The line to be added
468 463
      * @param timestamp The timestamp to use for the line
464
+     *
469 465
      * @since 0.6.4
470 466
      */
471 467
     public void addLine(final String line, final Date timestamp) {
@@ -474,13 +470,11 @@ public abstract class FrameContainer {
474 470
             if (timestamp != null) {
475 471
                 lines.add(new String[]{
476 472
                     Formatter.formatMessage(getConfigManager(), "timestamp",
477
-                            timestamp),
478
-                    myLine,
479
-                });
473
+                    timestamp),
474
+                    myLine,});
480 475
             } else {
481 476
                 lines.add(new String[]{
482
-                    myLine,
483
-                });
477
+                    myLine,});
484 478
             }
485 479
 
486 480
             ActionManager.getActionManager().triggerEvent(
@@ -578,4 +572,5 @@ public abstract class FrameContainer {
578 572
         }
579 573
 
580 574
     }
575
+
581 576
 }

+ 9
- 7
src/com/dmdirc/FrameContainerComparator.java View File

@@ -33,9 +33,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
33 33
 public class FrameContainerComparator implements Comparator<FrameContainer>, Serializable {
34 34
 
35 35
     /**
36
-     * A version number for this class. It should be changed whenever the class
37
-     * structure is changed (or anything else that would prevent serialized
38
-     * objects being unserialized with the new class).
36
+     * A version number for this class. It should be changed whenever the class structure is changed
37
+     * (or anything else that would prevent serialized objects being unserialized with the new
38
+     * class).
39 39
      */
40 40
     private static final long serialVersionUID = 1;
41 41
 
@@ -44,8 +44,8 @@ public class FrameContainerComparator implements Comparator<FrameContainer>, Ser
44 44
      *
45 45
      * @param item1 The first container to compare
46 46
      * @param item2 The second container to compare
47
-     * @return -1 if item1 is before item2, 0 if they're equal,
48
-     * +1 if item1 is after item2.
47
+     *
48
+     * @return -1 if item1 is before item2, 0 if they're equal, +1 if item1 is after item2.
49 49
      */
50 50
     @Override
51 51
     @Precondition({
@@ -81,6 +81,7 @@ public class FrameContainerComparator implements Comparator<FrameContainer>, Ser
81 81
      *
82 82
      * @param item1 The new container to be tested
83 83
      * @param item2 The existing container to test against
84
+     *
84 85
      * @return True iff the new container should be before the old container
85 86
      */
86 87
     private static boolean sortBefore(
@@ -94,6 +95,7 @@ public class FrameContainerComparator implements Comparator<FrameContainer>, Ser
94 95
      *
95 96
      * @param item1 The new container to be tested
96 97
      * @param item2 The existing container to test against
98
+     *
97 99
      * @return True iff the new container should be after the old container
98 100
      */
99 101
     private static boolean sortAfter(final FrameContainer item1,
@@ -102,10 +104,10 @@ public class FrameContainerComparator implements Comparator<FrameContainer>, Ser
102 104
     }
103 105
 
104 106
     /**
105
-     * Returns an integer corresponding to the expected order of a frame
106
-     * container.
107
+     * Returns an integer corresponding to the expected order of a frame container.
107 108
      *
108 109
      * @param item The frame container to be tested
110
+     *
109 111
      * @return Position of the frame container
110 112
      */
111 113
     private static int getPosition(final FrameContainer item) {

+ 15
- 15
src/com/dmdirc/GlobalWindow.java View File

@@ -54,11 +54,11 @@ public class GlobalWindow extends WritableFrameContainer {
54 54
     /**
55 55
      * Creates a new instance of GlobalWindow.
56 56
      *
57
-     * @param config The ConfigManager to retrieve settings from.
58
-     * @param parser The command parser to use to parse input.
57
+     * @param config              The ConfigManager to retrieve settings from.
58
+     * @param parser              The command parser to use to parse input.
59 59
      * @param tabCompleterFactory The factory to use to create tab completers.
60
-     * @param messageSinkManager The sink manager to use to despatch messages.
61
-     * @param urlBuilder The URL builder to use when finding icons.
60
+     * @param messageSinkManager  The sink manager to use to despatch messages.
61
+     * @param urlBuilder          The URL builder to use when finding icons.
62 62
      */
63 63
     public GlobalWindow(
64 64
             final AggregateConfigProvider config,
@@ -68,8 +68,8 @@ public class GlobalWindow extends WritableFrameContainer {
68 68
             final URLBuilder urlBuilder) {
69 69
         super("icon", "Global", "(Global)", config, parser, messageSinkManager, urlBuilder,
70 70
                 Arrays.asList(
71
-                        WindowComponent.TEXTAREA.getIdentifier(),
72
-                        WindowComponent.INPUTFIELD.getIdentifier()));
71
+                WindowComponent.TEXTAREA.getIdentifier(),
72
+                WindowComponent.INPUTFIELD.getIdentifier()));
73 73
 
74 74
         tabCompleter = tabCompleterFactory.getTabCompleter(config, CommandType.TYPE_GLOBAL);
75 75
     }
@@ -112,19 +112,19 @@ public class GlobalWindow extends WritableFrameContainer {
112 112
         private final Provider<GlobalCommandParser> globalCommandParserProvider;
113 113
         /** The URL builder to use when finding icons. */
114 114
         private final URLBuilder urlBuilder;
115
-
116 115
         /** The global window that's in use, if any. */
117 116
         private GlobalWindow globalWindow;
118 117
 
119 118
         /**
120 119
          * Creates a new instance of {@link GlobalWindowManager}.
121 120
          *
122
-         * @param globalConfig Configuration provider to read settings from.
123
-         * @param tabCompleterFactory Factory to use to create tab completers.
124
-         * @param windowManagerProvider The provider to use to retrieve a window manager.
125
-         * @param messageSinkManagerProvider The provider to use to retrieve a sink manager.
126
-         * @param globalCommandParserProvider The provider to use to retrieve a global command parser.
127
-         * @param urlBuilder The URL builder to use when finding icons.
121
+         * @param globalConfig                Configuration provider to read settings from.
122
+         * @param tabCompleterFactory         Factory to use to create tab completers.
123
+         * @param windowManagerProvider       The provider to use to retrieve a window manager.
124
+         * @param messageSinkManagerProvider  The provider to use to retrieve a sink manager.
125
+         * @param globalCommandParserProvider The provider to use to retrieve a global command
126
+         *                                    parser.
127
+         * @param urlBuilder                  The URL builder to use when finding icons.
128 128
          */
129 129
         @Inject
130 130
         public GlobalWindowManager(
@@ -157,8 +157,8 @@ public class GlobalWindow extends WritableFrameContainer {
157 157
         }
158 158
 
159 159
         /**
160
-         * Updates the state of the global window in line with the
161
-         * general.showglobalwindow config setting.
160
+         * Updates the state of the global window in line with the general.showglobalwindow config
161
+         * setting.
162 162
          */
163 163
         protected void updateWindowState() {
164 164
             synchronized (GlobalWindow.class) {

+ 4
- 5
src/com/dmdirc/Invite.java View File

@@ -33,13 +33,10 @@ public class Invite {
33 33
 
34 34
     /** The connection this invite was on. */
35 35
     private final Connection connection;
36
-
37 36
     /** The channel this invite is for. */
38 37
     private final String channel;
39
-
40 38
     /** The time this invite was created. */
41 39
     private final long timestamp;
42
-
43 40
     /** The source of this invite. */
44 41
     private final String source;
45 42
 
@@ -47,8 +44,8 @@ public class Invite {
47 44
      * Creates a new instance of Invite.
48 45
      *
49 46
      * @param connection The connection that this invite was received on
50
-     * @param channel The channel that this invite is for
51
-     * @param source The source of this invite
47
+     * @param channel    The channel that this invite is for
48
+     * @param source     The source of this invite
52 49
      */
53 50
     public Invite(final Connection connection, final String channel, final String source) {
54 51
         this.connection = connection;
@@ -69,6 +66,7 @@ public class Invite {
69 66
      * Retrieves the source of this invite.
70 67
      *
71 68
      * @return This invite's source
69
+     *
72 70
      * @see Server#parseHostmask(java.lang.String)
73 71
      */
74 72
     public String[] getSource() {
@@ -88,4 +86,5 @@ public class Invite {
88 86
     public void decline() {
89 87
         connection.removeInvite(this);
90 88
     }
89
+
91 90
 }

+ 18
- 31
src/com/dmdirc/Main.java View File

@@ -63,59 +63,49 @@ public class Main {
63 63
 
64 64
     /** Feedback nag delay. */
65 65
     private final int FEEDBACK_DELAY = 30 * 60 * 1000;
66
-
67 66
     /** The UI to use for the client. */
68 67
     private final Collection<UIController> CONTROLLERS = new HashSet<>();
69
-
70 68
     /** The identity manager the client will use. */
71 69
     private final IdentityController identityManager;
72
-
73 70
     /** The server manager the client will use. */
74 71
     private final ServerManager serverManager;
75
-
76 72
     /** The action manager the client will use. */
77 73
     private final ActionManager actionManager;
78
-
79 74
     /** The command-line parser used for this instance. */
80 75
     private final CommandLineParser commandLineParser;
81
-
82 76
     /** The plugin manager the client will use. */
83 77
     private final PluginManager pluginManager;
84
-
85 78
     /** The extractor to use for core plugins. */
86 79
     private final CorePluginExtractor corePluginExtractor;
87
-
88 80
     /** The command manager to use. */
89 81
     private final CommandManager commandManager;
90
-
91 82
     /** The global window manager to use. */
92 83
     private final GlobalWindowManager globalWindowManager;
93
-
94 84
     /** The colour-based action comparisons. */
95 85
     private final ColourActionComparison colourActionComparison;
96
-
97 86
     /** The event bus to dispatch events on. */
98 87
     private final EventBus eventBus;
99
-
100 88
     /** The commands to load into the command manager. */
101 89
     private final Set<CommandDetails> commands;
102 90
 
103 91
     /**
104 92
      * Creates a new instance of {@link Main}.
105 93
      *
106
-     * @param identityManager The identity manager the client will use.
107
-     * @param serverManager The server manager the client will use.
108
-     * @param actionManager The action manager the client will use.
109
-     * @param commandLineParser The command-line parser used for this instance.
110
-     * @param pluginManager The plugin manager the client will use.
111
-     * @param commandManager The command manager the client will use.
112
-     * @param messageSinkManager Unused for now - TODO: remove me when it's injected somewhere sensible.
113
-     * @param themeManager Unused for now - TODO: remove me when it's injected somewhere sensible.
114
-     * @param corePluginExtractor Extractor to use for core plugins.
115
-     * @param globalWindowManager Global window manager to use.
94
+     * @param identityManager        The identity manager the client will use.
95
+     * @param serverManager          The server manager the client will use.
96
+     * @param actionManager          The action manager the client will use.
97
+     * @param commandLineParser      The command-line parser used for this instance.
98
+     * @param pluginManager          The plugin manager the client will use.
99
+     * @param commandManager         The command manager the client will use.
100
+     * @param messageSinkManager     Unused for now - TODO: remove me when it's injected somewhere
101
+     *                               sensible.
102
+     * @param themeManager           Unused for now - TODO: remove me when it's injected somewhere
103
+     *                               sensible.
104
+     * @param corePluginExtractor    Extractor to use for core plugins.
105
+     * @param globalWindowManager    Global window manager to use.
116 106
      * @param colourActionComparison The colour-based action comparisons.
117
-     * @param eventBus The event bus to dispatch events on.
118
-     * @param commands The commands to be loaded into the command manager.
107
+     * @param eventBus               The event bus to dispatch events on.
108
+     * @param commands               The commands to be loaded into the command manager.
119 109
      */
120 110
     @Inject
121 111
     public Main(
@@ -202,10 +192,9 @@ public class Main {
202 192
     }
203 193
 
204 194
     /**
205
-     * Called when the UI has failed to initialise correctly. This method
206
-     * attempts to extract any and all UI plugins bundled with the client, and
207
-     * requests a restart. If this has already been attempted, it shows an error
208
-     * and exits.
195
+     * Called when the UI has failed to initialise correctly. This method attempts to extract any
196
+     * and all UI plugins bundled with the client, and requests a restart. If this has already been
197
+     * attempted, it shows an error and exits.
209 198
      */
210 199
     private void handleMissingUI() {
211 200
         // Check to see if we have already tried this
@@ -237,8 +226,7 @@ public class Main {
237 226
     }
238 227
 
239 228
     /**
240
-     * Attempts to find and activate a service which provides a UI that we
241
-     * can use.
229
+     * Attempts to find and activate a service which provides a UI that we can use.
242 230
      *
243 231
      * @param pm The plugin manager to use to load plugins
244 232
      */
@@ -279,7 +267,6 @@ public class Main {
279 267
             }
280 268
 
281 269
             new Timer().schedule(new TimerTask() {
282
-
283 270
                 /** {@inheritDoc} */
284 271
                 @Override
285 272
                 public void run() {

+ 2
- 3
src/com/dmdirc/MessageEncoder.java View File

@@ -30,14 +30,13 @@ import com.dmdirc.parser.interfaces.Parser;
30 30
 import java.io.UnsupportedEncodingException;
31 31
 
32 32
 /**
33
- * An {@link Encoder} implementation that reads the desired encoding from
34
- * the relevant target's config file.
33
+ * An {@link Encoder} implementation that reads the desired encoding from the relevant target's
34
+ * config file.
35 35
  */
36 36
 public class MessageEncoder implements Encoder {
37 37
 
38 38
     /** The server that owns this encoder. */
39 39
     private final Server server;
40
-
41 40
     /** The parser that this encoder will work for. */
42 41
     private final Parser parser;
43 42
 

+ 10
- 11
src/com/dmdirc/MessageTarget.java View File

@@ -30,22 +30,22 @@ import com.dmdirc.util.URLBuilder;
30 30
 import java.util.Collection;
31 31
 
32 32
 /**
33
- * Defines common methods for objects that you can send messages to (such as
34
- * channels and queries).
33
+ * Defines common methods for objects that you can send messages to (such as channels and queries).
35 34
  */
36 35
 public abstract class MessageTarget extends WritableFrameContainer {
37 36
 
38 37
     /**
39 38
      * Creates a new MessageTarget.
40 39
      *
41
-     * @param icon The icon to use for this target
42
-     * @param name The name of this target
43
-     * @param title The title of this target
44
-     * @param config The config manager to use for this target
45
-     * @param parser The command parser for this container
40
+     * @param icon               The icon to use for this target
41
+     * @param name               The name of this target
42
+     * @param title              The title of this target
43
+     * @param config             The config manager to use for this target
44
+     * @param parser             The command parser for this container
46 45
      * @param messageSinkManager The sink manager to use to despatch messages.
47
-     * @param urlBuilder The URL builder to use when finding icons.
48
-     * @param components The UI components that this frame requires
46
+     * @param urlBuilder         The URL builder to use when finding icons.
47
+     * @param components         The UI components that this frame requires
48
+     *
49 49
      * @since 0.6.4
50 50
      */
51 51
     public MessageTarget(
@@ -61,8 +61,7 @@ public abstract class MessageTarget extends WritableFrameContainer {
61 61
     }
62 62
 
63 63
     /**
64
-     * Sends the specified string as an action (CTCP) to the target that this
65
-     * object represents.
64
+     * Sends the specified string as an action (CTCP) to the target that this object represents.
66 65
      *
67 66
      * @param action The action to send
68 67
      */

+ 8
- 8
src/com/dmdirc/MissingModeAliasException.java View File

@@ -32,20 +32,19 @@ import java.util.List;
32 32
 public class MissingModeAliasException extends Exception {
33 33
 
34 34
     /**
35
-     * A version number for this class. It should be changed whenever the class
36
-     * structure is changed (or anything else that would prevent serialized
37
-     * objects being unserialized with the new class).
35
+     * A version number for this class. It should be changed whenever the class structure is changed
36
+     * (or anything else that would prevent serialized objects being unserialized with the new
37
+     * class).
38 38
      */
39 39
     private static final long serialVersionUID = 1;
40 40
 
41 41
     /**
42
-     * Creates a new exception detailing the missing modes aliases and
43
-     * supporting information.
42
+     * Creates a new exception detailing the missing modes aliases and supporting information.
44 43
      *
45
-     * @param network Network
46
-     * @param parser Assocaited parser
44
+     * @param network            Network
45
+     * @param parser             Assocaited parser
47 46
      * @param modeAliasesVersion Current mode aliases version
48
-     * @param missingModes Missing modes
47
+     * @param missingModes       Missing modes
49 48
      */
50 49
     public MissingModeAliasException(final String network, final Parser parser,
51 50
             final String modeAliasesVersion, final String missingModes) {
@@ -68,4 +67,5 @@ public class MissingModeAliasException extends Exception {
68 67
 
69 68
         return sb.toString();
70 69
     }
70
+
71 71
 }

+ 12
- 6
src/com/dmdirc/ParserFactory.java View File

@@ -59,9 +59,11 @@ public class ParserFactory {
59 59
     /**
60 60
      * Retrieves a parser instance.
61 61
      *
62
-     * @param myInfo The client information to use
62
+     * @param myInfo  The client information to use
63 63
      * @param address The address of the server to connect to
64
+     *
64 65
      * @return An appropriately configured parser
66
+     *
65 67
      * @since 0.6.3
66 68
      */
67 69
     public Parser getParser(final MyInfo myInfo, final URI address) {
@@ -77,7 +79,9 @@ public class ParserFactory {
77 79
      * Retrieves a protocol description.
78 80
      *
79 81
      * @param address The address to retrieve a description for
82
+     *
80 83
      * @return A corresponding protocol description
84
+     *
81 85
      * @since 0.6.4
82 86
      */
83 87
     public ProtocolDescription getDescription(final URI address) {
@@ -91,17 +95,19 @@ public class ParserFactory {
91 95
 
92 96
     /**
93 97
      * Retrieves and executes an exported service with the specified name from a
94
-     * {@link ServiceProvider} which can provide a parser for the specified
95
-     * address. If no such provider or service is found, null is returned.
98
+     * {@link ServiceProvider} which can provide a parser for the specified address. If no such
99
+     * provider or service is found, null is returned.
96 100
      *
97
-     * @param address The address a provider is required for
101
+     * @param address     The address a provider is required for
98 102
      * @param serviceName The name of the service to be retrieved
99
-     * @param args The arguments to be passed to the exported service
103
+     * @param args        The arguments to be passed to the exported service
104
+     *
100 105
      * @return The result from a relevant exported service, or null
106
+     *
101 107
      * @since 0.6.4
102 108
      */
103 109
     protected Object getExportResult(final URI address,
104
-            final String serviceName, final Object ... args) {
110
+            final String serviceName, final Object... args) {
105 111
         // TODO: Move default scheme to a setting
106 112
         final String scheme = address.getScheme() == null ? "irc" : address.getScheme();
107 113
 

+ 2
- 3
src/com/dmdirc/Precondition.java View File

@@ -25,9 +25,8 @@ package com.dmdirc;
25 25
 import java.lang.annotation.Documented;
26 26
 
27 27
 /**
28
- * The precondition annotation is used to indicate that a particular method
29
- * has one or more preconditions. The preconditions are specified in plain
30
- * English.
28
+ * The precondition annotation is used to indicate that a particular method has one or more
29
+ * preconditions. The preconditions are specified in plain English.
31 30
  */
32 31
 @Documented
33 32
 public @interface Precondition {

+ 21
- 23
src/com/dmdirc/Query.java View File

@@ -54,9 +54,9 @@ import java.util.Date;
54 54
 import java.util.List;
55 55
 
56 56
 /**
57
- * The Query class represents the client's view of a query with another user.
58
- * It handles callbacks for query events from the parser, maintains the
59
- * corresponding QueryWindow, and handles user input for the query.
57
+ * The Query class represents the client's view of a query with another user. It handles callbacks
58
+ * for query events from the parser, maintains the corresponding QueryWindow, and handles user input
59
+ * for the query.
60 60
  */
61 61
 @Factory(inject = true, providers = true, singleton = true)
62 62
 public class Query extends MessageTarget implements PrivateActionListener,
@@ -65,25 +65,22 @@ public class Query extends MessageTarget implements PrivateActionListener,
65 65
 
66 66
     /** The Server this Query is on. */
67 67
     private final Server server;
68
-
69 68
     /** The full host of the client associated with this query. */
70 69
     private String host;
71
-
72 70
     /** The nickname of the client associated with this query. */
73 71
     private String nickname;
74
-
75 72
     /** The tab completer for the query window. */
76 73
     private final TabCompleter tabCompleter;
77 74
 
78 75
     /**
79 76
      * Creates a new instance of Query.
80 77
      *
81
-     * @param newHost host of the remove client
82
-     * @param newServer The server object that this Query belongs to
78
+     * @param newHost             host of the remove client
79
+     * @param newServer           The server object that this Query belongs to
83 80
      * @param tabCompleterFactory The factory to use to create tab completers.
84
-     * @param commandController The controller to load commands from.
85
-     * @param messageSinkManager The sink manager to use to despatch messages.
86
-     * @param urlBuilder The URL builder to use when finding icons.
81
+     * @param commandController   The controller to load commands from.
82
+     * @param messageSinkManager  The sink manager to use to despatch messages.
83
+     * @param urlBuilder          The URL builder to use when finding icons.
87 84
      */
88 85
     public Query(
89 86
             @Unbound final Server newServer,
@@ -98,8 +95,8 @@ public class Query extends MessageTarget implements PrivateActionListener,
98 95
                 messageSinkManager,
99 96
                 urlBuilder,
100 97
                 Arrays.asList(
101
-                        WindowComponent.TEXTAREA.getIdentifier(),
102
-                        WindowComponent.INPUTFIELD.getIdentifier()));
98
+                WindowComponent.TEXTAREA.getIdentifier(),
99
+                WindowComponent.INPUTFIELD.getIdentifier()));
103 100
 
104 101
         this.server = newServer;
105 102
         this.host = newHost;
@@ -128,16 +125,15 @@ public class Query extends MessageTarget implements PrivateActionListener,
128 125
     }
129 126
 
130 127
     /**
131
-     * Sends a line to the recipient of this query using the specified
132
-     * nickname or hostmask as a target. This allows for users to send
133
-     * messages with a server specified (e.g. <code>nick@server</code>)
134
-     * as though the query wasn't open.
128
+     * Sends a line to the recipient of this query using the specified nickname or hostmask as a
129
+     * target. This allows for users to send messages with a server specified (e.g.
130
+     * <code>nick@server</code>) as though the query wasn't open.
135 131
      * <p>
136
-     * The caller is responsible for ensuring that the <code>target</code>
137
-     * does actually correspond to this query.
132
+     * The caller is responsible for ensuring that the <code>target</code> does actually correspond
133
+     * to this query.
138 134
      *
139 135
      * @since 0.6.4
140
-     * @param line The line to be sent
136
+     * @param line   The line to be sent
141 137
      * @param target The target to send the line to
142 138
      */
143 139
     public void sendLine(final String line, final String target) {
@@ -271,8 +267,10 @@ public class Query extends MessageTarget implements PrivateActionListener,
271 267
 
272 268
             try {
273 269
                 callbackManager.addCallback(PrivateActionListener.class, this, client.getNickname());
274
-                callbackManager.addCallback(PrivateMessageListener.class, this, client.getNickname());
275
-                callbackManager.addCallback(CompositionStateChangeListener.class, this, client.getNickname());
270
+                callbackManager.
271
+                        addCallback(PrivateMessageListener.class, this, client.getNickname());
272
+                callbackManager.addCallback(CompositionStateChangeListener.class, this, client.
273
+                        getNickname());
276 274
             } catch (CallbackNotFoundException ex) {
277 275
                 Logger.appError(ErrorLevel.HIGH, "Unable to get query events", ex);
278 276
             }
@@ -300,7 +298,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
300 298
             final ClientInfo client, final String reason) {
301 299
         if (client.getNickname().equals(getNickname())) {
302 300
             final StringBuffer format = new StringBuffer(reason.isEmpty()
303
-                ? "queryQuit" : "queryQuitReason");
301
+                    ? "queryQuit" : "queryQuitReason");
304 302
 
305 303
             ActionManager.getActionManager().triggerEvent(
306 304
                     CoreActionType.QUERY_QUIT, format, this, reason);

+ 7
- 7
src/com/dmdirc/Raw.java View File

@@ -42,8 +42,8 @@ import java.util.Arrays;
42 42
 import java.util.Date;
43 43
 
44 44
 /**
45
- * Handles the raw window (which shows the user raw data being sent and
46
- * received to/from the server).
45
+ * Handles the raw window (which shows the user raw data being sent and received to/from the
46
+ * server).
47 47
  */
48 48
 @Factory(inject = true, providers = true, singleton = true)
49 49
 public class Raw extends WritableFrameContainer
@@ -55,10 +55,10 @@ public class Raw extends WritableFrameContainer
55 55
     /**
56 56
      * Creates a new instance of Raw.
57 57
      *
58
-     * @param newServer the server to monitor
59
-     * @param commandController The controller to load commands from.
58
+     * @param newServer          the server to monitor
59
+     * @param commandController  The controller to load commands from.
60 60
      * @param messageSinkManager The sink manager to use to despatch messages.
61
-     * @param urlBuilder The URL builder to use when finding icons.
61
+     * @param urlBuilder         The URL builder to use when finding icons.
62 62
      */
63 63
     public Raw(
64 64
             @Unbound final Server newServer,
@@ -70,8 +70,8 @@ public class Raw extends WritableFrameContainer
70 70
                 messageSinkManager,
71 71
                 urlBuilder,
72 72
                 Arrays.asList(
73
-                    WindowComponent.TEXTAREA.getIdentifier(),
74
-                    WindowComponent.INPUTFIELD.getIdentifier()));
73
+                WindowComponent.TEXTAREA.getIdentifier(),
74
+                WindowComponent.INPUTFIELD.getIdentifier()));
75 75
 
76 76
         this.server = newServer;
77 77
 

+ 59
- 90
src/com/dmdirc/Server.java View File

@@ -92,142 +92,111 @@ import static com.google.common.base.Preconditions.checkArgument;
92 92
 import static com.google.common.base.Preconditions.checkNotNull;
93 93
 
94 94
 /**
95
- * The Server class represents the client's view of a server. It maintains
96
- * a list of all channels, queries, etc, and handles parser callbacks pertaining
97
- * to the server.
95
+ * The Server class represents the client's view of a server. It maintains a list of all channels,
96
+ * queries, etc, and handles parser callbacks pertaining to the server.
98 97
  */
99 98
 @Factory(inject = true, singleton = true, providers = true, name = "ServerFactoryImpl")
100 99
 public class Server extends WritableFrameContainer implements ConfigChangeListener,
101 100
         CertificateProblemListener, Connection {
102 101
 
103 102
     private static final org.slf4j.Logger log = LoggerFactory.getLogger(Server.class);
104
-
105 103
     /** The name of the general domain. */
106 104
     private static final String DOMAIN_GENERAL = "general";
107 105
     /** The name of the profile domain. */
108 106
     private static final String DOMAIN_PROFILE = "profile";
109 107
     /** The name of the server domain. */
110 108
     private static final String DOMAIN_SERVER = "server";
111
-
112 109
     /** Open channels that currently exist on the server. */
113 110
     private final Map<String, Channel> channels = new ConcurrentSkipListMap<>();
114 111
     /** Open query windows on the server. */
115 112
     private final Map<String, Query> queries = new ConcurrentSkipListMap<>();
116
-
117 113
     /** The Parser instance handling this server. */
118 114
     private Parser parser;
119 115
     /** The Parser instance that used to be handling this server. */
120 116
     private Parser oldParser;
121 117
     /** The parser-supplied protocol description object. */
122 118
     private ProtocolDescription protocolDescription;
123
-
124 119
     /**
125
-     * Object used to synchronise access to parser. This object should be
126
-     * locked by anything requiring that the parser reference remains the same
127
-     * for a duration of time, or by anything which is updating the parser
128
-     * reference.
120
+     * Object used to synchronise access to parser. This object should be locked by anything
121
+     * requiring that the parser reference remains the same for a duration of time, or by anything
122
+     * which is updating the parser reference.
129 123
      *
130
-     * If used in conjunction with myStateLock, the parserLock must always be
131
-     * locked INSIDE the myStateLock to prevent deadlocks.
124
+     * If used in conjunction with myStateLock, the parserLock must always be locked INSIDE the
125
+     * myStateLock to prevent deadlocks.
132 126
      */
133 127
     private final ReadWriteLock parserLock = new ReentrantReadWriteLock();
134
-
135 128
     /** The raw frame used for this server instance. */
136 129
     private Raw raw;
137
-
138 130
     /** The address of the server we're connecting to. */
139 131
     private URI address;
140
-
141 132
     /** The profile we're using. */
142 133
     private ConfigProvider profile;
143
-
144 134
     /** Object used to synchronise access to myState. */
145 135
     private final Object myStateLock = new Object();
146
-
147 136
     /** The current state of this server. */
148 137
     private final ServerStatus myState = new ServerStatus(this, myStateLock);
149
-
150 138
     /** The timer we're using to delay reconnects. */
151 139
     private Timer reconnectTimer;
152
-
153 140
     /** The timer we're using to send WHO requests. */
154 141
     private final Timer whoTimer;
155
-
156 142
     /** The tabcompleter used for this server. */
157 143
     private final TabCompleter tabCompleter;
158
-
159 144
     /** Our reason for being away, if any. */
160 145
     private String awayMessage;
161
-
162 146
     /** Our event handler. */
163 147
     private final ServerEventHandler eventHandler = new ServerEventHandler(this);
164
-
165 148
     /** A list of outstanding invites. */
166 149
     private final List<Invite> invites = new ArrayList<>();
167
-
168 150
     /** A set of channels we want to join without focusing. */
169 151
     private final Set<String> backgroundChannels = new HashSet<>();
170
-
171 152
     /** Our ignore list. */
172 153
     private final IgnoreList ignoreList = new IgnoreList();
173
-
174 154
     /** Our string convertor. */
175 155
     private StringConverter converter = new DefaultStringConverter();
176
-
177 156
     /** The certificate manager in use, if any. */
178 157
     private CertificateManager certificateManager;
179
-
180 158
     /** ParserFactory we use for creating parsers. */
181 159
     private final ParserFactory parserFactory;
182
-
183 160
     /** ServerManager that created us. */
184 161
     private final ServerManager manager;
185
-
186 162
     /** Factory to use to create new identities. */
187 163
     private final IdentityFactory identityFactory;
188
-
189 164
     /** Window manager to pas to children. */
190 165
     private final WindowManager windowManager;
191
-
192 166
     /** The migrator to use to change our config provider. */
193 167
     private final ConfigProviderMigrator configMigrator;
194
-
195 168
     /** Factory to use for creating channels. */
196 169
     private final ChannelFactory channelFactory;
197
-
198 170
     /** Factory to use for creating queries. */
199 171
     private final QueryFactory queryFactory;
200
-
201 172
     /** Factory to use for creating raw windows. */
202 173
     private final RawFactory rawFactory;
203
-
204 174
     /** The config provider to write user settings to. */
205 175
     private final ConfigProvider userSettings;
206
-
207 176
     /** The manager to use to add status bar messages. */
208 177
     private final StatusBarManager statusBarManager;
209 178
 
210 179
     /**
211
-     * Creates a new server which will connect to the specified URL with
212
-     * the specified profile.
180
+     * Creates a new server which will connect to the specified URL with the specified profile.
213 181
      *
214 182
      * @since 0.6.3
215
-     * @param manager The server manager that owns this server.
216
-     * @param configMigrator The migrateable configuration manager to read config settings from.
217
-     * @param commandParser The parser to use for commands in this server's window.
218
-     * @param parserFactory The factory to use to generate parsers.
183
+     * @param manager             The server manager that owns this server.
184
+     * @param configMigrator      The migrateable configuration manager to read config settings
185
+     *                            from.
186
+     * @param commandParser       The parser to use for commands in this server's window.
187
+     * @param parserFactory       The factory to use to generate parsers.
219 188
      * @param tabCompleterFactory The factory to use for tab completers.
220
-     * @param identityFactory The factory to use to create identities.
221
-     * @param messageSinkManager The sink manager to use to despatch messages.
222
-     * @param statusBarManager The manager to use to add status bar messages.
223
-     * @param windowManager Window Manager
224
-     * @param channelFactory The factory to use to create channels.
225
-     * @param queryFactory The factory to use to create queries.
226
-     * @param rawFactory The factory to use to create raw windows.
227
-     * @param urlBuilder The URL builder to use when finding icons.
228
-     * @param userSettings The config provider to write user settings to.
229
-     * @param uri The address of the server to connect to
230
-     * @param profile The profile to use
189
+     * @param identityFactory     The factory to use to create identities.
190
+     * @param messageSinkManager  The sink manager to use to despatch messages.
191
+     * @param statusBarManager    The manager to use to add status bar messages.
192
+     * @param windowManager       Window Manager
193
+     * @param channelFactory      The factory to use to create channels.
194
+     * @param queryFactory        The factory to use to create queries.
195
+     * @param rawFactory          The factory to use to create raw windows.
196
+     * @param urlBuilder          The URL builder to use when finding icons.
197
+     * @param userSettings        The config provider to write user settings to.
198
+     * @param uri                 The address of the server to connect to
199
+     * @param profile             The profile to use
231 200
      */
232 201
     public Server(
233 202
             final ServerManager manager,
@@ -254,9 +223,9 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
254 223
                 messageSinkManager,
255 224
                 urlBuilder,
256 225
                 Arrays.asList(
257
-                    WindowComponent.TEXTAREA.getIdentifier(),
258
-                    WindowComponent.INPUTFIELD.getIdentifier(),
259
-                    WindowComponent.CERTIFICATE_VIEWER.getIdentifier()));
226
+                WindowComponent.TEXTAREA.getIdentifier(),
227
+                WindowComponent.INPUTFIELD.getIdentifier(),
228
+                WindowComponent.CERTIFICATE_VIEWER.getIdentifier()));
260 229
 
261 230
         this.manager = manager;
262 231
         this.parserFactory = parserFactory;
@@ -292,11 +261,10 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
292 261
     }
293 262
 
294 263
     /**
295
-     * Updates the connection details for this server. If the specified URI
296
-     * does not define a port, the default port from the protocol description
297
-     * will be used.
264
+     * Updates the connection details for this server. If the specified URI does not define a port,
265
+     * the default port from the protocol description will be used.
298 266
      *
299
-     * @param uri The new URI that this server should connect to
267
+     * @param uri     The new URI that this server should connect to
300 268
      * @param profile The profile that this server should use
301 269
      */
302 270
     private void setConnectionDetails(final URI uri, final ConfigProvider profile) {
@@ -399,7 +367,8 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
399 367
 
400 368
             parser.connect();
401 369
             if (parser instanceof ThreadedParser) {
402
-                ((ThreadedParser)parser).getControlThread().setName("Parser - " + connectAddress.getHost());
370
+                ((ThreadedParser) parser).getControlThread().setName("Parser - " + connectAddress.
371
+                        getHost());
403 372
             }
404 373
         }
405 374
 
@@ -440,17 +409,17 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
440 409
             log.info("Disconnecting. Current state: {}", myState.getState());
441 410
 
442 411
             switch (myState.getState()) {
443
-            case CLOSING:
444
-            case DISCONNECTING:
445
-            case DISCONNECTED:
446
-            case TRANSIENTLY_DISCONNECTED:
447
-                return;
448
-            case RECONNECT_WAIT:
449
-                log.debug("Cancelling reconnection timer");
450
-                reconnectTimer.cancel();
451
-                break;
452
-            default:
453
-                break;
412
+                case CLOSING:
413
+                case DISCONNECTING:
414
+                case DISCONNECTED:
415
+                case TRANSIENTLY_DISCONNECTED:
416
+                    return;
417
+                case RECONNECT_WAIT:
418
+                    log.debug("Cancelling reconnection timer");
419
+                    reconnectTimer.cancel();
420
+                    break;
421
+                default:
422
+                    break;
454 423
             }
455 424
 
456 425
             clearChannels();
@@ -642,7 +611,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
642 611
     public Channel addChannel(final ChannelInfo chan) {
643 612
         return addChannel(chan, !backgroundChannels.contains(chan.getName())
644 613
                 || getConfigManager().getOptionBool(DOMAIN_GENERAL,
645
-                    "hidechannels"));
614
+                "hidechannels"));
646 615
     }
647 616
 
648 617
     /** {@inheritDoc} */
@@ -704,12 +673,14 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
704 673
     }
705 674
 
706 675
     /**
707
-     * Retrieves the host component of the specified URI, or throws a relevant
708
-     * exception if this is not possible.
676
+     * Retrieves the host component of the specified URI, or throws a relevant exception if this is
677
+     * not possible.
709 678
      *
710 679
      * @param uri The URI to be processed
680
+     *
711 681
      * @return The URI's host component, as returned by {@link URI#getHost()}.
712
-     * @throws NullPointerException If <code>uri</code> is null
682
+     *
683
+     * @throws NullPointerException     If <code>uri</code> is null
713 684
      * @throws IllegalArgumentException If the specified URI has no host
714 685
      * @since 0.6.4
715 686
      */
@@ -875,13 +846,13 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
875 846
 
876 847
     /** {@inheritDoc} */
877 848
     @Override
878
-    public void join(final ChannelJoinRequest ... requests) {
849
+    public void join(final ChannelJoinRequest... requests) {
879 850
         join(true, requests);
880 851
     }
881 852
 
882 853
     /** {@inheritDoc} */
883 854
     @Override
884
-    public void join(final boolean focus, final ChannelJoinRequest ... requests) {
855
+    public void join(final boolean focus, final ChannelJoinRequest... requests) {
885 856
         synchronized (myStateLock) {
886 857
             if (myState.getState() == ServerState.CONNECTED) {
887 858
                 final List<ChannelJoinRequest> pending = new ArrayList<>();
@@ -1009,10 +980,11 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1009 980
     }
1010 981
 
1011 982
     /**
1012
-     * Calculates a network name from the specified server name. This method
1013
-     * implements parts 2-4 of the procedure documented at getNetwork().
983
+     * Calculates a network name from the specified server name. This method implements parts 2-4 of
984
+     * the procedure documented at getNetwork().
1014 985
      *
1015 986
      * @param serverName The server name to parse
987
+     *
1016 988
      * @return A network name for the specified server
1017 989
      */
1018 990
     protected static String getNetworkFromServerName(final String serverName) {
@@ -1191,8 +1163,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1191 1163
                 final Object[] arguments = new Object[]{
1192 1164
                     address.getHost(), parser == null ? "Unknown" : parser.getServerName(),
1193 1165
                     address.getPort(), parser == null ? "Unknown" : getNetwork(),
1194
-                    parser == null ? "Unknown" : parser.getLocalClient().getNickname(),
1195
-                };
1166
+                    parser == null ? "Unknown" : parser.getLocalClient().getNickname(),};
1196 1167
 
1197 1168
                 setName(Formatter.formatMessage(getConfigManager(),
1198 1169
                         "serverName", arguments));
@@ -1213,8 +1184,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1213 1184
     }
1214 1185
 
1215 1186
     /**
1216
-     * Called when the server says that the nickname we're trying to use is
1217
-     * already in use.
1187
+     * Called when the server says that the nickname we're trying to use is already in use.
1218 1188
      *
1219 1189
      * @param nickname The nickname that we were trying to use
1220 1190
      */
@@ -1250,7 +1220,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1250 1220
      * Called when the server sends a numeric event.
1251 1221
      *
1252 1222
      * @param numeric The numeric code for the event
1253
-     * @param tokens The (tokenised) arguments of the event
1223
+     * @param tokens  The (tokenised) arguments of the event
1254 1224
      */
1255 1225
     public void onNumeric(final int numeric, final String[] tokens) {
1256 1226
         String snumeric = String.valueOf(numeric);
@@ -1433,7 +1403,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1433 1403
                 Long.valueOf(parser.getPingTime()));
1434 1404
 
1435 1405
         if (parser.getPingTime()
1436
-                 >= getConfigManager().getOptionInt(DOMAIN_SERVER, "pingtimeout")) {
1406
+                >= getConfigManager().getOptionInt(DOMAIN_SERVER, "pingtimeout")) {
1437 1407
             log.warn("Server appears to be stoned, reconnecting");
1438 1408
             handleNotification("stonedServer", getAddress());
1439 1409
             reconnect();
@@ -1601,7 +1571,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1601 1571
 
1602 1572
     /** {@inheritDoc} */
1603 1573
     @Override
1604
-    public void acceptInvites(final Invite ... invites) {
1574
+    public void acceptInvites(final Invite... invites) {
1605 1575
         final ChannelJoinRequest[] requests = new ChannelJoinRequest[invites.length];
1606 1576
 
1607 1577
         for (int i = 0; i < invites.length; i++) {
@@ -1684,7 +1654,6 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
1684 1654
         awayMessage = message;
1685 1655
 
1686 1656
         new Thread(new Runnable() {
1687
-
1688 1657
             /** {@inheritDoc} */
1689 1658
             @Override
1690 1659
             public void run() {

+ 16
- 18
src/com/dmdirc/ServerManager.java View File

@@ -48,27 +48,22 @@ import javax.inject.Singleton;
48 48
 import static com.google.common.base.Preconditions.checkArgument;
49 49
 
50 50
 /**
51
- * The ServerManager maintains a list of all servers, and provides methods to
52
- * search or iterate over them.
51
+ * The ServerManager maintains a list of all servers, and provides methods to search or iterate over
52
+ * them.
53 53
  */
54 54
 @Singleton
55 55
 public class ServerManager implements ServerFactory {
56 56
 
57 57
     /** All servers that currently exist. */
58 58
     private final Set<Server> servers = new CopyOnWriteArraySet<>();
59
-
60 59
     /** The identity controller to use to find profiles. */
61 60
     private final IdentityController identityController;
62
-
63 61
     /** A provider of {@link CommandController}s to pass to servers. */
64 62
     private final Provider<CommandController> commandController;
65
-
66 63
     /** The identity factory to give to servers. */
67 64
     private final IdentityFactory identityFactory;
68
-
69 65
     /** Window manager to add new servers to. */
70 66
     private final WindowManager windowManager;
71
-
72 67
     /** Concrete server factory to use. */
73 68
     private final ServerFactoryImpl serverFactoryImpl;
74 69
 
@@ -76,10 +71,10 @@ public class ServerManager implements ServerFactory {
76 71
      * Creates a new instance of ServerManager.
77 72
      *
78 73
      * @param identityController The identity controller to use to find profiles.
79
-     * @param identityFactory The factory to use to create new identities.
80
-     * @param commandController A provider of {@link CommandController}s to pass to servers.
81
-     * @param windowManager Window manager to add new servers to.
82
-     * @param serverFactory The factory to use to create servers.
74
+     * @param identityFactory    The factory to use to create new identities.
75
+     * @param commandController  A provider of {@link CommandController}s to pass to servers.
76
+     * @param windowManager      Window manager to add new servers to.
77
+     * @param serverFactory      The factory to use to create servers.
83 78
      */
84 79
     @Inject
85 80
     public ServerManager(
@@ -126,8 +121,8 @@ public class ServerManager implements ServerFactory {
126 121
     }
127 122
 
128 123
     /**
129
-     * Unregisters a server from the manager. The request is ignored if the
130
-     * ServerManager is in the process of closing all servers.
124
+     * Unregisters a server from the manager. The request is ignored if the ServerManager is in the
125
+     * process of closing all servers.
131 126
      *
132 127
      * @param server The server to be unregistered
133 128
      */
@@ -180,6 +175,7 @@ public class ServerManager implements ServerFactory {
180 175
      * Retrieves a list of servers connected to the specified network.
181 176
      *
182 177
      * @param network The network to search for
178
+     *
183 179
      * @return A list of servers connected to the network
184 180
      */
185 181
     public List<Server> getServersByNetwork(final String network) {
@@ -195,11 +191,12 @@ public class ServerManager implements ServerFactory {
195 191
     }
196 192
 
197 193
     /**
198
-     * Creates a new server which will connect to the specified URI with the
199
-     * default profile.
194
+     * Creates a new server which will connect to the specified URI with the default profile.
200 195
      *
201 196
      * @param uri The URI to connect to
197
+     *
202 198
      * @return The server which will be connecting
199
+     *
203 200
      * @since 0.6.3
204 201
      */
205 202
     public Server connectToAddress(final URI uri) {
@@ -208,12 +205,13 @@ public class ServerManager implements ServerFactory {
208 205
     }
209 206
 
210 207
     /**
211
-     * Creates a new server which will connect to the specified URI with the
212
-     * specified profile.
208
+     * Creates a new server which will connect to the specified URI with the specified profile.
213 209
      *
214
-     * @param uri The URI to connect to
210
+     * @param uri     The URI to connect to
215 211
      * @param profile The profile to use
212
+     *
216 213
      * @return The server which will be connecting
214
+     *
217 215
      * @since 0.6.3
218 216
      */
219 217
     public Server connectToAddress(final URI uri, final ConfigProvider profile) {

+ 26
- 31
src/com/dmdirc/ServerState.java View File

@@ -32,49 +32,43 @@ public enum ServerState {
32 32
 
33 33
     /** Indicates the client is in the process of connecting. */
34 34
     CONNECTING(
35
-            "CONNECTED",                 // Connection attempt succeeded
36
-            "TRANSIENTLY_DISCONNECTED",  // Connection attempt failed
37
-            "DISCONNECTING",             // User ordered a disconnection
38
-            "CLOSING"                    // DMDirc is closing
35
+    "CONNECTED", // Connection attempt succeeded
36
+    "TRANSIENTLY_DISCONNECTED", // Connection attempt failed
37
+    "DISCONNECTING", // User ordered a disconnection
38
+    "CLOSING" // DMDirc is closing
39 39
     ),
40
-
41 40
     /** Indicates the client has connected to the server. */
42 41
     CONNECTED(
43
-            "DISCONNECTING",             // User ordered a disconnection
44
-            "TRANSIENTLY_DISCONNECTED",  // Server caused a disconnection
45
-            "CLOSING"                    // DMDirc is closing
42
+    "DISCONNECTING", // User ordered a disconnection
43
+    "TRANSIENTLY_DISCONNECTED", // Server caused a disconnection
44
+    "CLOSING" // DMDirc is closing
46 45
     ),
47
-
48 46
     /** Indicates that we've been temporarily disconnected. */
49 47
     TRANSIENTLY_DISCONNECTED(
50
-            "CONNECTING",                // User forced a connect attempt
51
-            "RECONNECT_WAIT",            // Waiting for auto-reconnect
52
-            "CLOSING"                    // DMDirc is closing
48
+    "CONNECTING", // User forced a connect attempt
49
+    "RECONNECT_WAIT", // Waiting for auto-reconnect
50
+    "CLOSING" // DMDirc is closing
53 51
     ),
54
-
55 52
     /** Indicates that the user has told us to disconnect. */
56 53
     DISCONNECTED(
57
-            "CONNECTING",                // User forced a connect attempt
58
-            "CLOSING"                    // DMDirc is closing
54
+    "CONNECTING", // User forced a connect attempt
55
+    "CLOSING" // DMDirc is closing
59 56
     ),
60
-
61 57
     /** In the process of disconnecting. */
62 58
     DISCONNECTING(
63
-            "DISCONNECTED",              // Socket closed
64
-            "CLOSING"                    // DMDirc is closing
59
+    "DISCONNECTED", // Socket closed
60
+    "CLOSING" // DMDirc is closing
65 61
     ),
66
-
67 62
     /** Indicates we're waiting for the auto-reconnect timer to fire. */
68 63
     RECONNECT_WAIT(
69
-            "CONNECTING",                // User forced a connect attempt
70
-            "TRANSIENTLY_DISCONNECTED",  // Reconnect timer expired
71
-            "DISCONNECTED",              // User forced a disconnect
72
-            "CLOSING"                    // DMDirc is closing
64
+    "CONNECTING", // User forced a connect attempt
65
+    "TRANSIENTLY_DISCONNECTED", // Reconnect timer expired
66
+    "DISCONNECTED", // User forced a disconnect
67
+    "CLOSING" // DMDirc is closing
73 68
     ),
74
-
75
-    /** Indicates that the server frame and its children are closing. */
69
+    /** Indicates that the server frame and its
70
+     * children are closing. */
76 71
     CLOSING;
77
-
78 72
     /** The allowed transitions from this state. */
79 73
     private final List<String> transitions;
80 74
 
@@ -82,19 +76,18 @@ public enum ServerState {
82 76
      * Creates a new instance of ServerState.
83 77
      *
84 78
      * @since 0.6.3m1
85
-     * @param transitions The names of the states to which a transition is
86
-     * allowed from this state
79
+     * @param transitions The names of the states to which a transition is allowed from this state
87 80
      */
88
-    ServerState(final String ... transitions) {
81
+    ServerState(final String... transitions) {
89 82
         this.transitions = Arrays.asList(transitions);
90 83
     }
91 84
 
92 85
     /**
93
-     * Determines whether a transition from this state to the specified state
94
-     * would be legal.
86
+     * Determines whether a transition from this state to the specified state would be legal.
95 87
      *
96 88
      * @since 0.6.3m1
97 89
      * @param state The state that is being transitioned to
90
+     *
98 91
      * @return True if the transition is allowed, false otherwise.
99 92
      */
100 93
     public boolean canTransitionTo(final ServerState state) {
@@ -105,9 +98,11 @@ public enum ServerState {
105 98
      * Determines where the current state is a disconnected one.
106 99
      *
107 100
      * @return True if the state is one of the disconnected states, false otherwise
101
+     *
108 102
      * @since 0.6.3m1
109 103
      */
110 104
     public boolean isDisconnected() {
111 105
         return this == ServerState.DISCONNECTED || this == ServerState.TRANSIENTLY_DISCONNECTED;
112 106
     }
107
+
113 108
 }

+ 13
- 16
src/com/dmdirc/ServerStatus.java View File

@@ -29,8 +29,7 @@ import java.util.ArrayList;
29 29
 import java.util.List;
30 30
 
31 31
 /**
32
- * Describes the status of a server and manages transitions between different
33
- * states.
32
+ * Describes the status of a server and manages transitions between different states.
34 33
  *
35 34
  * @since 0.6.3m1
36 35
  */
@@ -38,24 +37,21 @@ public class ServerStatus {
38 37
 
39 38
     /** The server to which this status belongs. */
40 39
     private final Server server;
41
-
42 40
     /** Object to notify when the state of the server changes. */
43 41
     private final Object notifier;
44
-
45 42
     /** The current state of the server. */
46 43
     private ServerState state = ServerState.DISCONNECTED;
47
-
48 44
     /** A history of transactions for debugging purposes. */
49 45
     private RollingList<String> history = new RollingList<>(10);
50
-
51 46
     /** A list of known parser hashcodes. */
52 47
     private final List<Integer> parsers = new ArrayList<>();
53 48
 
54 49
     /**
55 50
      * Creates a new ServerStatus instance for the specified server.
56 51
      *
57
-     * @param server The server to which this status belongs
52
+     * @param server   The server to which this status belongs
58 53
      * @param notifier The object to notify when the state changes
54
+     *
59 55
      * @since 0.6.3
60 56
      */
61 57
     public ServerStatus(final Server server, final Object notifier) {
@@ -67,6 +63,7 @@ public class ServerStatus {
67 63
      * Transitions the status of this object to the specified state.
68 64
      *
69 65
      * @param newState The state to transition to
66
+     *
70 67
      * @throws IllegalArgumentException If the specified transition is invalid
71 68
      */
72 69
     public synchronized void transition(final ServerState newState) {
@@ -94,13 +91,12 @@ public class ServerStatus {
94 91
     }
95 92
 
96 93
     /**
97
-     * Adds a history entry to this status object. The history entry contains
98
-     * the name of the states being transitioned between, the details of the
99
-     * method (and class and line) which initiated the transition, and the
100
-     * name of the thread in which the transition is occuring.
94
+     * Adds a history entry to this status object. The history entry contains the name of the states
95
+     * being transitioned between, the details of the method (and class and line) which initiated
96
+     * the transition, and the name of the thread in which the transition is occuring.
101 97
      *
102 98
      * @param fromState The state which is being transitioned from
103
-     * @param toState The state which is being transitioned to
99
+     * @param toState   The state which is being transitioned to
104 100
      */
105 101
     protected void addHistoryEntry(final ServerState fromState, final ServerState toState) {
106 102
         final StringBuilder builder = new StringBuilder();
@@ -122,8 +118,8 @@ public class ServerStatus {
122 118
      * Retrieves the transition history of this status object as a string.
123 119
      *
124 120
      * @see #addHistoryEntry(com.dmdirc.ServerState, com.dmdirc.ServerState)
125
-     * @return A line feed ('\n') delimited string containing one entry for
126
-     * each of the entries in this status's transition history.
121
+     * @return A line feed ('\n') delimited string containing one entry for each of the entries in
122
+     *         this status's transition history.
127 123
      */
128 124
     public String getTransitionHistory() {
129 125
         final StringBuilder builder = new StringBuilder();
@@ -140,10 +136,11 @@ public class ServerStatus {
140 136
     }
141 137
 
142 138
     /**
143
-     * Returns a unique, ID for the specified parser. Each parser that has been
144
-     * seen to be used by this server is given a sequential id.
139
+     * Returns a unique, ID for the specified parser. Each parser that has been seen to be used by
140
+     * this server is given a sequential id.
145 141
      *
146 142
      * @param parser The parser whose ID is being requested
143
+     *
147 144
      * @return A unique ID for the specified parser, or 0 if the parser is null
148 145
      */
149 146
     public int getParserID(final Parser parser) {

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

@@ -35,7 +35,6 @@ public class SystemLifecycleController implements LifecycleController {
35 35
 
36 36
     /** Controller to retrieve settings from. */
37 37
     private final AggregateConfigProvider configProvider;
38
-
39 38
     /** Manager to use to disconnect servers. */
40 39
     private final ServerManager serverManager;
41 40
 

+ 2
- 2
src/com/dmdirc/Topic.java View File

@@ -37,9 +37,9 @@ public class Topic {
37 37
     /**
38 38
      * Creates a new topic.
39 39
      *
40
-     * @param topic Topic
40
+     * @param topic  Topic
41 41
      * @param client Topic client
42
-     * @param time Topic time
42
+     * @param time   Topic time
43 43
      */
44 44
     public Topic(final String topic, final String client, final long time) {
45 45
         this.topic = topic;

+ 33
- 33
src/com/dmdirc/WritableFrameContainer.java View File

@@ -37,35 +37,32 @@ import java.util.Date;
37 37
 import java.util.List;
38 38
 
39 39
 /**
40
- * The writable frame container adds additional methods to the frame container
41
- * class that allow the sending of lines back to whatever the container's
42
- * data source is (e.g. an IRC channel or server).
40
+ * The writable frame container adds additional methods to the frame container class that allow the
41
+ * sending of lines back to whatever the container's data source is (e.g. an IRC channel or server).
43 42
  */
44 43
 public abstract class WritableFrameContainer extends FrameContainer {
45 44
 
46 45
     /** The name of the server notification target. */
47 46
     protected static final String NOTIFICATION_SERVER = "server";
48
-
49 47
     /** The name of the channel notification target. */
50 48
     protected static final String NOTIFICATION_CHANNEL = "channel";
51
-
52 49
     /** The command parser used for commands in this container. */
53 50
     protected final CommandParser commandParser;
54
-
55 51
     /** The manager to use to despatch messages to sinks. */
56 52
     private final MessageSinkManager messageSinkManager;
57 53
 
58 54
     /**
59 55
      * Creates a new WritableFrameContainer.
60 56
      *
61
-     * @param icon The icon to use for this container
62
-     * @param name The name of this container
63
-     * @param title The title of this container
64
-     * @param config The config manager for this container
65
-     * @param parser The command parser for this container
57
+     * @param icon               The icon to use for this container
58
+     * @param name               The name of this container
59
+     * @param title              The title of this container
60
+     * @param config             The config manager for this container
61
+     * @param parser             The command parser for this container
66 62
      * @param messageSinkManager The sink manager to use to despatch messages
67
-     * @param urlBuilder The URL builder to use when finding icons.
68
-     * @param components The UI components that this frame requires
63
+     * @param urlBuilder         The URL builder to use when finding icons.
64
+     * @param components         The UI components that this frame requires
65
+     *
69 66
      * @since 0.6.4
70 67
      */
71 68
     public WritableFrameContainer(
@@ -108,18 +105,19 @@ public abstract class WritableFrameContainer extends FrameContainer {
108 105
     public abstract TabCompleter getTabCompleter();
109 106
 
110 107
     /**
111
-     * Returns the maximum length that a line passed to sendLine() should be,
112
-     * in order to prevent it being truncated or causing protocol violations.
108
+     * Returns the maximum length that a line passed to sendLine() should be, in order to prevent it
109
+     * being truncated or causing protocol violations.
113 110
      *
114 111
      * @return The maximum line length for this container
115 112
      */
116 113
     public abstract int getMaxLineLength();
117 114
 
118 115
     /**
119
-     * Splits the specified line into chunks that contain a number of bytes
120
-     * less than or equal to the value returned by {@link #getMaxLineLength()}.
116
+     * Splits the specified line into chunks that contain a number of bytes less than or equal to
117
+     * the value returned by {@link #getMaxLineLength()}.
121 118
      *
122 119
      * @param line The line to be split
120
+     *
123 121
      * @return An ordered list of chunks of the desired length
124 122
      */
125 123
     protected List<String> splitLine(final String line) {
@@ -154,6 +152,7 @@ public abstract class WritableFrameContainer extends FrameContainer {
154 152
      * Returns the number of lines that the specified string would be sent as.
155 153
      *
156 154
      * @param line The string to be split and sent
155
+     *
157 156
      * @return The number of lines required to send the specified string
158 157
      */
159 158
     public final int getNumLines(final String line) {
@@ -176,8 +175,9 @@ public abstract class WritableFrameContainer extends FrameContainer {
176 175
      * Processes and displays a notification.
177 176
      *
178 177
      * @param messageType The name of the formatter to be used for the message
179
-     * @param actionType The action type to be used
180
-     * @param args The arguments for the message
178
+     * @param actionType  The action type to be used
179
+     * @param args        The arguments for the message
180
+     *
181 181
      * @return True if any further behaviour should be executed, false otherwise
182 182
      */
183 183
     public boolean doNotification(final String messageType,
@@ -188,10 +188,11 @@ public abstract class WritableFrameContainer extends FrameContainer {
188 188
     /**
189 189
      * Processes and displays a notification.
190 190
      *
191
-     * @param date The date/time at which the event occured
191
+     * @param date        The date/time at which the event occured
192 192
      * @param messageType The name of the formatter to be used for the message
193
-     * @param actionType The action type to be used
194
-     * @param args The arguments for the message
193
+     * @param actionType  The action type to be used
194
+     * @param args        The arguments for the message
195
+     *
195 196
      * @return True if any further behaviour should be executed, false otherwise
196 197
      */
197 198
     public boolean doNotification(final Date date, final String messageType,
@@ -223,7 +224,7 @@ public abstract class WritableFrameContainer extends FrameContainer {
223 224
     /**
224 225
      * Allows subclasses to modify the lists of arguments for notifications.
225 226
      *
226
-     * @param actionArgs The list of arguments to be passed to the actions system
227
+     * @param actionArgs  The list of arguments to be passed to the actions system
227 228
      * @param messageArgs The list of arguments to be passed to the formatter
228 229
      */
229 230
     protected void modifyNotificationArgs(final List<Object> actionArgs,
@@ -234,8 +235,9 @@ public abstract class WritableFrameContainer extends FrameContainer {
234 235
     /**
235 236
      * Allows subclasses to process specific types of notification arguments.
236 237
      *
237
-     * @param arg The argument to be processed
238
+     * @param arg  The argument to be processed
238 239
      * @param args The list of arguments that any data should be appended to
240
+     *
239 241
      * @return True if the arg has been processed, false otherwise
240 242
      */
241 243
     protected boolean processNotificationArg(final Object arg, final List<Object> args) {
@@ -243,25 +245,23 @@ public abstract class WritableFrameContainer extends FrameContainer {
243 245
     }
244 246
 
245 247
     /**
246
-     * Handles general server notifications (i.e., ones not tied to a
247
-     * specific window). The user can select where the notifications should
248
-     * go in their config.
248
+     * Handles general server notifications (i.e., ones not tied to a specific window). The user can
249
+     * select where the notifications should go in their config.
249 250
      *
250 251
      * @param messageType The type of message that is being sent
251
-     * @param args The arguments for the message
252
+     * @param args        The arguments for the message
252 253
      */
253 254
     public void handleNotification(final String messageType, final Object... args) {
254 255
         handleNotification(new Date(), messageType, args);
255 256
     }
256 257
 
257 258
     /**
258
-     * Handles general server notifications (i.e., ones not tied to a
259
-     * specific window). The user can select where the notifications should
260
-     * go in their config.
259
+     * Handles general server notifications (i.e., ones not tied to a specific window). The user can
260
+     * select where the notifications should go in their config.
261 261
      *
262
-     * @param date The date/time at which the event occured
262
+     * @param date        The date/time at which the event occured
263 263
      * @param messageType The type of message that is being sent
264
-     * @param args The arguments for the message
264
+     * @param args        The arguments for the message
265 265
      */
266 266
     public void handleNotification(final Date date, final String messageType, final Object... args) {
267 267
         messageSinkManager.despatchMessage(this, date, messageType, args);

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

@@ -66,31 +66,28 @@ public class Action extends ActionModel implements ConfigChangeListener {
66 66
     private static final String DOMAIN_CONCURRENCY = "concurrency";
67 67
     /** The domain name for misc settings. */
68 68
     private static final String DOMAIN_MISC = "misc";
69
-
70 69
     /** The base directory to save actions in. */
71 70
     private final String actionsDirectory;
72 71
     /** The controller to use to read and update settings. */
73 72
     private final IdentityController identityController;
74 73
     /** The controller to use to retrieve components, comparisons, etc. */
75 74
     private final ActionController actionController;
76
-
77 75
     /** The config file we're using. */
78 76
     protected ConfigFile config;
79
-
80 77
     /** The location of the file we're reading/saving. */
81 78
     private String location;
82 79
 
83 80
     /**
84
-     * Creates a new instance of Action. The group and name specified must
85
-     * be the group and name of a valid action already saved to disk.
81
+     * Creates a new instance of Action. The group and name specified must be the group and name of
82
+     * a valid action already saved to disk.
86 83
      *
87 84
      * @param globalCommandParserProvider Provider of global command parsers for triggering actions.
88
-     * @param substitutorFactory Factory to use to create action substitutors.
89
-     * @param actionController The controller that owns this action.
90
-     * @param identityController The controller to use to retrieve and update settings.
91
-     * @param actionsDirectory The base directory to store actions in.
92
-     * @param group The group the action belongs to
93
-     * @param name The name of the action
85
+     * @param substitutorFactory          Factory to use to create action substitutors.
86
+     * @param actionController            The controller that owns this action.
87
+     * @param identityController          The controller to use to retrieve and update settings.
88
+     * @param actionsDirectory            The base directory to store actions in.
89
+     * @param group                       The group the action belongs to
90
+     * @param name                        The name of the action
94 91
      */
95 92
     public Action(
96 93
             final Provider<GlobalCommandParser> globalCommandParserProvider,
@@ -124,21 +121,20 @@ public class Action extends ActionModel implements ConfigChangeListener {
124 121
     }
125 122
 
126 123
     /**
127
-     * Creates a new instance of Action with the specified properties and saves
128
-     * it to disk.
124
+     * Creates a new instance of Action with the specified properties and saves it to disk.
129 125
      *
130 126
      * @param globalCommandParserProvider Provider of global command parsers for triggering actions.
131
-     * @param substitutorFactory Factory to use to create action substitutors.
132
-     * @param actionController The controller that owns this action.
133
-     * @param identityController The controller to use to retrieve and update settings.
134
-     * @param actionsDirectory The base directory to store actions in.
135
-     * @param group The group the action belongs to
136
-     * @param name The name of the action
137
-     * @param triggers The triggers to use
138
-     * @param response The response to use
139
-     * @param conditions The conditions to use
140
-     * @param conditionTree The condition tree to use
141
-     * @param newFormat The new formatter to use
127
+     * @param substitutorFactory          Factory to use to create action substitutors.
128
+     * @param actionController            The controller that owns this action.
129
+     * @param identityController          The controller to use to retrieve and update settings.
130
+     * @param actionsDirectory            The base directory to store actions in.
131
+     * @param group                       The group the action belongs to
132
+     * @param name                        The name of the action
133
+     * @param triggers                    The triggers to use
134
+     * @param response                    The response to use
135
+     * @param conditions                  The conditions to use
136
+     * @param conditionTree               The condition tree to use
137
+     * @param newFormat                   The new formatter to use
142 138
      */
143 139
     public Action(
144 140
             final Provider<GlobalCommandParser> globalCommandParserProvider,
@@ -159,7 +155,8 @@ public class Action extends ActionModel implements ConfigChangeListener {
159 155
         this.actionController = actionController;
160 156
         this.identityController = identityController;
161 157
         this.actionsDirectory = actionsDirectory;
162
-        this.location = actionsDirectory + group + File.separator + name.replaceAll("[^A-Za-z0-9\\-_]", "_");
158
+        this.location = actionsDirectory + group + File.separator
159
+                + name.replaceAll("[^A-Za-z0-9\\-_]", "_");
163 160
 
164 161
         new File(actionsDirectory + group).mkdirs();
165 162
 
@@ -246,8 +243,8 @@ public class Action extends ActionModel implements ConfigChangeListener {
246 243
     }
247 244
 
248 245
     /**
249
-     * Checks to see if this action contains group meta-data, and adds it to
250
-     * the group as appropriate.
246
+     * Checks to see if this action contains group meta-data, and adds it to the group as
247
+     * appropriate.
251 248
      */
252 249
     private void checkMetaData() {
253 250
         if (config.isKeyDomain(DOMAIN_METADATA)) {
@@ -296,6 +293,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
296 293
      * Loads a list of triggers with the specified names.
297 294
      *
298 295
      * @param newTriggers A list of trigger names
296
+     *
299 297
      * @return True if all triggers are valid and compatible, false otherwise.
300 298
      */
301 299
     private boolean loadTriggers(final List<String> newTriggers) {
@@ -410,6 +408,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
410 408
      * Reads a condition from the specified configuration section.
411 409
      *
412 410
      * @param data The relevant section of the action configuration
411
+     *
413 412
      * @return True if the condition is valid, false otherwise
414 413
      */
415 414
     private boolean readCondition(final Map<String, String> data) {
@@ -460,7 +459,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
460 459
         }
461 460
 
462 461
         if ((arg != -1 && !comparison.appliesTo().equals(component.getType()))
463
-            || (arg == -1 && !comparison.appliesTo().equals(String.class))) {
462
+                || (arg == -1 && !comparison.appliesTo().equals(String.class))) {
464 463
             error(ActionErrorType.CONDITIONS,
465 464
                     "Comparison cannot be applied to specified component: " + data.get("comparison"));
466 465
             return false;
@@ -488,9 +487,9 @@ public class Action extends ActionModel implements ConfigChangeListener {
488 487
      * Reads a component from the specified data section for the specified argument.
489 488
      *
490 489
      * @param data The relevant section of the action configuration
491
-     * @param arg The argument number that the component should apply to
492
-     * @return The corresponding ActionComponent, or null if the specified
493
-     * component is invalid.
490
+     * @param arg  The argument number that the component should apply to
491
+     *
492
+     * @return The corresponding ActionComponent, or null if the specified component is invalid.
494 493
      */
495 494
     private ActionComponent readComponent(final Map<String, String> data, final int arg) {
496 495
         final String componentName = data.get("component");
@@ -525,7 +524,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
525 524
     /**
526 525
      * Raises a trivial error, informing the user of the problem.
527 526
      *
528
-     * @param type The type of error that occurred.
527
+     * @param type    The type of error that occurred.
529 528
      * @param message The message to be raised
530 529
      */
531 530
     private void error(final ActionErrorType type, final String message) {

+ 7
- 8
src/com/dmdirc/actions/ActionComponentChain.java View File

@@ -32,8 +32,7 @@ import java.util.List;
32 32
 import static com.google.common.base.Preconditions.checkArgument;
33 33
 
34 34
 /**
35
- * An action component chain supports chaining of multiple action components
36
- * together.
35
+ * An action component chain supports chaining of multiple action components together.
37 36
  */
38 37
 public class ActionComponentChain implements ActionComponent {
39 38
 
@@ -43,11 +42,11 @@ public class ActionComponentChain implements ActionComponent {
43 42
     private final List<ActionComponent> components = new ArrayList<>();
44 43
 
45 44
     /**
46
-     * Creates a new component chain from the specified text representation.
47
-     * Chains are separated with full stops (.).
45
+     * Creates a new component chain from the specified text representation. Chains are separated
46
+     * with full stops (.).
48 47
      *
49
-     * @param source The class that this chain needs to start with
50
-     * @param chain The textual representation of the chain
48
+     * @param source  The class that this chain needs to start with
49
+     * @param chain   The textual representation of the chain
51 50
      * @param manager The action manager to use to look up components
52 51
      */
53 52
     public ActionComponentChain(final Class<?> source, final String chain,
@@ -143,8 +142,8 @@ public class ActionComponentChain implements ActionComponent {
143 142
     }
144 143
 
145 144
     /**
146
-     * Determines if any components in this chain require a server to have
147
-     * an established connection in order to function.
145
+     * Determines if any components in this chain require a server to have an established connection
146
+     * in order to function.
148 147
      *
149 148
      * @since 0.6.4
150 149
      * @return True iff at least one component requires a connection

+ 11
- 13
src/com/dmdirc/actions/ActionCondition.java View File

@@ -32,27 +32,23 @@ public class ActionCondition {
32 32
 
33 33
     /** The argument number that this action condition applies to. */
34 34
     private int arg;
35
-
36 35
     /** The component that this action condition applies to. */
37 36
     private ActionComponent component;
38
-
39 37
     /** The comparison that should be used for this condition. */
40 38
     private ActionComparison comparison;
41
-
42 39
     /** The target of the comparison for this condition. */
43 40
     private String target = "";
44
-
45 41
     /** The source target for this comparison. */
46 42
     private String starget = "";
47 43
 
48 44
     /**
49
-     * Creates a new instance of ActionCondition that compares the output of
50
-     * a component to a string.
45
+     * Creates a new instance of ActionCondition that compares the output of a component to a
46
+     * string.
51 47
      *
52
-     * @param arg The argument number to be tested
53
-     * @param component The component to be tested
48
+     * @param arg        The argument number to be tested
49
+     * @param component  The component to be tested
54 50
      * @param comparison The comparison to be used
55
-     * @param target The target of the comparison
51
+     * @param target     The target of the comparison
56 52
      */
57 53
     public ActionCondition(final int arg, final ActionComponent component,
58 54
             final ActionComparison comparison, final String target) {
@@ -67,9 +63,9 @@ public class ActionCondition {
67 63
     /**
68 64
      * Creates a new instance of ActionCondition that compares two strings.
69 65
      *
70
-     * @param starget The first target for comparison.
66
+     * @param starget    The first target for comparison.
71 67
      * @param comparison The comparison to be used
72
-     * @param target The second target for the comparison
68
+     * @param target     The second target for the comparison
73 69
      */
74 70
     public ActionCondition(final String starget, final ActionComparison comparison,
75 71
             final String target) {
@@ -84,11 +80,12 @@ public class ActionCondition {
84 80
     /**
85 81
      * Tests to see if this condition holds.
86 82
      *
87
-     * @param sub The substitutor to use for this
83
+     * @param sub  The substitutor to use for this
88 84
      * @param args The event arguments to be tested
85
+     *
89 86
      * @return True if the condition holds, false otherwise
90 87
      */
91
-    public boolean test(final ActionSubstitutor sub, final Object ... args) {
88
+    public boolean test(final ActionSubstitutor sub, final Object... args) {
92 89
         final String thisTarget = sub.doSubstitution(getTarget(), args);
93 90
 
94 91
         if (arg == -1) {
@@ -164,6 +161,7 @@ public class ActionCondition {
164 161
 
165 162
     /**
166 163
      * Sets the target of the comparison for this condition.
164
+     *
167 165
      * @param target Target for comparison
168 166
      */
169 167
     public void setTarget(final String target) {

+ 0
- 4
src/com/dmdirc/actions/ActionErrorType.java View File

@@ -31,16 +31,12 @@ public enum ActionErrorType {
31 31
 
32 32
     /** A low-level problem occurred trying to read the action's file. */
33 33
     FILE,
34
-
35 34
     /** A problem with the action's triggers. */
36 35
     TRIGGERS,
37
-
38 36
     /** A problem with the action's response. */
39 37
     RESPONSE,
40
-
41 38
     /** A problem with the action's condition tree. */
42 39
     CONDITION_TREE,
43
-
44 40
     /** A problem with the action's conditions. */
45 41
     CONDITIONS;
46 42
 

+ 18
- 16
src/com/dmdirc/actions/ActionFactory.java View File

@@ -55,11 +55,12 @@ public class ActionFactory {
55 55
     /**
56 56
      * Creates a new instance of {@link ActionFactory}.
57 57
      *
58
-     * @param actionController The controller that will own actions.
59
-     * @param identityController The controller to use to retrieve and update settings.
60
-     * @param globalCommandParserProvider The global command parser to use for actions without windows.
61
-     * @param substitutorFactory The factory to use to create substitutors.
62
-     * @param actionsDirectory The base directory to store actions in.
58
+     * @param actionController            The controller that will own actions.
59
+     * @param identityController          The controller to use to retrieve and update settings.
60
+     * @param globalCommandParserProvider The global command parser to use for actions without
61
+     *                                    windows.
62
+     * @param substitutorFactory          The factory to use to create substitutors.
63
+     * @param actionsDirectory            The base directory to store actions in.
63 64
      */
64 65
     @Inject
65 66
     public ActionFactory(
@@ -76,11 +77,12 @@ public class ActionFactory {
76 77
     }
77 78
 
78 79
     /**
79
-     * Creates a new instance of Action. The group and name specified must
80
-     * be the group and name of a valid action already saved to disk.
80
+     * Creates a new instance of Action. The group and name specified must be the group and name of
81
+     * a valid action already saved to disk.
81 82
      *
82 83
      * @param group The group the action belongs to
83
-     * @param name The name of the action
84
+     * @param name  The name of the action
85
+     *
84 86
      * @return A relevant action.
85 87
      */
86 88
     public Action getAction(final String group, final String name) {
@@ -89,16 +91,16 @@ public class ActionFactory {
89 91
     }
90 92
 
91 93
     /**
92
-     * Creates a new instance of Action with the specified properties and saves
93
-     * it to disk.
94
+     * Creates a new instance of Action with the specified properties and saves it to disk.
94 95
      *
95
-     * @param group The group the action belongs to
96
-     * @param name The name of the action
97
-     * @param triggers The triggers to use
98
-     * @param response The response to use
99
-     * @param conditions The conditions to use
96
+     * @param group         The group the action belongs to
97
+     * @param name          The name of the action
98
+     * @param triggers      The triggers to use
99
+     * @param response      The response to use
100
+     * @param conditions    The conditions to use
100 101
      * @param conditionTree The condition tree to use
101
-     * @param newFormat The new formatter to use
102
+     * @param newFormat     The new formatter to use
103
+     *
102 104
      * @return A relevant action.
103 105
      */
104 106
     public Action getAction(final String group, final String name,

+ 7
- 12
src/com/dmdirc/actions/ActionGroup.java View File

@@ -41,30 +41,23 @@ import static com.google.common.base.Preconditions.checkNotNull;
41 41
 public class ActionGroup implements Iterable<Action> {
42 42
 
43 43
     /**
44
-     * A version number for this class. It should be changed whenever the class
45
-     * structure is changed (or anything else that would prevent serialized
46
-     * objects being unserialized with the new class).
44
+     * A version number for this class. It should be changed whenever the class structure is changed
45
+     * (or anything else that would prevent serialized objects being unserialized with the new
46
+     * class).
47 47
      */
48 48
     private static final long serialVersionUID = 1;
49
-
50 49
     /** The actions in this group. */
51 50
     private final List<Action> actions = new ArrayList<>();
52
-
53 51
     /** The name of this action group. */
54 52
     private final String name;
55
-
56 53
     /** The description of this action group. */
57 54
     private String description;
58
-
59 55
     /** The author of this action group. */
60 56
     private String author;
61
-
62 57
     /** The component number of this action group (for updating). */
63 58
     private int component = -1;
64
-
65 59
     /** The version of this action group. */
66 60
     private Version version;
67
-
68 61
     /** A list of settings used by this action group. */
69 62
     private final Map<String, PreferencesSetting> settings = new HashMap<>();
70 63
 
@@ -137,6 +130,7 @@ public class ActionGroup implements Iterable<Action> {
137 130
      * Retrieves the version number of this action group.
138 131
      *
139 132
      * @return This action group's version number, or null if none is specified.
133
+     *
140 134
      * @since 0.6.4
141 135
      */
142 136
     public Version getVersion() {
@@ -147,6 +141,7 @@ public class ActionGroup implements Iterable<Action> {
147 141
      * Sets the version of this action group.
148 142
      *
149 143
      * @param version This action group's new version.
144
+     *
150 145
      * @since 0.6.4
151 146
      */
152 147
     public void setVersion(final Version version) {
@@ -156,8 +151,7 @@ public class ActionGroup implements Iterable<Action> {
156 151
     /**
157 152
      * Retrieves the addon site component number for this action group.
158 153
      *
159
-     * @return The component number for this action group, or -1 if none is
160
-     * specified.
154
+     * @return The component number for this action group, or -1 if none is specified.
161 155
      */
162 156
     public int getComponent() {
163 157
         return component;
@@ -224,6 +218,7 @@ public class ActionGroup implements Iterable<Action> {
224 218
      * Deletes an action from this group.
225 219
      *
226 220
      * @param action The action to be deleted
221
+     *
227 222
      * @since 0.6.3
228 223
      */
229 224
     @Precondition({

+ 31
- 41
src/com/dmdirc/actions/ActionManager.java View File

@@ -51,6 +51,7 @@ import java.util.Set;
51 51
 import javax.inject.Provider;
52 52
 
53 53
 import org.slf4j.LoggerFactory;
54
+
54 55
 import static com.google.common.base.Preconditions.checkArgument;
55 56
 import static com.google.common.base.Preconditions.checkNotNull;
56 57
 
@@ -59,66 +60,50 @@ import static com.google.common.base.Preconditions.checkNotNull;
59 60
  */
60 61
 public class ActionManager implements ActionController {
61 62
 
62
-    private static final org.slf4j.Logger log = LoggerFactory.getLogger(ActionManager.class);
63
-
63
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(ActionManager.class);
64 64
     /** The ActionManager Instance. */
65 65
     private static ActionManager me;
66
-
67 66
     /** The identity manager to load configuration from. */
68 67
     private final IdentityController identityManager;
69
-
70 68
     /** The ServerManager currently in use. */
71 69
     private final ServerManager serverManager;
72
-
73 70
     /** The factory to use to create actions. */
74 71
     private final ActionFactory factory;
75
-
76 72
     /** Provider for action wrappers. */
77 73
     private final Provider<Set<ActionGroup>> actionWrappersProvider;
78
-
79 74
     /** Provider of an update manager. */
80 75
     private final Provider<UpdateManager> updateManagerProvider;
81
-
82 76
     /** A list of registered action types. */
83 77
     private final List<ActionType> types = new ArrayList<>();
84
-
85 78
     /** A list of registered action components. */
86 79
     private final List<ActionComponent> components = new ArrayList<>();
87
-
88 80
     /** A list of registered action comparisons. */
89 81
     private final List<ActionComparison> comparisons = new ArrayList<>();
90
-
91 82
     /** A map linking types and a list of actions that're registered for them. */
92 83
     private final MapList<ActionType, Action> actions = new MapList<>();
93
-
94 84
     /** A map linking groups and a list of actions that're in them. */
95 85
     private final Map<String, ActionGroup> groups = new HashMap<>();
96
-
97 86
     /** A map of objects to synchronise on for concurrency groups. */
98 87
     private final Map<String, Object> locks = new HashMap<>();
99
-
100 88
     /** A map of the action type groups to the action types within. */
101 89
     private final MapList<String, ActionType> typeGroups = new MapList<>();
102
-
103 90
     /** The listeners that we have registered. */
104 91
     private final MapList<ActionType, ActionListener> listeners = new MapList<>();
105
-
106 92
     /** The directory to load and save actions in. */
107 93
     private final String directory;
108
-
109 94
     /** Indicates whether or not user actions should be killed (not processed). */
110
-    @ConfigBinding(domain="actions", key="killswitch")
95
+    @ConfigBinding(domain = "actions", key = "killswitch")
111 96
     private boolean killSwitch;
112 97
 
113 98
     /**
114 99
      * Creates a new instance of ActionManager.
115 100
      *
116
-     * @param serverManager The ServerManager in use.
117
-     * @param identityManager The IdentityManager to load configuration from.
118
-     * @param factory The factory to use to create new actions.
101
+     * @param serverManager          The ServerManager in use.
102
+     * @param identityManager        The IdentityManager to load configuration from.
103
+     * @param factory                The factory to use to create new actions.
119 104
      * @param actionWrappersProvider Provider of action wrappers.
120
-     * @param updateManagerProvider Provider of an update manager, to register components.
121
-     * @param directory The directory to load and save actions in.
105
+     * @param updateManagerProvider  Provider of an update manager, to register components.
106
+     * @param directory              The directory to load and save actions in.
122 107
      */
123 108
     public ActionManager(
124 109
             final ServerManager serverManager,
@@ -148,6 +133,8 @@ public class ActionManager implements ActionController {
148 133
      * Create the singleton instance of the Action Manager.
149 134
      *
150 135
      * @param actionManager The manager to return for calls to {@link #getActionManager()}.
136
+     *
137
+     * @deprecated Singleton use should be removed.
151 138
      */
152 139
     @Deprecated
153 140
     public static void setActionManager(final ActionManager actionManager) {
@@ -170,7 +157,7 @@ public class ActionManager implements ActionController {
170 157
      */
171 158
     // TODO: Refactor to take a list of comparisons/sources.
172 159
     public void initialise(final ColourActionComparison colourComparisons) {
173
-        log.info("Initialising the actions manager");
160
+        LOG.info("Initialising the actions manager");
174 161
 
175 162
         identityManager.getGlobalConfiguration().getBinder().bind(this, ActionManager.class);
176 163
 
@@ -209,7 +196,7 @@ public class ActionManager implements ActionController {
209 196
     /** {@inheritDoc} */
210 197
     @Override
211 198
     public void registerSetting(final String name, final String value) {
212
-        log.debug("Registering new action setting: {} = {}", name, value);
199
+        LOG.debug("Registering new action setting: {} = {}", name, value);
213 200
         identityManager.getAddonSettings().setOption("actions", name, value);
214 201
     }
215 202
 
@@ -226,7 +213,7 @@ public class ActionManager implements ActionController {
226 213
             checkNotNull(type);
227 214
 
228 215
             if (!types.contains(type)) {
229
-                log.debug("Registering action type: {}", type);
216
+                LOG.debug("Registering action type: {}", type);
230 217
                 types.add(type);
231 218
                 typeGroups.add(type.getType().getGroup(), type);
232 219
             }
@@ -239,7 +226,7 @@ public class ActionManager implements ActionController {
239 226
         for (ActionComponent comp : comps) {
240 227
             checkNotNull(comp);
241 228
 
242
-            log.debug("Registering action component: {}", comp);
229
+            LOG.debug("Registering action component: {}", comp);
243 230
             components.add(comp);
244 231
         }
245 232
     }
@@ -250,7 +237,7 @@ public class ActionManager implements ActionController {
250 237
         for (ActionComparison comp : comps) {
251 238
             checkNotNull(comp);
252 239
 
253
-            log.debug("Registering action comparison: {}", comp);
240
+            LOG.debug("Registering action comparison: {}", comp);
254 241
             comparisons.add(comp);
255 242
         }
256 243
     }
@@ -324,7 +311,7 @@ public class ActionManager implements ActionController {
324 311
         checkNotNull(dir);
325 312
         checkArgument(dir.isDirectory());
326 313
 
327
-        log.debug("Loading actions from directory: {}", dir.getAbsolutePath());
314
+        LOG.debug("Loading actions from directory: {}", dir.getAbsolutePath());
328 315
 
329 316
         if (!groups.containsKey(dir.getName())) {
330 317
             groups.put(dir.getName(), new ActionGroup(dir.getName()));
@@ -340,12 +327,12 @@ public class ActionManager implements ActionController {
340 327
     public void addAction(final Action action) {
341 328
         checkNotNull(action);
342 329
 
343
-        log.debug("Registering action: {}/{} (status: {})",
344
-                new Object[] { action.getGroup(), action.getName(), action.getStatus() });
330
+        LOG.debug("Registering action: {}/{} (status: {})",
331
+                new Object[]{action.getGroup(), action.getName(), action.getStatus()});
345 332
 
346 333
         if (action.getStatus() != ActionStatus.FAILED) {
347 334
             for (ActionType trigger : action.getTriggers()) {
348
-                log.trace("Action has trigger {}", trigger);
335
+                LOG.trace("Action has trigger {}", trigger);
349 336
                 actions.add(trigger, action);
350 337
             }
351 338
         }
@@ -382,12 +369,12 @@ public class ActionManager implements ActionController {
382 369
     /** {@inheritDoc} */
383 370
     @Override
384 371
     public boolean triggerEvent(final ActionType type,
385
-            final StringBuffer format, final Object ... arguments) {
372
+            final StringBuffer format, final Object... arguments) {
386 373
         checkNotNull(type);
387 374
         checkNotNull(type.getType());
388 375
         checkArgument(type.getType().getArity() == arguments.length);
389 376
 
390
-        log.trace("Calling listeners for event of type {}", type);
377
+        LOG.trace("Calling listeners for event of type {}", type);
391 378
 
392 379
         boolean res = false;
393 380
 
@@ -412,20 +399,21 @@ public class ActionManager implements ActionController {
412 399
     /**
413 400
      * Triggers actions that respond to the specified type.
414 401
      *
415
-     * @param type The type of the event to process
416
-     * @param format The format of the message that's going to be displayed for
417
-     * the event. Actions may change this format.
402
+     * @param type      The type of the event to process
403
+     * @param format    The format of the message that's going to be displayed for the event.
404
+     *                  Actions may change this format.
418 405
      * @param arguments The arguments for the event
406
+     *
419 407
      * @return True if the event should be skipped, or false if it can continue
420 408
      */
421 409
     @Precondition("The specified ActionType is not null")
422 410
     private boolean triggerActions(final ActionType type,
423
-            final StringBuffer format, final Object ... arguments) {
411
+            final StringBuffer format, final Object... arguments) {
424 412
         checkNotNull(type);
425 413
 
426 414
         boolean res = false;
427 415
 
428
-        log.trace("Executing actions for event of type {}", type);
416
+        LOG.trace("Executing actions for event of type {}", type);
429 417
 
430 418
         if (actions.containsKey(type)) {
431 419
             for (Action action : new ArrayList<>(actions.get(type))) {
@@ -620,6 +608,7 @@ public class ActionManager implements ActionController {
620 608
      * Installs an action pack located at the specified path.
621 609
      *
622 610
      * @param path The full path of the action pack .zip.
611
+     *
623 612
      * @throws IOException If the zip cannot be extracted
624 613
      */
625 614
     public static void installActionPack(final String path) throws IOException {
@@ -634,7 +623,7 @@ public class ActionManager implements ActionController {
634 623
 
635 624
     /** {@inheritDoc} */
636 625
     @Override
637
-    public void registerListener(final ActionListener listener, final ActionType ... types) {
626
+    public void registerListener(final ActionListener listener, final ActionType... types) {
638 627
         for (ActionType type : types) {
639 628
             listeners.add(type, listener);
640 629
         }
@@ -642,7 +631,7 @@ public class ActionManager implements ActionController {
642 631
 
643 632
     /** {@inheritDoc} */
644 633
     @Override
645
-    public void unregisterListener(final ActionListener listener, final ActionType ... types) {
634
+    public void unregisterListener(final ActionListener listener, final ActionType... types) {
646 635
         for (ActionType type : types) {
647 636
             listeners.remove(type, listener);
648 637
         }
@@ -653,4 +642,5 @@ public class ActionManager implements ActionController {
653 642
     public void unregisterListener(final ActionListener listener) {
654 643
         listeners.removeFromAll(listener);
655 644
     }
645
+
656 646
 }

+ 39
- 51
src/com/dmdirc/actions/ActionModel.java View File

@@ -36,53 +36,39 @@ import java.util.List;
36 36
 import javax.inject.Provider;
37 37
 
38 38
 /**
39
- * Represents the basic model of an action, and its triggering mechanism.
40
- * Saving and loading are handled by the Action class.
39
+ * Represents the basic model of an action, and its triggering mechanism. Saving and loading are
40
+ * handled by the Action class.
41 41
  */
42 42
 public class ActionModel {
43 43
 
44 44
     /** Provider of global command parsers, for use when triggering window-less actions. */
45 45
     private final Provider<GlobalCommandParser> globalCommandParserProvider;
46
-
47 46
     /** Factory to use to creator substitutors. */
48 47
     private final ActionSubstitutorFactory substitutorFactory;
49
-
50 48
     /** The group this action belongs to. */
51 49
     protected String group;
52
-
53 50
     /** The name of this action. */
54 51
     protected String name;
55
-
56 52
     /** The ActionTypes that trigger this action. */
57 53
     protected ActionType[] triggers;
58
-
59 54
     /** The commands to execute if this action is triggered. */
60 55
     protected String[] response;
61
-
62 56
     /** The change that should be made to the format string, if any. */
63 57
     protected String newFormat;
64
-
65 58
     /** The conditions for this action. */
66 59
     protected List<ActionCondition> conditions = new ArrayList<>();
67
-
68 60
     /** The condition tree used for evaluating conditions. */
69 61
     protected ConditionTree conditionTree;
70
-
71 62
     /** Whether this action has been modified or not. */
72 63
     protected boolean modified;
73
-
74 64
     /** Whether this action wishes the event to be stopped. */
75 65
     protected boolean stop;
76
-
77 66
     /** The concurrency group this action belongs to, if any. */
78 67
     protected String concurrencyGroup;
79
-
80 68
     /** The status of this action. */
81 69
     protected ActionStatus status = ActionStatus.ACTIVE;
82
-
83 70
     /** A description of any error that occurs while creating the action. */
84 71
     protected String error;
85
-
86 72
     /** The type of error that occurred, if any. */
87 73
     protected ActionErrorType errorType;
88 74
 
@@ -90,9 +76,9 @@ public class ActionModel {
90 76
      * Creates a new instance of ActionModel with the specified properties.
91 77
      *
92 78
      * @param globalCommandParserProvider Provider of global command parsers for triggering actions.
93
-     * @param substitutorFactory Factory to use to create action substitutors.
94
-     * @param group The group the action belongs to
95
-     * @param name The name of the action
79
+     * @param substitutorFactory          Factory to use to create action substitutors.
80
+     * @param group                       The group the action belongs to
81
+     * @param name                        The name of the action
96 82
      */
97 83
     public ActionModel(
98 84
             final Provider<GlobalCommandParser> globalCommandParserProvider,
@@ -109,14 +95,14 @@ public class ActionModel {
109 95
      * Creates a new instance of ActionModel with the specified properties.
110 96
      *
111 97
      * @param globalCommandParserProvider Provider of global command parsers for triggering actions.
112
-     * @param substitutorFactory Factory to use to create action substitutors.
113
-     * @param group The group the action belongs to
114
-     * @param name The name of the action
115
-     * @param triggers The triggers to use
116
-     * @param response The response to use
117
-     * @param conditions The conditions to use
118
-     * @param conditionTree The condition tree to use
119
-     * @param newFormat The new formatter to use
98
+     * @param substitutorFactory          Factory to use to create action substitutors.
99
+     * @param group                       The group the action belongs to
100
+     * @param name                        The name of the action
101
+     * @param triggers                    The triggers to use
102
+     * @param response                    The response to use
103
+     * @param conditions                  The conditions to use
104
+     * @param conditionTree               The condition tree to use
105
+     * @param newFormat                   The new formatter to use
120 106
      */
121 107
     public ActionModel(
122 108
             final Provider<GlobalCommandParser> globalCommandParserProvider,
@@ -138,10 +124,11 @@ public class ActionModel {
138 124
      * Triggers this action.
139 125
      *
140 126
      * @param serverManager The server manager used to iterate servers
141
-     * @param format The format of the message that's going to be displayed.
142
-     * @param arguments The arguments from the action that caused this trigger.
143
-     * @return True if the execution of the event should be stopped, or false
144
-     * if the event may continue
127
+     * @param format        The format of the message that's going to be displayed.
128
+     * @param arguments     The arguments from the action that caused this trigger.
129
+     *
130
+     * @return True if the execution of the event should be stopped, or false if the event may
131
+     *         continue
145 132
      */
146 133
     @Precondition({
147 134
         "This action has at least one trigger",
@@ -193,12 +180,13 @@ public class ActionModel {
193 180
     /**
194 181
      * Tests to see if this action should be triggered or not.
195 182
      *
196
-     * @param sub The ActionsSubstitutor to use to substitute args
183
+     * @param sub       The ActionsSubstitutor to use to substitute args
197 184
      * @param arguments The arguments for the action event
185
+     *
198 186
      * @return True if the action should be executed, false otherwise
199 187
      */
200 188
     public boolean test(final ActionSubstitutor sub,
201
-            final Object ... arguments) {
189
+            final Object... arguments) {
202 190
         final boolean[] results = new boolean[conditions.size()];
203 191
 
204 192
         int i = 0;
@@ -239,8 +227,7 @@ public class ActionModel {
239 227
     }
240 228
 
241 229
     /**
242
-     * Retrieves a plain text description of any error that occurred while
243
-     * loading this action.
230
+     * Retrieves a plain text description of any error that occurred while loading this action.
244 231
      *
245 232
      * @since 0.6.5
246 233
      * @return This action's error message, or null if no error was encountered
@@ -355,8 +342,8 @@ public class ActionModel {
355 342
     }
356 343
 
357 344
     /**
358
-     * Retrieves the condition tree used for this action. Condition trees may
359
-     * be null, in which case the arguments are conjoined together.
345
+     * Retrieves the condition tree used for this action. Condition trees may be null, in which case
346
+     * the arguments are conjoined together.
360 347
      *
361 348
      * @return This action's condition tree
362 349
      */
@@ -365,9 +352,8 @@ public class ActionModel {
365 352
     }
366 353
 
367 354
     /**
368
-     * Retrieves a concrete condition tree used for this action. If there is
369
-     * no condition tree defined for this action, returns a conjunction tree
370
-     * for the arguments.
355
+     * Retrieves a concrete condition tree used for this action. If there is no condition tree
356
+     * defined for this action, returns a conjunction tree for the arguments.
371 357
      *
372 358
      * @since 0.6
373 359
      * @return A {@link ConditionTree} object for this action
@@ -391,6 +377,7 @@ public class ActionModel {
391 377
      * Retrieves the concurrency group of this action.
392 378
      *
393 379
      * @return This action's concurrency group
380
+     *
394 381
      * @since 0.6.3
395 382
      */
396 383
     public String getConcurrencyGroup() {
@@ -401,6 +388,7 @@ public class ActionModel {
401 388
      * Sets the concurrency group of this action.
402 389
      *
403 390
      * @param concurrencyGroup This action's new concurrency group
391
+     *
404 392
      * @since 0.6.3
405 393
      */
406 394
     public void setConcurrencyGroup(final String concurrencyGroup) {
@@ -409,10 +397,10 @@ public class ActionModel {
409 397
     }
410 398
 
411 399
     /**
412
-     * Determines whether or not this action will stop the event execution
413
-     * if it is triggered.
400
+     * Determines whether or not this action will stop the event execution if it is triggered.
414 401
      *
415 402
      * @return The stopping preference of this action
403
+     *
416 404
      * @see #setStopping(boolean)
417 405
      * @since 0.6.4
418 406
      */
@@ -421,12 +409,12 @@ public class ActionModel {
421 409
     }
422 410
 
423 411
     /**
424
-     * Sets the stopping preference of this action. If the stopping preference
425
-     * is <code>true</code> then when this action is successfully triggered,
426
-     * it will request that execution of the event is stopped. This will
427
-     * prevent the default behaviour of the callee being executed.
412
+     * Sets the stopping preference of this action. If the stopping preference is {@code true} then
413
+     * when this action is successfully triggered,it will request that execution of the event is
414
+     * stopped. This will prevent the default behaviour of the callee being executed.
428 415
      *
429 416
      * @param stop The new stopping preference of this action
417
+     *
430 418
      * @see #isStopping()
431 419
      * @since 0.6.4
432 420
      */
@@ -435,8 +423,8 @@ public class ActionModel {
435 423
     }
436 424
 
437 425
     /**
438
-     * Determine if this model has been modified since it was constructed or
439
-     * its modified status was reset.
426
+     * Determine if this model has been modified since it was constructed or its modified status was
427
+     * reset.
440 428
      *
441 429
      * @return True if this model has been modified, false otherwise
442 430
      */
@@ -445,9 +433,8 @@ public class ActionModel {
445 433
     }
446 434
 
447 435
     /**
448
-     * Resets the modified status of this model. After a call to
449
-     * resetModified(), this model will report that it has not been modified,
450
-     * until one of the set* methods is used.
436
+     * Resets the modified status of this model. After a call to resetModified(), this model will
437
+     * report that it has not been modified, until one of the set* methods is used.
451 438
      */
452 439
     public void resetModified() {
453 440
         this.modified = false;
@@ -461,4 +448,5 @@ public class ActionModel {
461 448
                 + Arrays.toString(response) + ", "
462 449
                 + conditions + ", format='" + newFormat + "']";
463 450
     }
451
+
464 452
 }

+ 46
- 44
src/com/dmdirc/actions/ActionSubstitutor.java View File

@@ -58,7 +58,6 @@ public class ActionSubstitutor {
58 58
     private static final String ERR_NULL_CHAIN = "null_component";
59 59
     /** Substitution to use to replace subs with illegal components. */
60 60
     private static final String ERR_ILLEGAL_COMPONENT = "illegal_component";
61
-
62 61
     /** Pattern used to match braced substitutions. */
63 62
     private static final Pattern BRACES_PATTERN = Pattern.compile("(?<!\\\\)((?:\\\\\\\\)*)"
64 63
             + "(\\$\\{([^{}]*?)\\})");
@@ -71,10 +70,10 @@ public class ActionSubstitutor {
71 70
     /** Pattern to determine if a substitution is a word number type. */
72 71
     private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)(-([0-9]+)?)?");
73 72
     /** Pattern to determine if a substitution is an argument+component type. */
74
-    private static final Pattern COMP_PATTERN = Pattern.compile("([0-9]+)\\.([A-Z_]+(\\.[A-Z_]+)*)");
73
+    private static final Pattern COMP_PATTERN =
74
+            Pattern.compile("([0-9]+)\\.([A-Z_]+(\\.[A-Z_]+)*)");
75 75
     /** Pattern to determine if a substitution is a server component type. */
76 76
     private static final Pattern SERVER_PATTERN = Pattern.compile("[A-Z_]+(\\.[A-Z_]+)*");
77
-
78 77
     /** The action controller to use to find components. */
79 78
     private final ActionController actionController;
80 79
     /** The global config to read settings from. */
@@ -87,15 +86,16 @@ public class ActionSubstitutor {
87 86
     /**
88 87
      * Creates a new substitutor for the specified action type.
89 88
      *
90
-     * @param actionController The action controller to use to find components.
89
+     * @param actionController  The action controller to use to find components.
91 90
      * @param commandController The command controller to use when building command arguments.
92
-     * @param globalConfig The global config to read settings from.
93
-     * @param type The action type this substitutor is for
91
+     * @param globalConfig      The global config to read settings from.
92
+     * @param type              The action type this substitutor is for
94 93
      */
95 94
     public ActionSubstitutor(
96 95
             final ActionController actionController,
97 96
             final CommandController commandController,
98
-            @SuppressWarnings("qualifiers") @GlobalConfig final AggregateConfigProvider globalConfig,
97
+            @SuppressWarnings("qualifiers") @GlobalConfig
98
+            final AggregateConfigProvider globalConfig,
99 99
             @Unbound final ActionType type) {
100 100
         this.actionController = actionController;
101 101
         this.globalConfig = globalConfig;
@@ -104,8 +104,8 @@ public class ActionSubstitutor {
104 104
     }
105 105
 
106 106
     /**
107
-     * Retrieves a list of global config variables that will be substituted.
108
-     * Note: does not include initial $.
107
+     * Retrieves a list of global config variables that will be substituted. Note: does not include
108
+     * initial $.
109 109
      *
110 110
      * @return A list of global variable names that will be substituted
111 111
      */
@@ -114,9 +114,8 @@ public class ActionSubstitutor {
114 114
     }
115 115
 
116 116
     /**
117
-     * Retrieves a list of substitutions derived from argument and component
118
-     * combinations, along with a corresponding friendly name for them.
119
-     * Note: does not include initial $.
117
+     * Retrieves a list of substitutions derived from argument and component combinations, along
118
+     * with a corresponding friendly name for them. Note: does not include initial $.
120 119
      *
121 120
      * @return A map of component substitution names and their descriptions
122 121
      */
@@ -139,9 +138,8 @@ public class ActionSubstitutor {
139 138
     }
140 139
 
141 140
     /**
142
-     * Retrieves a list of server substitutions, if this action type supports
143
-     * them.
144
-     * Note: does not include initial $.
141
+     * Retrieves a list of server substitutions, if this action type supports them. Note: does not
142
+     * include initial $.
145 143
      *
146 144
      * @return A map of server substitution names and their descriptions.
147 145
      */
@@ -149,7 +147,8 @@ public class ActionSubstitutor {
149 147
         final Map<String, String> res = new HashMap<>();
150 148
 
151 149
         if (hasFrameContainer()) {
152
-            for (ActionComponent comp : actionController.findCompatibleComponents(Connection.class)) {
150
+            for (ActionComponent comp : actionController
151
+                    .findCompatibleComponents(Connection.class)) {
153 152
                 final String key = "{" + comp.toString() + "}";
154 153
                 final String desc = "The connection's " + comp.getName();
155 154
 
@@ -161,8 +160,7 @@ public class ActionSubstitutor {
161 160
     }
162 161
 
163 162
     /**
164
-     * Returns true if this action type's first argument is a frame container,
165
-     * or descendent of one.
163
+     * Returns true if this action type's first argument is a frame container, or descendent of one.
166 164
      *
167 165
      * @return True if this action type's first arg extends or is a FrameContainer
168 166
      */
@@ -181,8 +179,8 @@ public class ActionSubstitutor {
181 179
     }
182 180
 
183 181
     /**
184
-     * Determines whether or not word substitutions will work for this action
185
-     * type. Word substitutions take the form $1, $1-5, $6-, etc.
182
+     * Determines whether or not word substitutions will work for this action type. Word
183
+     * substitutions take the form $1, $1-5, $6-, etc.
186 184
      *
187 185
      * @return True if word substitutions are supported, false otherwise.
188 186
      */
@@ -193,16 +191,16 @@ public class ActionSubstitutor {
193 191
     }
194 192
 
195 193
     /**
196
-     * Performs all applicable substitutions on the specified string, with the
197
-     * specified arguments.
194
+     * Performs all applicable substitutions on the specified string, with the specified arguments.
198 195
      *
199 196
      * @param target The string to be altered
200
-     * @param args The arguments for the action type
197
+     * @param args   The arguments for the action type
198
+     *
201 199
      * @return The substituted string
202 200
      */
203 201
     @Precondition("Number of arguments given equals the number of arguments "
204
-    + "required by this substitutor's type")
205
-    public String doSubstitution(final String target, final Object ... args) {
202
+            + "required by this substitutor's type")
203
+    public String doSubstitution(final String target, final Object... args) {
206 204
         if (type.getType().getArity() != args.length) {
207 205
             throw new IllegalArgumentException("Invalid number of arguments "
208 206
                     + "for doSubstitution: expected " + type.getType().getArity() + ", got "
@@ -237,10 +235,11 @@ public class ActionSubstitutor {
237 235
      * Retrieves the value which should be used for the specified substitution.
238 236
      *
239 237
      * @param substitution The substitution, without leading $
240
-     * @param args The arguments for the action
238
+     * @param args         The arguments for the action
239
+     *
241 240
      * @return The substitution to be used
242 241
      */
243
-    private String getSubstitution(final String substitution, final Object ... args) {
242
+    private String getSubstitution(final String substitution, final Object... args) {
244 243
         final Matcher numberMatcher = NUMBER_PATTERN.matcher(substitution);
245 244
         final Matcher compMatcher = COMP_PATTERN.matcher(substitution);
246 245
         final Matcher serverMatcher = SERVER_PATTERN.matcher(substitution);
@@ -289,7 +288,7 @@ public class ActionSubstitutor {
289 288
             if (connection != null) {
290 289
                 try {
291 290
                     final ActionComponentChain chain = new ActionComponentChain(
292
-                        Connection.class, substitution, actionController);
291
+                            Connection.class, substitution, actionController);
293 292
                     return escape(checkConnection(chain, args, connection));
294 293
                 } catch (IllegalArgumentException ex) {
295 294
                     return ERR_ILLEGAL_COMPONENT;
@@ -301,23 +300,23 @@ public class ActionSubstitutor {
301 300
     }
302 301
 
303 302
     /**
304
-     * Checks the connection status of any server associated with the specified
305
-     * arguments. If the specified component chain requires a server with an
306
-     * established connection and no such server is present, this method
307
-     * returns the string <code>not_connected</code> without attempting to
303
+     * Checks the connection status of any server associated with the specified arguments. If the
304
+     * specified component chain requires a server with an established connection and no such server
305
+     * is present, this method returns the string {@code not_connected} without attempting to
308 306
      * evaluate any components in the chain.
309 307
      *
310 308
      * @since 0.6.4
311
-     * @param chain The chain to be checked
312
-     * @param args The arguments for this invocation
309
+     * @param chain    The chain to be checked
310
+     * @param args     The arguments for this invocation
313 311
      * @param argument The argument used as a base for the chain
312
+     *
314 313
      * @return The value of the evaluated chain, or <code>not_connected</code>
315 314
      */
316 315
     protected String checkConnection(final ActionComponentChain chain,
317 316
             final Object[] args, final Object argument) {
318 317
         if ((chain.requiresConnection() && args[0] instanceof FrameContainer
319
-                    && ((FrameContainer) args[0]).getConnection().getState()
320
-                    == ServerState.CONNECTED) || !chain.requiresConnection()) {
318
+                && ((FrameContainer) args[0]).getConnection().getState()
319
+                == ServerState.CONNECTED) || !chain.requiresConnection()) {
321 320
             final Object res = chain.get(argument);
322 321
             return res == null ? ERR_NULL_CHAIN : res.toString();
323 322
         }
@@ -326,16 +325,17 @@ public class ActionSubstitutor {
326 325
     }
327 326
 
328 327
     /**
329
-     * Tries to retrieve an appropriate configuration manager from the
330
-     * specified set of arguments. If any of the arguments is an instance of
331
-     * {@link FrameContainer} or {@link Window}, the config manager is
332
-     * requested from them. Otherwise, the global config is returned.
328
+     * Tries to retrieve an appropriate configuration manager from the specified set of arguments.
329
+     * If any of the arguments is an instance of {@link FrameContainer} or {@link Window}, the
330
+     * config manager is requested from them. Otherwise, the global config is returned.
333 331
      *
334 332
      * @param args The arguments to be tested
333
+     *
335 334
      * @return The best config manager to use for those arguments
335
+     *
336 336
      * @since 0.6.3m2
337 337
      */
338
-    protected AggregateConfigProvider getConfigManager(final Object ... args) {
338
+    protected AggregateConfigProvider getConfigManager(final Object... args) {
339 339
         for (Object arg : args) {
340 340
             if (arg instanceof FrameContainer) {
341 341
                 return ((FrameContainer) arg).getConfigManager();
@@ -348,12 +348,14 @@ public class ActionSubstitutor {
348 348
     }
349 349
 
350 350
     /**
351
-     * Escapes all special characters in the specified input. This will result
352
-     * in the input being treated as a plain string when passed through the
353
-     * substitutor (i.e., no substitutions will occur).
351
+     * Escapes all special characters in the specified input. This will result in the input being
352
+     * treated as a plain string when passed through the substitutor (i.e., no substitutions will
353
+     * occur).
354 354
      *
355 355
      * @param input The string to be escaped
356
+     *
356 357
      * @return An escaped version of the specified string
358
+     *
357 359
      * @since 0.6.4
358 360
      */
359 361
     protected static String escape(final String input) {

+ 3
- 3
src/com/dmdirc/actions/ActionTypeComparator.java View File

@@ -33,9 +33,9 @@ import java.util.Comparator;
33 33
 public final class ActionTypeComparator implements Comparator<ActionType>, Serializable {
34 34
 
35 35
     /**
36
-     * A version number for this class. It should be changed whenever the class
37
-     * structure is changed (or anything else that would prevent serialized
38
-     * objects being unserialized with the new class).
36
+     * A version number for this class. It should be changed whenever the class structure is changed
37
+     * (or anything else that would prevent serialized objects being unserialized with the new
38
+     * class).
39 39
      */
40 40
     private static final long serialVersionUID = 1;
41 41
 

+ 25
- 6
src/com/dmdirc/actions/ColourActionComparison.java View File

@@ -59,47 +59,66 @@ public class ColourActionComparison {
59 59
      * @return The available comparisons.
60 60
      */
61 61
     public ActionComparison[] getComparisons() {
62
-        return new ActionComparison[] { equalsComparison, notEqualsComparison };
62
+        return new ActionComparison[]{equalsComparison, notEqualsComparison};
63 63
     }
64 64
 
65 65
     /** Checks if the colour is the same as another colour. */
66 66
     private class Equals implements ActionComparison {
67
+
67 68
         /** {@inheritDoc} */
68 69
         @Override
69 70
         public boolean test(final Object arg1, final Object arg2) {
70
-            return ((Colour) arg1).equals(colourManager.get().getColourFromString((String) arg2, null));
71
+            return ((Colour) arg1).equals(colourManager.get().getColourFromString((String) arg2,
72
+                    null));
71 73
         }
74
+
72 75
         /** {@inheritDoc} */
73 76
         @Override
74
-        public Class<?> appliesTo() { return Colour.class; }
77
+        public Class<?> appliesTo() {
78
+            return Colour.class;
79
+        }
80
+
75 81
         /** {@inheritDoc} */
76 82
         @Override
77
-        public String getName() { return "equals"; }
83
+        public String getName() {
84
+            return "equals";
85
+        }
86
+
78 87
         /** {@inheritDoc} */
79 88
         @Override
80 89
         public String name() {
81 90
             return "COLOUR_EQUALS";
82 91
         }
92
+
83 93
     }
84 94
 
85 95
     /** Checks if the colour is not the same as another colour. */
86 96
     private class NotEquals implements ActionComparison {
97
+
87 98
         /** {@inheritDoc} */
88 99
         @Override
89 100
         public boolean test(final Object arg1, final Object arg2) {
90 101
             return !equalsComparison.test(arg1, arg2);
91 102
         }
103
+
92 104
         /** {@inheritDoc} */
93 105
         @Override
94
-        public Class<?> appliesTo() { return Colour.class; }
106
+        public Class<?> appliesTo() {
107
+            return Colour.class;
108
+        }
109
+
95 110
         /** {@inheritDoc} */
96 111
         @Override
97
-        public String getName() { return "does not equal"; }
112
+        public String getName() {
113
+            return "does not equal";
114
+        }
115
+
98 116
         /** {@inheritDoc} */
99 117
         @Override
100 118
         public String name() {
101 119
             return "COLOUR_NEQUALS";
102 120
         }
121
+
103 122
     }
104 123
 
105 124
 }

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

@@ -26,13 +26,13 @@ import java.util.ArrayDeque;
26 26
 import java.util.Deque;
27 27
 
28 28
 /**
29
- * A condition tree specifies in which order a group of conditions will be
30
- * executed.
29
+ * A condition tree specifies in which order a group of conditions will be executed.
31 30
  */
32
-public class ConditionTree {
31
+public final class ConditionTree {
33 32
 
34 33
     /** The possible operations on a condition tree. */
35 34
     public static enum OPERATION {
35
+
36 36
         /** Only passes if both subtrees are true. */
37 37
         AND,
38 38
         /** Passes if either of the subtrees are true. */
@@ -43,25 +43,22 @@ public class ConditionTree {
43 43
         NOT,
44 44
         /** Doesn't do anything (an empty tree). */
45 45
         NOOP
46
-    }
47 46
 
47
+    }
48 48
     /** The left subtree of this tree. */
49
-    private ConditionTree leftArg = null;
50
-
49
+    private ConditionTree leftArg;
51 50
     /** The right subtree of this tree. */
52
-    private ConditionTree rightArg = null;
53
-
51
+    private ConditionTree rightArg;
54 52
     /** The argument of this tree (only used for VAR ops). */
55 53
     private int argument = -1;
56
-
57 54
     /** The operation that this tree performs. */
58 55
     private final OPERATION op;
59 56
 
60 57
     /**
61 58
      * Creates a new ConditionTree for a binary operation.
62 59
      *
63
-     * @param op The binary operation to perform
64
-     * @param leftArg The left argument/subtree
60
+     * @param op       The binary operation to perform
61
+     * @param leftArg  The left argument/subtree
65 62
      * @param rightArg The right argument/subtree
66 63
      */
67 64
     private ConditionTree(final OPERATION op, final ConditionTree leftArg,
@@ -74,8 +71,8 @@ public class ConditionTree {
74 71
     /**
75 72
      * Creates a new ConditionTree for a unary operation.
76 73
      *
77
-     * @param op
78
-     * @param argument
74
+     * @param op       The unary operation to perform.
75
+     * @param argument The argument/subtree to perform it on.
79 76
      */
80 77
     private ConditionTree(final OPERATION op, final ConditionTree argument) {
81 78
         this.op = op;
@@ -83,8 +80,7 @@ public class ConditionTree {
83 80
     }
84 81
 
85 82
     /**
86
-     * Creates a new ConditionTree for a VAR operation with the specified
87
-     * argument number.
83
+     * Creates a new ConditionTree for a VAR operation with the specified argument number.
88 84
      *
89 85
      * @param argument The number of the argument that's to be tested.
90 86
      */
@@ -118,11 +114,10 @@ public class ConditionTree {
118 114
     }
119 115
 
120 116
     /**
121
-     * Evaluates this tree with the specified conditions. Returns the result
122
-     * of the evaluation.
117
+     * Evaluates this tree with the specified conditions. Returns the result of the evaluation.
118
+     *
119
+     * @param conditions The binary values of each of the conditions used in this three
123 120
      *
124
-     * @param conditions The binary values of each of the conditions used in
125
-     * this three
126 121
      * @return The result of the evaluation of this tree
127 122
      */
128 123
     public boolean evaluate(final boolean[] conditions) {
@@ -154,26 +149,25 @@ public class ConditionTree {
154 149
     }
155 150
 
156 151
     /**
157
-     * Retrieves a String representation of this ConditionTree. The string
158
-     * representation is a normalised formula describing this tree and all of
159
-     * its children. The output of this method will generate an identical tree
160
-     * if passed to parseString.
152
+     * Retrieves a String representation of this ConditionTree. The string representation is a
153
+     * normalised formula describing this tree and all of its children. The output of this method
154
+     * will generate an identical tree if passed to parseString.
161 155
      *
162 156
      * @return A string representation of this tree
163 157
      */
164 158
     @Override
165 159
     public String toString() {
166 160
         switch (op) {
167
-        case VAR:
168
-            return String.valueOf(argument);
169
-        case NOT:
170
-            return "!" + leftArg;
171
-        case AND:
172
-            return "(" + leftArg + "&" + rightArg + ")";
173
-        case OR:
174
-            return "(" + leftArg + "|" + rightArg + ")";
175
-        default:
176
-            return "";
161
+            case VAR:
162
+                return String.valueOf(argument);
163
+            case NOT:
164
+                return "!" + leftArg;
165
+            case AND:
166
+                return "(" + leftArg + "&" + rightArg + ")";
167
+            case OR:
168
+                return "(" + leftArg + "|" + rightArg + ")";
169
+            default:
170
+                return "";
177 171
         }
178 172
     }
179 173
 
@@ -181,8 +175,9 @@ public class ConditionTree {
181 175
      * Parses the specified string into a condition tree.
182 176
      *
183 177
      * @param string The string to be parsed
184
-     * @return The corresponding condition tree, or null if there was an error
185
-     * while parsing the data
178
+     *
179
+     * @return The corresponding condition tree, or null if there was an error while parsing the
180
+     *         data
186 181
      */
187 182
     public static ConditionTree parseString(final String string) {
188 183
         final Deque<Object> stack = new ArrayDeque<>();
@@ -212,12 +207,12 @@ public class ConditionTree {
212 207
     }
213 208
 
214 209
     /**
215
-     * Parses the specified stack of elements, and returns a corresponding
216
-     * ConditionTree.
210
+     * Parses the specified stack of elements, and returns a corresponding ConditionTree.
217 211
      *
218 212
      * @param stack The stack to be read.
219
-     * @return The corresponding condition tree, or null if there was an error
220
-     * while parsing the data.
213
+     *
214
+     * @return The corresponding condition tree, or null if there was an error while parsing the
215
+     *         data.
221 216
      */
222 217
     private static ConditionTree parseStack(final Deque<Object> stack) {
223 218
         final Deque<Object> myStack = new ArrayDeque<>();
@@ -288,8 +283,9 @@ public class ConditionTree {
288 283
      * Reads and returns a single term from the specified stack.
289 284
      *
290 285
      * @param stack The stack to be read
291
-     * @return The ConditionTree representing the last element on the stack,
292
-     * or null if it was not possible to create one.
286
+     *
287
+     * @return The ConditionTree representing the last element on the stack, or null if it was not
288
+     *         possible to create one.
293 289
      */
294 290
     private static ConditionTree readTerm(final Deque<Object> stack) {
295 291
         final Object first = stack.pollFirst();
@@ -310,12 +306,12 @@ public class ConditionTree {
310 306
     }
311 307
 
312 308
     /**
313
-     * Pops elements off of the end of the specified stack until an opening
314
-     * bracket is reached, and then returns the parsed content of the bracket.
309
+     * Pops elements off of the end of the specified stack until an opening bracket is reached, and
310
+     * then returns the parsed content of the bracket.
315 311
      *
316 312
      * @param stack The stack to be read for the bracket
317
-     * @return The parsed contents of the bracket, or null if the brackets were
318
-     * mismatched.
313
+     *
314
+     * @return The parsed contents of the bracket, or null if the brackets were mismatched.
319 315
      */
320 316
     private static ConditionTree readBracket(final Deque<Object> stack) {
321 317
         final Deque<Object> tempStack = new ArrayDeque<>();
@@ -342,6 +338,7 @@ public class ConditionTree {
342 338
      * Determines if the specified character represents a single digit.
343 339
      *
344 340
      * @param target The character to be tested
341
+     *
345 342
      * @return True if the character is a digit, false otherwise
346 343
      */
347 344
     private static boolean isInt(final char target) {
@@ -349,10 +346,10 @@ public class ConditionTree {
349 346
     }
350 347
 
351 348
     /**
352
-     * Creates a condition tree by disjoining the specified number of arguments
353
-     * together.
349
+     * Creates a condition tree by disjoining the specified number of arguments together.
354 350
      *
355 351
      * @param numArgs The number of arguments to be disjoined
352
+     *
356 353
      * @return The corresponding condition tree
357 354
      */
358 355
     public static ConditionTree createDisjunction(final int numArgs) {
@@ -370,10 +367,10 @@ public class ConditionTree {
370 367
     }
371 368
 
372 369
     /**
373
-     * Creates a condition tree by conjoining the specified number of arguments
374
-     * together.
370
+     * Creates a condition tree by conjoining the specified number of arguments together.
375 371
      *
376 372
      * @param numArgs The number of arguments to be conjoined
373
+     *
377 374
      * @return The corresponding condition tree
378 375
      */
379 376
     public static ConditionTree createConjunction(final int numArgs) {

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

@@ -23,8 +23,7 @@
23 23
 package com.dmdirc.actions;
24 24
 
25 25
 /**
26
- * Provides methods to automatically generated condition tree for a specified
27
- * number of arguments.
26
+ * Provides methods to automatically generated condition tree for a specified number of arguments.
28 27
  *
29 28
  * @since 0.6
30 29
  */
@@ -34,6 +33,7 @@ public abstract class ConditionTreeFactory {
34 33
      * Retrieves a condition tree for the specified number of arguments.
35 34
      *
36 35
      * @param args The number of arguments in the {@link Action}
36
+     *
37 37
      * @return A ConditionTree for the specified number of args
38 38
      */
39 39
     public abstract ConditionTree getConditionTree(final int args);
@@ -46,25 +46,27 @@ public abstract class ConditionTreeFactory {
46 46
     public abstract ConditionTreeFactoryType getType();
47 47
 
48 48
     /**
49
-     * The possible types of ConditionTreeFactories
49
+     * The possible types of ConditionTreeFactories.
50 50
      */
51 51
     public static enum ConditionTreeFactoryType {
52
+
52 53
         /** Factories that produce disjunction (OR) trees. */
53 54
         DISJUNCTION,
54 55
         /** Factories that produce conjunction (AND) trees. */
55 56
         CONJUNCTION,
56 57
         /** Factories that produce custom trees. */
57 58
         CUSTOM,
59
+
58 60
     }
59 61
 
60 62
     /**
61
-     * Retrieves a factory that will extrapolate the specified
62
-     * {@link ConditionTree} for different number of arguments, if applicable.
63
+     * Retrieves a factory that will extrapolate the specified {@link ConditionTree} for different
64
+     * number of arguments, if applicable.
63 65
      *
64 66
      * @param tree The {@link ConditionTree} that's in use
65 67
      * @param args The number of conditions currently in use
66
-     * @return A {@link ConditionTreeFactory} that will create relevant
67
-     * {@link ConditionTree}s
68
+     *
69
+     * @return A {@link ConditionTreeFactory} that will create relevant {@link ConditionTree}s
68 70
      */
69 71
     public static ConditionTreeFactory getFactory(final ConditionTree tree, final int args) {
70 72
         if (tree.equals(ConditionTree.createConjunction(args))) {
@@ -144,4 +146,5 @@ public abstract class ConditionTreeFactory {
144 146
         }
145 147
 
146 148
     }
149
+
147 150
 }

+ 84
- 32
src/com/dmdirc/actions/CoreActionComparison.java View File

@@ -27,8 +27,8 @@ import com.dmdirc.interfaces.actions.ActionComparison;
27 27
 import java.util.regex.PatternSyntaxException;
28 28
 
29 29
 /**
30
- * A CoreActionComparison represents a possible comparison between two types of
31
- * data used in an action condition.
30
+ * A CoreActionComparison represents a possible comparison between two types of data used in an
31
+ * action condition.
32 32
  */
33 33
 public enum CoreActionComparison implements ActionComparison {
34 34
 
@@ -43,29 +43,40 @@ public enum CoreActionComparison implements ActionComparison {
43 43
                 return false;
44 44
             }
45 45
         }
46
+
46 47
         /** {@inheritDoc} */
47 48
         @Override
48
-        public Class<?> appliesTo() { return String.class; }
49
+        public Class<?> appliesTo() {
50
+            return String.class;
51
+        }
52
+
49 53
         /** {@inheritDoc} */
50 54
         @Override
51
-        public String getName() { return "matches regex"; }
55
+        public String getName() {
56
+            return "matches regex";
57
+        }
52 58
     },
53
-
54
-    /** Compares if two strings content are the same, case insensitive. */
59
+    /** Compares if two strings content are
60
+     * the same, case insensitive. */
55 61
     STRING_EQUALS {
56 62
         /** {@inheritDoc} */
57 63
         @Override
58 64
         public boolean test(final Object arg1, final Object arg2) {
59 65
             return ((String) arg1).equalsIgnoreCase((String) arg2);
60 66
         }
67
+
61 68
         /** {@inheritDoc} */
62 69
         @Override
63
-        public Class<?> appliesTo() { return String.class; }
70
+        public Class<?> appliesTo() {
71
+            return String.class;
72
+        }
73
+
64 74
         /** {@inheritDoc} */
65 75
         @Override
66
-        public String getName() { return "equals"; }
76
+        public String getName() {
77
+            return "equals";
78
+        }
67 79
     },
68
-
69 80
     /** Compares if two strings content aren't the same, case insensitive. */
70 81
     STRING_NEQUALS {
71 82
         /** {@inheritDoc} */
@@ -73,14 +84,19 @@ public enum CoreActionComparison implements ActionComparison {
73 84
         public boolean test(final Object arg1, final Object arg2) {
74 85
             return !STRING_EQUALS.test(arg1, arg2);
75 86
         }
87
+
76 88
         /** {@inheritDoc} */
77 89
         @Override
78
-        public Class<?> appliesTo() { return String.class; }
90
+        public Class<?> appliesTo() {
91
+            return String.class;
92
+        }
93
+
79 94
         /** {@inheritDoc} */
80 95
         @Override
81
-        public String getName() { return "does not equal"; }
96
+        public String getName() {
97
+            return "does not equal";
98
+        }
82 99
     },
83
-
84 100
     /** Checks if the string starts with another strings. */
85 101
     STRING_STARTSWITH {
86 102
         /** {@inheritDoc} */
@@ -88,14 +104,19 @@ public enum CoreActionComparison implements ActionComparison {
88 104
         public boolean test(final Object arg1, final Object arg2) {
89 105
             return ((String) arg1).startsWith((String) arg2);
90 106
         }
107
+
91 108
         /** {@inheritDoc} */
92 109
         @Override
93
-        public Class<?> appliesTo() { return String.class; }
110
+        public Class<?> appliesTo() {
111
+            return String.class;
112
+        }
113
+
94 114
         /** {@inheritDoc} */
95 115
         @Override
96
-        public String getName() { return "starts with"; }
116
+        public String getName() {
117
+            return "starts with";
118
+        }
97 119
     },
98
-
99 120
     /** Checks if the string containts another string. */
100 121
     STRING_CONTAINS {
101 122
         /** {@inheritDoc} */
@@ -103,14 +124,19 @@ public enum CoreActionComparison implements ActionComparison {
103 124
         public boolean test(final Object arg1, final Object arg2) {
104 125
             return ((String) arg1).indexOf((String) arg2) != -1;
105 126
         }
127
+
106 128
         /** {@inheritDoc} */
107 129
         @Override
108
-        public Class<?> appliesTo() { return String.class; }
130
+        public Class<?> appliesTo() {
131
+            return String.class;
132
+        }
133
+
109 134
         /** {@inheritDoc} */
110 135
         @Override
111
-        public String getName() { return "contains"; }
136
+        public String getName() {
137
+            return "contains";
138
+        }
112 139
     },
113
-
114 140
     /** Checks if the string doesn't containt another string. */
115 141
     STRING_NCONTAINS {
116 142
         /** {@inheritDoc} */
@@ -118,14 +144,19 @@ public enum CoreActionComparison implements ActionComparison {
118 144
         public boolean test(final Object arg1, final Object arg2) {
119 145
             return ((String) arg1).indexOf((String) arg2) == -1;
120 146
         }
147
+
121 148
         /** {@inheritDoc} */
122 149
         @Override
123
-        public Class<?> appliesTo() { return String.class; }
150
+        public Class<?> appliesTo() {
151
+            return String.class;
152
+        }
153
+
124 154
         /** {@inheritDoc} */
125 155
         @Override
126
-        public String getName() { return "doesn't contain"; }
156
+        public String getName() {
157
+            return "doesn't contain";
158
+        }
127 159
     },
128
-
129 160
     /** Checks if two boolean values are equal. */
130 161
     BOOL_IS {
131 162
         /** {@inheritDoc} */
@@ -133,14 +164,19 @@ public enum CoreActionComparison implements ActionComparison {
133 164
         public boolean test(final Object arg1, final Object arg2) {
134 165
             return ((Boolean) arg1).equals(Boolean.valueOf((String) arg2));
135 166
         }
167
+
136 168
         /** {@inheritDoc} */
137 169
         @Override
138
-        public Class<?> appliesTo() { return Boolean.class; }
170
+        public Class<?> appliesTo() {
171
+            return Boolean.class;
172
+        }
173
+
139 174
         /** {@inheritDoc} */
140 175
         @Override
141
-        public String getName() { return "is"; }
176
+        public String getName() {
177
+            return "is";
178
+        }
142 179
     },
143
-
144 180
     /** Checks if the int is equals to another int. */
145 181
     INT_EQUALS {
146 182
         /** {@inheritDoc} */
@@ -152,14 +188,19 @@ public enum CoreActionComparison implements ActionComparison {
152 188
                 return false;
153 189
             }
154 190
         }
191
+
155 192
         /** {@inheritDoc} */
156 193
         @Override
157
-        public Class<?> appliesTo() { return Integer.class; }
194
+        public Class<?> appliesTo() {
195
+            return Integer.class;
196
+        }
197
+
158 198
         /** {@inheritDoc} */
159 199
         @Override
160
-        public String getName() { return "equals"; }
200
+        public String getName() {
201
+            return "equals";
202
+        }
161 203
     },
162
-
163 204
     /** Checks if the int is larger than another int. */
164 205
     INT_GREATER {
165 206
         /** {@inheritDoc} */
@@ -171,14 +212,19 @@ public enum CoreActionComparison implements ActionComparison {
171 212
                 return false;
172 213
             }
173 214
         }
215
+
174 216
         /** {@inheritDoc} */
175 217
         @Override
176
-        public Class<?> appliesTo() { return Integer.class; }
218
+        public Class<?> appliesTo() {
219
+            return Integer.class;
220
+        }
221
+
177 222
         /** {@inheritDoc} */
178 223
         @Override
179
-        public String getName() { return "is greater than"; }
224
+        public String getName() {
225
+            return "is greater than";
226
+        }
180 227
     },
181
-
182 228
     /** Checks if the int is smaller than another int. */
183 229
     INT_LESS {
184 230
         /** {@inheritDoc} */
@@ -190,12 +236,18 @@ public enum CoreActionComparison implements ActionComparison {
190 236
                 return false;
191 237
             }
192 238
         }
239
+
193 240
         /** {@inheritDoc} */
194 241
         @Override
195
-        public Class<?> appliesTo() { return Integer.class; }
242
+        public Class<?> appliesTo() {
243
+            return Integer.class;
244
+        }
245
+
196 246
         /** {@inheritDoc} */
197 247
         @Override
198
-        public String getName() { return "is less than"; }
248
+        public String getName() {
249
+            return "is less than";
250
+        }
199 251
     };
200 252
 
201 253
 }

+ 485
- 167
src/com/dmdirc/actions/CoreActionComponent.java
File diff suppressed because it is too large
View File


+ 16
- 35
src/com/dmdirc/actions/CoreActionType.java View File

@@ -51,10 +51,8 @@ public enum CoreActionType implements ActionType {
51 51
     CLIENT_FOCUS_LOST(ClientEvents.CLIENT_EVENT, "Client lost focus"),
52 52
     /** Client gained focus. */
53 53
     CLIENT_FOCUS_GAINED(ClientEvents.CLIENT_EVENT, "Client gained focus"),
54
-
55 54
     /** Function key pressed. */
56 55
     CLIENT_KEY_PRESSED(ClientEvents.CLIENT_EVENT_WITH_KEY, "Function key pressed"),
57
-
58 56
     /** Frame changed. */
59 57
     CLIENT_FRAME_CHANGED(ClientEvents.WINDOW_EVENT, "Frame changed"),
60 58
     /** User input. */
@@ -63,17 +61,14 @@ public enum CoreActionType implements ActionType {
63 61
     CLIENT_LINE_ADDED(ClientEvents.WINDOW_EVENT_WITH_MESSAGE, "Line added to a window"),
64 62
     /** Popup generated. */
65 63
     CLIENT_POPUP_GENERATED(ClientEvents.POPUP_EVENT, "Popup menu generated"),
66
-
67 64
     /** Prefs dialog opened. */
68 65
     CLIENT_PREFS_OPENED(ClientEvents.CLIENT_EVENT_WITH_PREFS, "Preferences dialog opened"),
69 66
     /** Context-specific prefs requested. */
70 67
     CLIENT_PREFS_REQUESTED(ClientEvents.CLIENT_EVENT_WITH_PREFS_CAT, "Preferences requested"),
71 68
     /** Prefs dialog closed. */
72 69
     CLIENT_PREFS_CLOSED(ClientEvents.CLIENT_EVENT, "Preferences dialog opened"),
73
-
74 70
     /** Unknown command. */
75 71
     UNKNOWN_COMMAND(ClientEvents.UNKNOWN_COMMAND, "Unknown command entered"),
76
-
77 72
     /** Server numeric received. */
78 73
     SERVER_NUMERIC(ServerEvents.SERVER_NUMERIC, "Numeric event received"),
79 74
     /** Server connected. */
@@ -90,7 +85,6 @@ public enum CoreActionType implements ActionType {
90 85
     SERVER_AWAY(ServerEvents.SERVER_EVENT_WITH_ARG, "Marked as 'away'"),
91 86
     /** Error. */
92 87
     SERVER_ERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server error"),
93
-
94 88
     /** Auth notice received. */
95 89
     SERVER_AUTHNOTICE(ServerEvents.SERVER_EVENT_WITH_ARG, "Received auth notice"),
96 90
     /** Unknown action received. */
@@ -99,47 +93,38 @@ public enum CoreActionType implements ActionType {
99 93
     SERVER_UNKNOWNNOTICE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown notice"),
100 94
     /** Unknown message received. */
101 95
     SERVER_UNKNOWNMESSAGE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown message"),
102
-
103 96
     /** User modes changed. */
104 97
     SERVER_USERMODES(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "User modes changed"),
105
-
106 98
     /** Private CTCP received. */
107 99
     SERVER_CTCP(ServerEvents.SERVER_CTCP_EVENT, "CTCP received"),
108 100
     /** Private CTCPR received. */
109 101
     SERVER_CTCPR(ServerEvents.SERVER_CTCP_EVENT, "CTCP reply received"),
110
-
111 102
     /** Private notice received. */
112 103
     SERVER_NOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Notice received"),
113 104
     /** Private server notice received. */
114 105
     SERVER_SERVERNOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Server notice received"),
115
-
116 106
     /** MOTD starting. */
117 107
     SERVER_MOTDSTART(ServerEvents.SERVER_EVENT_WITH_ARG, "Start of MOTD received"),
118 108
     /** MOTD ended. */
119 109
     SERVER_MOTDEND(ServerEvents.SERVER_EVENT_WITH_ARG, "End of MOTD received"),
120 110
     /** MOTD line. */
121 111
     SERVER_MOTDLINE(ServerEvents.SERVER_EVENT_WITH_ARG, "MOTD line received"),
122
-
123 112
     /** Ping reply received. */
124 113
     SERVER_GOTPING(ServerEvents.SERVER_PING, "Received server ping reply"),
125 114
     /** Missed server ping reply. */
126 115
     SERVER_NOPING(ServerEvents.SERVER_PING, "Missed server ping reply"),
127 116
     /** Ping sent. */
128 117
     SERVER_PINGSENT(ServerEvents.SERVER_EVENT, "Ping request sent"),
129
-
130 118
     /** Invite received. */
131 119
     SERVER_INVITERECEIVED(ServerEvents.SERVER_INVITE, "Invite received"),
132
-
133 120
     /** Wallops. */
134 121
     SERVER_WALLOPS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Wallop received"),
135 122
     /** Wallusers. */
136 123
     SERVER_WALLUSERS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walluser received"),
137 124
     /** Walldesync. */
138 125
     SERVER_WALLDESYNC(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walldesync received"),
139
-
140 126
     /** Nick change. */
141 127
     SERVER_NICKCHANGE(ServerEvents.SERVER_NICKCHANGE, "My nickname changed"),
142
-
143 128
     /** Channel window opened. */
144 129
     CHANNEL_OPENED(ChannelEvents.CHANNEL_EVENT, "Channel window opened"),
145 130
     /** Channel window closed. */
@@ -150,24 +135,23 @@ public enum CoreActionType implements ActionType {
150 135
     CHANNEL_NOTOPIC(ChannelEvents.CHANNEL_EVENT, "Channel topic is not set"),
151 136
     /** Channel topic received. */
152 137
     CHANNEL_GOTTOPIC(ChannelEvents.CHANNEL_TOPICEVENT, "Channel topic received"),
153
-
154 138
     /** Channel message sent. */
155 139
     CHANNEL_SELF_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message sent"),
156 140
     /** Channel action sent. */
157 141
     CHANNEL_SELF_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action sent"),
158
-
159 142
     /** Channel message received. */
160 143
     CHANNEL_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message received"),
161 144
     /** Channel actions received. */
162 145
     CHANNEL_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action received"),
163 146
     /** Channel notice received. */
164 147
     CHANNEL_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel notice received"),
165
-    /** Channel mode notice received. @since 0.6.3m2 */
166
-    CHANNEL_MODE_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_CHARARG, "Channel mode notice received"),
167
-
148
+    /** Channel mode notice received.
149
+     *
150
+     * @since 0.6.3m2 */
151
+    CHANNEL_MODE_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_CHARARG,
152
+    "Channel mode notice received"),
168 153
     /** Channel CTCP received. */
169 154
     CHANNEL_CTCP(ChannelEvents.CHANNEL_CTCP, "Channel CTCP received"),
170
-
171 155
     /** Someone joined a channel. */
172 156
     CHANNEL_JOIN(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone joined a channel"),
173 157
     /** Someone left a channel. */
@@ -176,27 +160,27 @@ public enum CoreActionType implements ActionType {
176 160
     CHANNEL_QUIT(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone quit IRC"),
177 161
     /** Someone was kicked. */
178 162
     CHANNEL_KICK(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM, "Someone kicked someone"),
179
-
180 163
     /** Someone marked as away. */
181 164
     CHANNEL_USERAWAY(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone is marked as 'away'"),
182 165
     /** Someone marked as back. */
183 166
     CHANNEL_USERBACK(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone is marked as 'back'"),
184
-
185
-    /** Channel list mode retrieved. @since 0.6.3 */
186
-    CHANNEL_LISTMODERETRIEVED(ChannelEvents.CHANNEL_LISTMODEEVENT, "Channel list mode value retrieved"),
167
+    /** Channel list mode retrieved.
168
+     *
169
+     * @since 0.6.3 */
170
+    CHANNEL_LISTMODERETRIEVED(ChannelEvents.CHANNEL_LISTMODEEVENT,
171
+    "Channel list mode value retrieved"),
187 172
     /** Channel mode discovered. */
188 173
     CHANNEL_MODESDISCOVERED(ChannelEvents.CHANNEL_MODEEVENT, "Channel modes discovered"),
189 174
     /** Channel mode changes. */
190 175
     CHANNEL_MODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone changed channel modes"),
191 176
     /** Someone changed someone else's user modes. */
192
-    CHANNEL_USERMODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM, "Someone changed someone else's modes"),
193
-
177
+    CHANNEL_USERMODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM,
178
+    "Someone changed someone else's modes"),
194 179
     /** Someone changed nickname. */
195 180
     CHANNEL_NICKCHANGE(ChannelEvents.CHANNEL_NICKEVENT, "Someone changed nicknames"),
196
-
197 181
     /** Someone changed a topic. */
198
-    CHANNEL_TOPICCHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone changed channel topic"),
199
-
182
+    CHANNEL_TOPICCHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG,
183
+    "Someone changed channel topic"),
200 184
     /** Query opened. */
201 185
     QUERY_OPENED(QueryEvents.QUERY_EVENT, "Query window opened"),
202 186
     /** Query closed. */
@@ -213,36 +197,32 @@ public enum CoreActionType implements ActionType {
213 197
     QUERY_QUIT(QueryEvents.QUERY_EVENT_WITH_ARG, "Query: user quit"),
214 198
     /** Query nick change. */
215 199
     QUERY_NICKCHANGE(QueryEvents.QUERY_EVENT_WITH_ARG, "Query: user changed nicks"),
216
-
217 200
     /** Plugin loaded. */
218 201
     PLUGIN_LOADED(PluginEvents.PLUGIN_EVENT, "Plugin loaded"),
219 202
     /** Plugin unloaded. */
220 203
     PLUGIN_UNLOADED(PluginEvents.PLUGIN_EVENT, "Plugin unloaded"),
221 204
     /** Plugins have been refreshed. */
222 205
     PLUGIN_REFRESH(PluginEvents.PLUGIN_EVENT, "Plugins refreshed"),
223
-
224 206
     /** Action created. */
225 207
     ACTION_CREATED(ActionEvents.ACTION_EVENT, "Action created"),
226 208
     /** Action updated. */
227 209
     ACTION_UPDATED(ActionEvents.ACTION_EVENT, "Action updated"),
228 210
     /** Action deleted. */
229 211
     ACTION_DELETED(ActionEvents.ACTION_DELETED, "Action deleted"),
230
-
231 212
     /** Channel clicked. */
232 213
     LINK_CHANNEL_CLICKED(LinkEvents.CHANNEL_CLICKED, "A channel link was clicked"),
233 214
     /** Channel clicked. */
234 215
     LINK_NICKNAME_CLICKED(LinkEvents.NICKNAME_CLICKED, "A nickname link was clicked"),
235 216
     /** Link clicked. */
236 217
     LINK_URL_CLICKED(LinkEvents.LINK_CLICKED, "A Link was clicked");
237
-
238 218
     /** The type of this action. */
239 219
     private final ActionMetaType type;
240
-
241 220
     /** The name of this action. */
242 221
     private final String name;
243 222
 
244 223
     /**
245 224
      * Constructs a new core action.
225
+     *
246 226
      * @param type The type of this action
247 227
      * @param name The name of this action
248 228
      */
@@ -262,4 +242,5 @@ public enum CoreActionType implements ActionType {
262 242
     public String getName() {
263 243
         return name;
264 244
     }
245
+
265 246
 }

+ 13
- 16
src/com/dmdirc/actions/internal/WhoisNumericFormatter.java View File

@@ -41,14 +41,12 @@ public class WhoisNumericFormatter implements ActionListener {
41 41
 
42 42
     /** The name of the target of any current whois requests. */
43 43
     private final Map<Connection, String> targets = new HashMap<>();
44
-
45 44
     /** The identity to add formatters to. */
46 45
     private final ConfigProvider identity;
47 46
 
48 47
     /**
49
-     * Creates a new whois numeric formatter that will add automatic formats
50
-     * to the specified identity. This will normally be a temporary global
51
-     * identity.
48
+     * Creates a new whois numeric formatter that will add automatic formats to the specified
49
+     * identity. This will normally be a temporary global identity.
52 50
      *
53 51
      * @param identity The identity to write formatters to
54 52
      */
@@ -57,8 +55,7 @@ public class WhoisNumericFormatter implements ActionListener {
57 55
     }
58 56
 
59 57
     /**
60
-     * Registers this this whois numeric formatter with the global actions
61
-     * manager.
58
+     * Registers this this whois numeric formatter with the global actions manager.
62 59
      */
63 60
     public void register() {
64 61
         ActionManager.getActionManager().registerListener(this,
@@ -79,8 +76,8 @@ public class WhoisNumericFormatter implements ActionListener {
79 76
     }
80 77
 
81 78
     /**
82
-     * Handles a server disconnected event. This clears any entry for that
83
-     * server in the <code>target</code> map.
79
+     * Handles a server disconnected event. This clears any entry for that server in the
80
+     * {@link #targets} map.
84 81
      *
85 82
      * @param server The server that was disconnected
86 83
      */
@@ -89,15 +86,15 @@ public class WhoisNumericFormatter implements ActionListener {
89 86
     }
90 87
 
91 88
     /**
92
-     * Handles a received numeric event. This method has special handling for
93
-     * numerics 311 and 318, used to signal the start and end of a WHOIS
94
-     * request. It then monitors any other numerics without formatters for
95
-     * events which look like WHOIS information, and formats them automatically.
89
+     * Handles a received numeric event. This method has special handling for numerics 311 and 318,
90
+     * used to signal the start and end of a WHOIS request. It then monitors any other numerics
91
+     * without formatters for events which look like WHOIS information, and formats them
92
+     * automatically.
96 93
      *
97
-     * @param server The server on which the event was received
98
-     * @param numeric The numeric code of the event
94
+     * @param server    The server on which the event was received
95
+     * @param numeric   The numeric code of the event
99 96
      * @param arguments The arguments to the numeric event
100
-     * @param format The format that should be used to display the event
97
+     * @param format    The format that should be used to display the event
101 98
      */
102 99
     private void handleNumeric(final Connection server, final int numeric,
103 100
             final String[] arguments, final StringBuffer format) {
@@ -134,7 +131,7 @@ public class WhoisNumericFormatter implements ActionListener {
134 131
     /**
135 132
      * Ensures that the specified formatter exists in our identity.
136 133
      *
137
-     * @param target The target to be checked and added if necessary
134
+     * @param target    The target to be checked and added if necessary
138 135
      * @param arguments The number of arguments for the numeric
139 136
      */
140 137
     private void ensureExists(final String target, final int arguments) {

+ 1
- 2
src/com/dmdirc/actions/metatypes/ActionEvents.java View File

@@ -34,7 +34,6 @@ public enum ActionEvents implements ActionMetaType {
34 34
     ACTION_EVENT(new String[]{"action"}, Action.class),
35 35
     /** Action event type. */
36 36
     ACTION_DELETED(new String[]{"Action group", "Action name"}, Action.class, String.class);
37
-
38 37
     /** The names of the arguments for this meta type. */
39 38
     private String[] argNames;
40 39
     /** The classes of the arguments for this meta type. */
@@ -46,7 +45,7 @@ public enum ActionEvents implements ActionMetaType {
46 45
      * @param argNames The names of the meta-type's arguments
47 46
      * @param argTypes The types of the meta-type's arguments
48 47
      */
49
-    ActionEvents(final String[] argNames, final Class ... argTypes) {
48
+    ActionEvents(final String[] argNames, final Class... argTypes) {
50 49
         this.argNames = argNames;
51 50
         this.argTypes = argTypes;
52 51
     }

+ 14
- 8
src/com/dmdirc/actions/metatypes/ChannelEvents.java View File

@@ -41,18 +41,24 @@ public enum ChannelEvents implements ActionMetaType {
41 41
     /** Channel topic event type. */
42 42
     CHANNEL_TOPICEVENT(new String[]{"channel", "topic"}, Channel.class, Topic.class),
43 43
     /** Channel CTCP type. */
44
-    CHANNEL_CTCP(new String[]{"channel", "user", "type", "content"}, Channel.class, ChannelClientInfo.class, String.class, String.class),
44
+    CHANNEL_CTCP(new String[]{"channel", "user", "type", "content"}, Channel.class,
45
+    ChannelClientInfo.class, String.class, String.class),
45 46
     /** Channel event with source. */
46 47
     CHANNEL_SOURCED_EVENT(new String[]{"channel", "user"}, Channel.class, ChannelClientInfo.class),
47 48
     /** Chanel event with source and argument. */
48
-    CHANNEL_SOURCED_EVENT_WITH_ARG(new String[]{"channel", "user", "message"}, Channel.class, ChannelClientInfo.class, String.class),
49
+    CHANNEL_SOURCED_EVENT_WITH_ARG(new String[]{"channel", "user", "message"}, Channel.class,
50
+    ChannelClientInfo.class, String.class),
49 51
     /** Chanel event with source and nickname. */
50
-    CHANNEL_NICKEVENT(new String[]{"channel", "user", "old nickname"}, Channel.class, ChannelClientInfo.class, String.class),
51
-    /** Chanel event with source, message and mode character argument. @since 0.6.3m2 */
52
-    CHANNEL_SOURCED_EVENT_WITH_CHARARG(new String[]{"channel", "user", "mode", "message"}, Channel.class, ChannelClientInfo.class, String.class, String.class),
52
+    CHANNEL_NICKEVENT(new String[]{"channel", "user", "old nickname"}, Channel.class,
53
+    ChannelClientInfo.class, String.class),
54
+    /** Chanel event with source, message and mode character argument.
55
+     *
56
+     * @since 0.6.3m2 */
57
+    CHANNEL_SOURCED_EVENT_WITH_CHARARG(new String[]{"channel", "user", "mode", "message"},
58
+    Channel.class, ChannelClientInfo.class, String.class, String.class),
53 59
     /** Channel event with source and victim. */
54
-    CHANNEL_SOURCED_EVENT_WITH_VICTIM(new String[]{"channel", "user", "victim", "message"}, Channel.class, ChannelClientInfo.class, ChannelClientInfo.class, String.class);
55
-
60
+    CHANNEL_SOURCED_EVENT_WITH_VICTIM(new String[]{"channel", "user", "victim", "message"},
61
+    Channel.class, ChannelClientInfo.class, ChannelClientInfo.class, String.class);
56 62
     /** The names of the arguments for this meta type. */
57 63
     private String[] argNames;
58 64
     /** The classes of the arguments for this meta type. */
@@ -64,7 +70,7 @@ public enum ChannelEvents implements ActionMetaType {
64 70
      * @param argNames The names of the meta-type's arguments
65 71
      * @param argTypes The types of the meta-type's arguments
66 72
      */
67
-    ChannelEvents(final String[] argNames, final Class ... argTypes) {
73
+    ChannelEvents(final String[] argNames, final Class... argTypes) {
68 74
         this.argNames = argNames;
69 75
         this.argTypes = argTypes;
70 76
     }

+ 13
- 8
src/com/dmdirc/actions/metatypes/ClientEvents.java View File

@@ -45,20 +45,25 @@ public enum ClientEvents implements ActionMetaType {
45 45
     /** Client event with frame and message. */
46 46
     WINDOW_EVENT_WITH_MESSAGE(new String[]{"window", "message"}, FrameContainer.class, String.class),
47 47
     /** A popup-related event. */
48
-    POPUP_EVENT(new String[]{"popup type", "popup", "configuration provider"}, PopupType.class, PopupMenu.class, AggregateConfigProvider.class),
48
+    POPUP_EVENT(new String[]{"popup type", "popup", "configuration provider"}, PopupType.class,
49
+    PopupMenu.class, AggregateConfigProvider.class),
49 50
     /** Client event type, with a key argument. */
50 51
     CLIENT_EVENT_WITH_KEY(new String[]{"key event"}, KeyStroke.class),
51
-    /** Client event with an origin and editable buffer. */
52
-    CLIENT_EVENT_WITH_BUFFER(new String[]{"origin", "buffer"}, FrameContainer.class, StringBuffer.class),
52
+    /** Client event with an origin and
53
+     * editable buffer. */
54
+    CLIENT_EVENT_WITH_BUFFER(new String[]{"origin", "buffer"}, FrameContainer.class,
55
+    StringBuffer.class),
53 56
     /** Client event with preferences manager. */
54 57
     CLIENT_EVENT_WITH_PREFS(new String[]{"preferences manager"}, PreferencesDialogModel.class),
55 58
     /** Client event with preferences category. */
56
-    CLIENT_EVENT_WITH_PREFS_CAT(new String[]{"preferences category", "is server"}, PreferencesCategory.class, Boolean.class),
59
+    CLIENT_EVENT_WITH_PREFS_CAT(new String[]{"preferences category", "is server"},
60
+    PreferencesCategory.class, Boolean.class),
57 61
     /** Client event with a styled doc. */
58
-    CLIENT_EVENT_WITH_STYLE(new String[]{"styled document", "start offset", "length"}, StyledDocument.class, Integer.class, Integer.class),
62
+    CLIENT_EVENT_WITH_STYLE(new String[]{"styled document", "start offset", "length"},
63
+    StyledDocument.class, Integer.class, Integer.class),
59 64
     /** Unknown command event type. */
60
-    UNKNOWN_COMMAND(new String[]{"source", "command", "arguments"}, FrameContainer.class, String.class, String[].class);
61
-
65
+    UNKNOWN_COMMAND(new String[]{"source", "command", "arguments"}, FrameContainer.class,
66
+    String.class, String[].class);
62 67
     /** The names of the arguments for this meta type. */
63 68
     private String[] argNames;
64 69
     /** The classes of the arguments for this meta type. */
@@ -70,7 +75,7 @@ public enum ClientEvents implements ActionMetaType {
70 75
      * @param argNames The names of the meta-type's arguments
71 76
      * @param argTypes The types of the meta-type's arguments
72 77
      */
73
-    ClientEvents(final String[] argNames, final Class ... argTypes) {
78
+    ClientEvents(final String[] argNames, final Class... argTypes) {
74 79
         this.argNames = argNames;
75 80
         this.argTypes = argTypes;
76 81
     }

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

@@ -75,4 +75,5 @@ public enum LinkEvents implements ActionMetaType {
75 75
     public String getGroup() {
76 76
         return "Link Events";
77 77
     }
78
+
78 79
 }

+ 1
- 2
src/com/dmdirc/actions/metatypes/PluginEvents.java View File

@@ -32,7 +32,6 @@ public enum PluginEvents implements ActionMetaType {
32 32
 
33 33
     /** Plugin event type. */
34 34
     PLUGIN_EVENT(new String[]{"plugin"}, PluginInfo.class);
35
-
36 35
     /** The names of the arguments for this meta type. */
37 36
     private String[] argNames;
38 37
     /** The classes of the arguments for this meta type. */
@@ -44,7 +43,7 @@ public enum PluginEvents implements ActionMetaType {
44 43
      * @param argNames The names of the meta-type's arguments
45 44
      * @param argTypes The types of the meta-type's arguments
46 45
      */
47
-    PluginEvents(final String[] argNames, final Class ... argTypes) {
46
+    PluginEvents(final String[] argNames, final Class... argTypes) {
48 47
         this.argNames = argNames;
49 48
         this.argTypes = argTypes;
50 49
     }

+ 3
- 3
src/com/dmdirc/actions/metatypes/QueryEvents.java View File

@@ -36,8 +36,8 @@ public enum QueryEvents implements ActionMetaType {
36 36
     /** Query event with argument. */
37 37
     QUERY_EVENT_WITH_ARG(new String[]{"query", "message"}, Query.class, String.class),
38 38
     /** Query event with argument and source. */
39
-    QUERY_SOURCED_EVENT_WITH_ARG(new String[]{"query", "source", "message"}, Query.class, ClientInfo.class, String.class);
40
-
39
+    QUERY_SOURCED_EVENT_WITH_ARG(new String[]{"query", "source", "message"}, Query.class,
40
+    ClientInfo.class, String.class);
41 41
     /** The names of the arguments for this meta type. */
42 42
     private String[] argNames;
43 43
     /** The classes of the arguments for this meta type. */
@@ -49,7 +49,7 @@ public enum QueryEvents implements ActionMetaType {
49 49
      * @param argNames The names of the meta-type's arguments
50 50
      * @param argTypes The types of the meta-type's arguments
51 51
      */
52
-    QueryEvents(final String[] argNames, final Class ... argTypes) {
52
+    QueryEvents(final String[] argNames, final Class... argTypes) {
53 53
         this.argNames = argNames;
54 54
         this.argTypes = argTypes;
55 55
     }

+ 13
- 8
src/com/dmdirc/actions/metatypes/ServerEvents.java View File

@@ -34,22 +34,27 @@ public enum ServerEvents implements ActionMetaType {
34 34
     /** Server ping event type. */
35 35
     SERVER_PING(new String[]{"server", "ping"}, Connection.class, Long.class),
36 36
     /** Server numeric event type. */
37
-    SERVER_NUMERIC(new String[]{"server", "numeric", "arguments"}, Connection.class, Integer.class, String[].class),
37
+    SERVER_NUMERIC(new String[]{"server", "numeric", "arguments"}, Connection.class, Integer.class,
38
+    String[].class),
38 39
     /** Server event with argument. */
39 40
     SERVER_EVENT_WITH_ARG(new String[]{"server", "message"}, Connection.class, String.class),
40 41
     /** Server nick change. */
41
-    SERVER_NICKCHANGE(new String[]{"server", "old nickname", "new nickname"}, Connection.class, String.class, String.class),
42
+    SERVER_NICKCHANGE(new String[]{"server", "old nickname", "new nickname"}, Connection.class,
43
+    String.class, String.class),
42 44
     /** Server event, with source and argument. */
43
-    SERVER_SOURCED_EVENT_WITH_ARG(new String[]{"server", "user", "message"}, Connection.class, ClientInfo.class, String.class),
45
+    SERVER_SOURCED_EVENT_WITH_ARG(new String[]{"server", "user", "message"}, Connection.class,
46
+    ClientInfo.class, String.class),
44 47
     /** Server CTCP event. */
45
-    SERVER_CTCP_EVENT(new String[]{"server", "user", "type", "content"}, Connection.class, ClientInfo.class, String.class, String.class),
48
+    SERVER_CTCP_EVENT(new String[]{"server", "user", "type", "content"}, Connection.class,
49
+    ClientInfo.class, String.class, String.class),
46 50
     /** Server event with argument. */
47
-    SERVER_UNKNOWN_EVENT(new String[]{"server", "source", "target", "message"}, Connection.class, String.class, String.class, String.class),
51
+    SERVER_UNKNOWN_EVENT(new String[]{"server", "source", "target", "message"}, Connection.class,
52
+    String.class, String.class, String.class),
48 53
     /** Server invite event. */
49
-    SERVER_INVITE(new String[]{"server", "source", "channel"}, Connection.class, ClientInfo.class, String.class),
54
+    SERVER_INVITE(new String[]{"server", "source", "channel"}, Connection.class, ClientInfo.class,
55
+    String.class),
50 56
     /** Server event type. */
51 57
     SERVER_EVENT(new String[]{"server"}, Connection.class);
52
-
53 58
     /** The names of the arguments for this meta type. */
54 59
     private String[] argNames;
55 60
     /** The classes of the arguments for this meta type. */
@@ -61,7 +66,7 @@ public enum ServerEvents implements ActionMetaType {
61 66
      * @param argNames The names of the meta-type's arguments
62 67
      * @param argTypes The types of the meta-type's arguments
63 68
      */
64
-    ServerEvents(final String[] argNames, final Class ... argTypes) {
69
+    ServerEvents(final String[] argNames, final Class... argTypes) {
65 70
         this.argNames = argNames;
66 71
         this.argTypes = argTypes;
67 72
     }

+ 2
- 1
src/com/dmdirc/actions/validators/ActionNameValidator.java View File

@@ -46,7 +46,7 @@ public class ActionNameValidator implements Validator<String> {
46 46
     /**
47 47
      * Instantiates a new action name validator for an existing action.
48 48
      *
49
-     * @param group Associated action group
49
+     * @param group        Associated action group
50 50
      * @param originalName Existing action name
51 51
      */
52 52
     public ActionNameValidator(final ActionGroup group,
@@ -66,4 +66,5 @@ public class ActionNameValidator implements Validator<String> {
66 66
         }
67 67
         return new ValidationResponse();
68 68
     }
69
+
69 70
 }

+ 2
- 2
src/com/dmdirc/actions/validators/ConditionRuleValidator.java View File

@@ -37,8 +37,8 @@ public class ConditionRuleValidator implements Validator<String> {
37 37
     /**
38 38
      * Creates a new ConditionRuleValidator.
39 39
      *
40
-     * @param args The number of arguments allowed in the ConditionTree (i.e.,
41
-     * the number of ActionConditions)
40
+     * @param args The number of arguments allowed in the ConditionTree (i.e., the number of
41
+     *             ActionConditions)
42 42
      */
43 43
     public ConditionRuleValidator(final int args) {
44 44
         this.args = args;

+ 10
- 13
src/com/dmdirc/actions/wrappers/Alias.java View File

@@ -42,22 +42,18 @@ import java.util.List;
42 42
 public class Alias implements Serializable {
43 43
 
44 44
     /**
45
-     * A version number for this class. It should be changed whenever the class
46
-     * structure is changed (or anything else that would prevent serialized
47
-     * objects being unserialized with the new class).
45
+     * A version number for this class. It should be changed whenever the class structure is changed
46
+     * (or anything else that would prevent serialized objects being unserialized with the new
47
+     * class).
48 48
      */
49 49
     private static final long serialVersionUID = 1;
50
-
51 50
     /** The factory to use to create actions. */
52 51
     // TODO: This should be injected.
53 52
     private final ActionFactory actionFactory;
54
-
55 53
     /** Alias command. */
56 54
     private String command;
57
-
58 55
     /** Alias arguments. */
59 56
     private List<ActionCondition> arguments;
60
-
61 57
     /** Alias response. */
62 58
     private String[] response;
63 59
 
@@ -65,7 +61,7 @@ public class Alias implements Serializable {
65 61
      * Creates a new Alias wrapper.
66 62
      *
67 63
      * @param actionFactory Factory to use to create alias actions.
68
-     * @param command Alias command
64
+     * @param command       Alias command
69 65
      */
70 66
     public Alias(final ActionFactory actionFactory, final String command) {
71 67
         this.actionFactory = actionFactory;
@@ -73,16 +69,16 @@ public class Alias implements Serializable {
73 69
         this.arguments = new ArrayList<>();
74 70
         this.arguments.add(new ActionCondition(1, CoreActionComponent.STRING_STRING,
75 71
                 CoreActionComparison.STRING_EQUALS, command));
76
-        this.response = new String[]{"", };
72
+        this.response = new String[]{"",};
77 73
     }
78 74
 
79 75
     /**
80 76
      * Wraps an existing Action in an Alias.
81 77
      *
82 78
      * @param actionFactory Factory to use to create alias actions.
83
-     * @param command Alias command
84
-     * @param arguments List of arguments for the alias
85
-     * @param response Response for the alias
79
+     * @param command       Alias command
80
+     * @param arguments     List of arguments for the alias
81
+     * @param response      Response for the alias
86 82
      */
87 83
     public Alias(final ActionFactory actionFactory, final String command,
88 84
             final List<ActionCondition> arguments, final String[] response) {
@@ -235,7 +231,7 @@ public class Alias implements Serializable {
235 231
         return actionFactory.getAction(
236 232
                 AliasWrapper.GROUP_NAME,
237 233
                 getName(),
238
-                new ActionType[] {CoreActionType.UNKNOWN_COMMAND, },
234
+                new ActionType[]{CoreActionType.UNKNOWN_COMMAND,},
239 235
                 getResponse(),
240 236
                 getArguments(),
241 237
                 ConditionTree.createConjunction(getArguments().size()),
@@ -250,4 +246,5 @@ public class Alias implements Serializable {
250 246
                 + Arrays.toString(response) + ", "
251 247
                 + arguments + ", format='']";
252 248
     }
249
+
253 250
 }

+ 4
- 6
src/com/dmdirc/actions/wrappers/AliasWrapper.java View File

@@ -48,13 +48,10 @@ public class AliasWrapper extends ActionGroup {
48 48
 
49 49
     /** The name of the actions group we wrap. */
50 50
     protected static final String GROUP_NAME = "aliases";
51
-
52 51
     /** A list of registered alias names. */
53 52
     private final List<String> aliases = new ArrayList<>();
54
-
55 53
     /** Command controller to get command info from. */
56 54
     private final CommandController commandController;
57
-
58 55
     /** Server Manager. */
59 56
     private final WindowManager windowManager;
60 57
 
@@ -62,7 +59,7 @@ public class AliasWrapper extends ActionGroup {
62 59
      * Creates a new instance of AliasWrapper.
63 60
      *
64 61
      * @param commandController Command controller to get command info from.
65
-     * @param windowManager The window manager to use to find root windows.
62
+     * @param windowManager     The window manager to use to find root windows.
66 63
      */
67 64
     @Inject
68 65
     public AliasWrapper(
@@ -133,8 +130,9 @@ public class AliasWrapper extends ActionGroup {
133 130
      * Retrieves the command name of the specified alias action.
134 131
      *
135 132
      * @param action The action whose name is to be determined
136
-     * @return The command name for the specified alias, or null if it has
137
-     *         no appropriate conditions.
133
+     *
134
+     * @return The command name for the specified alias, or null if it has no appropriate
135
+     *         conditions.
138 136
      */
139 137
     public String getCommandName(final Action action) {
140 138
         for (ActionCondition condition : action.getConditions()) {

+ 2
- 2
src/com/dmdirc/actions/wrappers/PerformType.java View File

@@ -33,8 +33,7 @@ public enum PerformType {
33 33
     SERVER("Server"),
34 34
     /** A perform targeting a network. */
35 35
     NETWORK("Network");
36
-
37
-     /** Friendly name. */
36
+    /** Friendly name. */
38 37
     private final String friendlyName;
39 38
 
40 39
     /**
@@ -51,4 +50,5 @@ public enum PerformType {
51 50
     public String toString() {
52 51
         return friendlyName;
53 52
     }
53
+
54 54
 }

+ 28
- 22
src/com/dmdirc/actions/wrappers/PerformWrapper.java View File

@@ -52,7 +52,6 @@ public class PerformWrapper extends ActionGroup {
52 52
 
53 53
     /** The component name for per-profile perform conditions. */
54 54
     private static final String PP_COMP_NAME = "SERVER_PROFILE.IDENTITY_NAME";
55
-
56 55
     /** Factory to use for actions. */
57 56
     private final ActionFactory actionFactory;
58 57
 
@@ -102,13 +101,13 @@ public class PerformWrapper extends ActionGroup {
102 101
     }
103 102
 
104 103
     /**
105
-     * Sets the perform for the specified target of the specified type.
106
-     * If the specified perform is empty - that is, any non-null elements are
107
-     * empty Strings - then the perform is removed. If a profile is specified,
108
-     * the perform will only be executed for that profile.
104
+     * Sets the perform for the specified target of the specified type. If the specified perform is
105
+     * empty - that is, any non-null elements are empty Strings - then the perform is removed. If a
106
+     * profile is specified, the perform will only be executed for that profile.
109 107
      *
110 108
      * @param perform The perform to be set
111 109
      * @param content The new content of that perform
110
+     *
112 111
      * @since 0.6.4
113 112
      */
114 113
     public void setPerform(final PerformDescription perform, final String[] content) {
@@ -143,11 +142,13 @@ public class PerformWrapper extends ActionGroup {
143 142
     }
144 143
 
145 144
     /**
146
-     * Retrieves the perform for the relevant target. If no such perform exists,
147
-     * a zero-length array is returned.
145
+     * Retrieves the perform for the relevant target. If no such perform exists, a zero-length array
146
+     * is returned.
148 147
      *
149 148
      * @param perform The perform to be retrieved
149
+     *
150 150
      * @return The corresponding perform, or a zero-length array if none set
151
+     *
151 152
      * @since 0.6.4
152 153
      */
153 154
     public String[] getPerform(final PerformDescription perform) {
@@ -163,11 +164,13 @@ public class PerformWrapper extends ActionGroup {
163 164
     }
164 165
 
165 166
     /**
166
-     * Determines if the specified perform is "empty". An empty perform is one
167
-     * that does not contain any non-empty Strings.
167
+     * Determines if the specified perform is "empty". An empty perform is one that does not contain
168
+     * any non-empty Strings.
168 169
      *
169 170
      * @param perform The perform to test
171
+     *
170 172
      * @return True if the perform is empty, false otherwise
173
+     *
171 174
      * @since 0.6.4
172 175
      */
173 176
     private static boolean isEmpty(final String[] perform) {
@@ -184,6 +187,7 @@ public class PerformWrapper extends ActionGroup {
184 187
      * Checks that the specified conditions are valid for a perform action.
185 188
      *
186 189
      * @param conditions The conditions to be checked
190
+     *
187 191
      * @since 0.6.3m2
188 192
      * @return True if the conditions are valid, false otherwise
189 193
      */
@@ -209,13 +213,13 @@ public class PerformWrapper extends ActionGroup {
209 213
     }
210 214
 
211 215
     /**
212
-     * Creates a new, empty, perform wrapper for the specified server or
213
-     * network. Note that both server and network must be specified, and
214
-     * exactly one of them must be empty.
216
+     * Creates a new, empty, perform wrapper for the specified server or network. Note that both
217
+     * server and network must be specified, and exactly one of them must be empty.
215 218
      *
216
-     * @param server The server to create the action for
219
+     * @param server  The server to create the action for
217 220
      * @param network The network to create the action for
218 221
      * @param profile The profile the action is for (or null if "global")
222
+     *
219 223
      * @since 0.6.3
220 224
      * @return The new perform wrapper action
221 225
      */
@@ -231,7 +235,8 @@ public class PerformWrapper extends ActionGroup {
231 235
 
232 236
         if (profile != null) {
233 237
             conditions.add(new ActionCondition(0,
234
-                    new ActionComponentChain(Connection.class, PP_COMP_NAME, ActionManager.getActionManager()),
238
+                    new ActionComponentChain(Connection.class, PP_COMP_NAME, ActionManager.
239
+                    getActionManager()),
235 240
                     CoreActionComparison.STRING_EQUALS, profile));
236 241
         }
237 242
 
@@ -243,13 +248,14 @@ public class PerformWrapper extends ActionGroup {
243 248
     }
244 249
 
245 250
     /**
246
-     * Retrieve an action with a condition that checks the specified component,
247
-     * and matches it against the specified target.
251
+     * Retrieve an action with a condition that checks the specified component, and matches it
252
+     * against the specified target.
248 253
      *
249 254
      * @param component The action component to look for
250
-     * @param target The string the component is matched against
251
-     * @param profile The name of the profile that the action must target, or
252
-     * null for a non-profile specific action
255
+     * @param target    The string the component is matched against
256
+     * @param profile   The name of the profile that the action must target, or null for a
257
+     *                  non-profile specific action
258
+     *
253 259
      * @since 0.6.3
254 260
      * @return The matching action if one exists, or null
255 261
      */
@@ -310,8 +316,8 @@ public class PerformWrapper extends ActionGroup {
310 316
         /**
311 317
          * Creates a new perform description with the specified arguments.
312 318
          *
313
-         * @param type The type of the perform in question
314
-         * @param target The target of the perform
319
+         * @param type    The type of the perform in question
320
+         * @param target  The target of the perform
315 321
          * @param profile The profile of the perform (or null)
316 322
          */
317 323
         public PerformDescription(final PerformType type, final String target,
@@ -328,7 +334,7 @@ public class PerformWrapper extends ActionGroup {
328 334
         /**
329 335
          * Creates a new perform description with the specified arguments.
330 336
          *
331
-         * @param type The type of the perform in question
337
+         * @param type   The type of the perform in question
332 338
          * @param target The target of the perform
333 339
          */
334 340
         public PerformDescription(final PerformType type, final String target) {

+ 13
- 3
src/com/dmdirc/commandline/CommandLineOptionsModule.java View File

@@ -40,6 +40,7 @@ public class CommandLineOptionsModule {
40 40
      * Enumeration of directory types supported by the client.
41 41
      */
42 42
     public enum DirectoryType {
43
+
43 44
         /** The base directory, where everything else lives. */
44 45
         BASE,
45 46
         /** The directory that identities are stored in. */
@@ -50,23 +51,27 @@ public class CommandLineOptionsModule {
50 51
         THEMES,
51 52
         /** The directory that actions are stored in. */
52 53
         ACTIONS,
53
-        /** The directory to use for temporary files (downloads in flight, caches, etc). */
54
+        /** The
55
+         * directory to use for temporary files (downloads in flight, caches, etc). */
54 56
         TEMPORARY;
57
+
55 58
     }
56 59
 
57 60
     /**
58
-     * Provides a mean of identifying the type of directory a class wants
59
-     * injected.
61
+     * Provides a mean of identifying the type of directory a class wants injected.
60 62
      */
61 63
     @Qualifier
62 64
     public @interface Directory {
65
+
63 66
         DirectoryType value();
67
+
64 68
     }
65 69
 
66 70
     /**
67 71
      * Provides the base directory that all DMDirc user data is stored in.
68 72
      *
69 73
      * @param parser The parser to get the user-supplied directory from.
74
+     *
70 75
      * @return The base directory.
71 76
      */
72 77
     @Provides
@@ -84,6 +89,7 @@ public class CommandLineOptionsModule {
84 89
      * Provides the path to the plugins directory.
85 90
      *
86 91
      * @param baseDirectory The base DMDirc directory.
92
+     *
87 93
      * @return The plugin directory.
88 94
      */
89 95
     @Provides
@@ -97,6 +103,7 @@ public class CommandLineOptionsModule {
97 103
      * Provides the path to the actions directory.
98 104
      *
99 105
      * @param baseDirectory The base DMDirc directory.
106
+     *
100 107
      * @return The actions directory.
101 108
      */
102 109
     @Provides
@@ -110,6 +117,7 @@ public class CommandLineOptionsModule {
110 117
      * Provides the path to the identities directory.
111 118
      *
112 119
      * @param baseDirectory The base DMDirc directory.
120
+     *
113 121
      * @return The identities directory.
114 122
      */
115 123
     @Provides
@@ -123,6 +131,7 @@ public class CommandLineOptionsModule {
123 131
      * Provides the path to the themes directory.
124 132
      *
125 133
      * @param baseDirectory The base DMDirc directory.
134
+     *
126 135
      * @return The themes directory.
127 136
      */
128 137
     @Provides
@@ -139,6 +148,7 @@ public class CommandLineOptionsModule {
139 148
      * explicitly.
140 149
      *
141 150
      * @param baseDirectory The base DMDirc directory.
151
+     *
142 152
      * @return The temporary directory.
143 153
      */
144 154
     @Provides

+ 18
- 29
src/com/dmdirc/commandline/CommandLineParser.java View File

@@ -48,9 +48,8 @@ import javax.inject.Singleton;
48 48
 public class CommandLineParser {
49 49
 
50 50
     /**
51
-     * The arguments that the client supports, in groups of four, in the
52
-     * following order: short option, long option, description, whether or not
53
-     * the option takes an argument.
51
+     * The arguments that the client supports, in groups of four, in the following order: short
52
+     * option, long option, description, whether or not the option takes an argument.
54 53
      */
55 54
     private static final Object[][] ARGUMENTS = new Object[][]{
56 55
         {'c', "connect", "Connect to the specified server", Boolean.TRUE},
@@ -61,30 +60,21 @@ public class CommandLineParser {
61 60
         {'p', "portable", "Enable portable mode", Boolean.FALSE},
62 61
         {'r', "disable-reporting", "Disable automatic error reporting", Boolean.FALSE},
63 62
         {'v', "version", "Display client version and exit", Boolean.FALSE},
64
-        {'k', "check", "Check if an existing instance of DMDirc exists.", Boolean.FALSE},
65
-    };
66
-
63
+        {'k', "check", "Check if an existing instance of DMDirc exists.", Boolean.FALSE},};
67 64
     /** A list of addresses to autoconnect to. */
68 65
     private final List<URI> addresses = new ArrayList<>();
69
-
70 66
     /** Provider to use to get server managers. */
71 67
     private final Provider<ServerManager> serverManagerProvider;
72
-
73 68
     /** Provider to use to get the global config. */
74 69
     private final Provider<AggregateConfigProvider> globalConfigProvider;
75
-
76 70
     /** Whether to disable error reporting or not. */
77 71
     private boolean disablereporting;
78
-
79 72
     /** The version string passed for the launcher. */
80 73
     private String launcherVersion;
81
-
82 74
     /** The configuration directory. */
83 75
     private String configDirectory;
84
-
85 76
     /** The RMI server we're using. */
86 77
     private RemoteInterface server;
87
-
88 78
     /** The parser to use for URIs. */
89 79
     private final URIParser uriParser;
90 80
 
@@ -92,8 +82,8 @@ public class CommandLineParser {
92 82
      * Creates a new instance of CommandLineParser.
93 83
      *
94 84
      * @param serverManagerProvider Provider to use to get server managers.
95
-     * @param globalConfigProvider Provider to use to get the global config.
96
-     * @param uriParser The parser to use for URIs.
85
+     * @param globalConfigProvider  Provider to use to get the global config.
86
+     * @param uriParser             The parser to use for URIs.
97 87
      */
98 88
     @Inject
99 89
     public CommandLineParser(
@@ -110,7 +100,7 @@ public class CommandLineParser {
110 100
      *
111 101
      * @param arguments The arguments to be parsed
112 102
      */
113
-    public void parse(final String ... arguments) {
103
+    public void parse(final String... arguments) {
114 104
         boolean inArg = false;
115 105
         char previousArg = '.';
116 106
 
@@ -149,11 +139,11 @@ public class CommandLineParser {
149 139
     }
150 140
 
151 141
     /**
152
-     * Checks whether the specified arg type takes an argument. If it does,
153
-     * this method returns true. If it doesn't, the method processes the
154
-     * argument and returns false.
142
+     * Checks whether the specified arg type takes an argument. If it does, this method returns
143
+     * true. If it doesn't, the method processes the argument and returns false.
155 144
      *
156 145
      * @param argument The short code of the argument
146
+     *
157 147
      * @return True if the arg requires an argument, false otherwise
158 148
      */
159 149
     private boolean checkArgument(final char argument) {
@@ -179,6 +169,7 @@ public class CommandLineParser {
179 169
      * Processes the specified string as a single long argument.
180 170
      *
181 171
      * @param arg The string entered
172
+     *
182 173
      * @return The short form of the corresponding argument
183 174
      */
184 175
     private char processLongArg(final String arg) {
@@ -198,6 +189,7 @@ public class CommandLineParser {
198 189
      * Processes the specified string as a single short argument.
199 190
      *
200 191
      * @param arg The string entered
192
+     *
201 193
      * @return The short form of the corresponding argument
202 194
      */
203 195
     private char processShortArg(final String arg) {
@@ -216,7 +208,7 @@ public class CommandLineParser {
216 208
     /**
217 209
      * Processes the specified command-line argument.
218 210
      *
219
-     * @param arg The short form of the argument used
211
+     * @param arg   The short form of the argument used
220 212
      * @param param The (optional) string parameter for the option
221 213
      */
222 214
     private void processArgument(final char arg, final String param) {
@@ -258,8 +250,7 @@ public class CommandLineParser {
258 250
     }
259 251
 
260 252
     /**
261
-     * Informs the user that they entered an unknown argument, prints the
262
-     * client help, and exits.
253
+     * Informs the user that they entered an unknown argument, prints the client help, and exits.
263 254
      *
264 255
      * @param message The message about the unknown argument to be displayed
265 256
      */
@@ -379,8 +370,7 @@ public class CommandLineParser {
379 370
     /**
380 371
      * Returns the user-supplied configuration directory.
381 372
      *
382
-     * @return The user-supplied config directory, or {@code null} if none
383
-     * was supplied.
373
+     * @return The user-supplied config directory, or {@code null} if none was supplied.
384 374
      */
385 375
     public String getConfigDirectory() {
386 376
         return configDirectory;
@@ -398,21 +388,20 @@ public class CommandLineParser {
398 388
     /**
399 389
      * Returns the provided launcher version, if any.
400 390
      *
401
-     * @return The version supplied by the launcher, or {@code null} if no
402
-     * launcher is identified.
391
+     * @return The version supplied by the launcher, or {@code null} if no launcher is identified.
403 392
      */
404 393
     public String getLauncherVersion() {
405 394
         return launcherVersion;
406 395
     }
407 396
 
408 397
     /**
409
-     * Processes arguments once the client has been loaded properly.
410
-     * This allows us to auto-connect to servers, etc.
398
+     * Processes arguments once the client has been loaded properly. This allows us to auto-connect
399
+     * to servers, etc.
411 400
      *
412 401
      * @param serverManager The server manager to use to connect servers.
413 402
      */
414 403
     public void processArguments(final ServerManager serverManager) {
415
-        for (URI address : addresses)  {
404
+        for (URI address : addresses) {
416 405
             serverManager.connectToAddress(address);
417 406
         }
418 407
     }

+ 1
- 0
src/com/dmdirc/commandline/RemoteInterface.java View File

@@ -36,6 +36,7 @@ public interface RemoteInterface extends Remote {
36 36
      * Connects to the specified list of addresses.
37 37
      *
38 38
      * @param addresses The addresses to connect to.
39
+     *
39 40
      * @throws java.rmi.RemoteException on problems communicating
40 41
      * @since 0.6.3
41 42
      */

+ 3
- 5
src/com/dmdirc/commandline/RemoteServer.java View File

@@ -66,8 +66,7 @@ public class RemoteServer implements RemoteInterface {
66 66
     }
67 67
 
68 68
     /**
69
-     * Binds to the RMI registry so that other clients may find this remote
70
-     * server.
69
+     * Binds to the RMI registry so that other clients may find this remote server.
71 70
      */
72 71
     public void bind() {
73 72
         RemoteInterface stub;
@@ -91,9 +90,8 @@ public class RemoteServer implements RemoteInterface {
91 90
     }
92 91
 
93 92
     /**
94
-     * Retrieves a reference to an existing RemoteServer, if there is one.
95
-     * Note that this must be called before bind(), unless you want a reference
96
-     * to our own client for some reason.
93
+     * Retrieves a reference to an existing RemoteServer, if there is one. Note that this must be
94
+     * called before bind(), unless you want a reference to our own client for some reason.
97 95
      *
98 96
      * @return The RemoteServer instance, or null if none was available
99 97
      */

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

@@ -23,17 +23,15 @@
23 23
 package com.dmdirc.commandparser;
24 24
 
25 25
 /**
26
- * A basic {@link CommandInfo} implementation whose parameters can be
27
- * configured via the constructor.
26
+ * A basic {@link CommandInfo} implementation whose parameters can be configured via the
27
+ * constructor.
28 28
  */
29 29
 public class BaseCommandInfo implements CommandInfo {
30 30
 
31 31
     /** The name of the command. */
32 32
     private final String name;
33
-
34 33
     /** The help text for this command. */
35 34
     private final String help;
36
-
37 35
     /** The type of the command. */
38 36
     private final CommandType type;
39 37
 

+ 31
- 35
src/com/dmdirc/commandparser/CommandArguments.java View File

@@ -33,10 +33,9 @@ import java.util.regex.Pattern;
33 33
 import static com.google.common.base.Preconditions.checkPositionIndex;
34 34
 
35 35
 /**
36
- * Represents a command and its arguments. In this class, input is split into
37
- * 'words' which are separated by any number of whitespace characters;
38
- * 'arguments' are the same but exclude the first word, which will normally be
39
- * the command name.
36
+ * Represents a command and its arguments. In this class, input is split into 'words' which are
37
+ * separated by any number of whitespace characters; 'arguments' are the same but exclude the first
38
+ * word, which will normally be the command name.
40 39
  *
41 40
  * @since 0.6.3m1
42 41
  */
@@ -44,19 +43,18 @@ public class CommandArguments {
44 43
 
45 44
     /** The raw line that was input. */
46 45
     private final String line;
47
-
48 46
     /** The line split into whitespace-delimited words. */
49 47
     private String[] words;
50
-
51 48
     /** Command controller to consult for command chars, etc. */
52 49
     private final CommandController controller;
53 50
 
54 51
     /**
55 52
      * Creates a new command arguments parser for the specified line.
56 53
      *
57
-     * @param controller The command controller to consult for information
58
-     * about command characters, etc.
59
-     * @param line The line to be parsed
54
+     * @param controller The command controller to consult for information about command characters,
55
+     *                   etc.
56
+     * @param line       The line to be parsed
57
+     *
60 58
      * @since 0.6.7
61 59
      */
62 60
     public CommandArguments(final CommandController controller, final String line) {
@@ -67,9 +65,10 @@ public class CommandArguments {
67 65
     /**
68 66
      * Creates a new command arguments parser for the specified words.
69 67
      *
70
-     * @param controller The command controller to consult for information
71
-     * about command characters, etc.
72
-     * @param words The words which form the line ot be parsed
68
+     * @param controller The command controller to consult for information about command characters,
69
+     *                   etc.
70
+     * @param words      The words which form the line ot be parsed
71
+     *
73 72
      * @since 0.6.7
74 73
      */
75 74
     public CommandArguments(final CommandController controller, final Collection<String> words) {
@@ -90,8 +89,7 @@ public class CommandArguments {
90 89
     }
91 90
 
92 91
     /**
93
-     * Retrieves the raw line that was input, including any command character(s)
94
-     * and names.
92
+     * Retrieves the raw line that was input, including any command character(s) and names.
95 93
      *
96 94
      * @return The raw line entered
97 95
      */
@@ -100,8 +98,8 @@ public class CommandArguments {
100 98
     }
101 99
 
102 100
     /**
103
-     * Retrieves the raw line that was input, including the command name but
104
-     * stripped of any command characters.
101
+     * Retrieves the raw line that was input, including the command name but stripped of any command
102
+     * characters.
105 103
      *
106 104
      * @return The raw line entered, without command chars
107 105
      */
@@ -112,9 +110,8 @@ public class CommandArguments {
112 110
     }
113 111
 
114 112
     /**
115
-     * Retrieves the input split into distinct, whitespace-separated words. The
116
-     * first item in the array will be the command name complete with any
117
-     * command characters.
113
+     * Retrieves the input split into distinct, whitespace-separated words. The first item in the
114
+     * array will be the command name complete with any command characters.
118 115
      *
119 116
      * @return An array of 'words' that make up the input
120 117
      */
@@ -125,8 +122,7 @@ public class CommandArguments {
125 122
     }
126 123
 
127 124
     /**
128
-     * Retrieves the arguments to the command split into disticnt,
129
-     * whitespace-separated words.
125
+     * Retrieves the arguments to the command split into disticnt, whitespace-separated words.
130 126
      *
131 127
      * @return An array of 'words' that make up the command's arguments
132 128
      */
@@ -137,8 +133,8 @@ public class CommandArguments {
137 133
     }
138 134
 
139 135
     /**
140
-     * Retrieves all the arguments to the command (i.e., not including the
141
-     * command name) with their original whitespace separation preserved.
136
+     * Retrieves all the arguments to the command (i.e., not including the command name) with their
137
+     * original whitespace separation preserved.
142 138
      *
143 139
      * @return A String representation of the command arguments
144 140
      */
@@ -147,11 +143,11 @@ public class CommandArguments {
147 143
     }
148 144
 
149 145
     /**
150
-     * Retrieves arguments to the command (i.e., not including the
151
-     * command name) starting with the specified argument, with their original
152
-     * whitespace separation preserved.
146
+     * Retrieves arguments to the command (i.e., not including the command name) starting with the
147
+     * specified argument, with their original whitespace separation preserved.
153 148
      *
154 149
      * @param start The index of the first argument to include
150
+     *
155 151
      * @return A String representation of the command arguments
156 152
      */
157 153
     public String getArgumentsAsString(final int start) {
@@ -161,12 +157,12 @@ public class CommandArguments {
161 157
     }
162 158
 
163 159
     /**
164
-     * Retrieves arguments to the command (i.e., not including the
165
-     * command name) starting with the specified argument, with their original
166
-     * whitespace separation preserved.
160
+     * Retrieves arguments to the command (i.e., not including the command name) starting with the
161
+     * specified argument, with their original whitespace separation preserved.
167 162
      *
168 163
      * @param start The index of the first argument to include
169
-     * @param end The index of the last argument to include
164
+     * @param end   The index of the last argument to include
165
+     *
170 166
      * @return A String representation of the command arguments
171 167
      */
172 168
     public String getArgumentsAsString(final int start, final int end) {
@@ -174,10 +170,10 @@ public class CommandArguments {
174 170
     }
175 171
 
176 172
     /**
177
-     * Retrieves the specified words with their original whitespace separation
178
-     * preserved.
173
+     * Retrieves the specified words with their original whitespace separation preserved.
179 174
      *
180 175
      * @param start The index of the first word to include (starting at 0)
176
+     *
181 177
      * @return A String representation of the requested words
182 178
      */
183 179
     public String getWordsAsString(final int start) {
@@ -187,11 +183,11 @@ public class CommandArguments {
187 183
     }
188 184
 
189 185
     /**
190
-     * Retrieves the specified words with their original whitespace separation
191
-     * preserved.
186
+     * Retrieves the specified words with their original whitespace separation preserved.
192 187
      *
193 188
      * @param start The index of the first word to include (starting at 0)
194
-     * @param end The index of the last word to include
189
+     * @param end   The index of the last word to include
190
+     *
195 191
      * @return A String representation of the requested words
196 192
      */
197 193
     @Precondition("Start index is less than or equal to end index")

+ 8
- 8
src/com/dmdirc/commandparser/CommandInfo.java View File

@@ -37,14 +37,14 @@ public interface CommandInfo {
37 37
     /**
38 38
      * Returns a string representing the help message for this command.
39 39
      * <p>
40
-     * The help text should generally be one line, and must start with
41
-     * the name of the command. It should then summarise the arguments of
42
-     * that command, using <code>&lt;angled&gt;</code> brackets for required
43
-     * arguments, and <code>[square]</code> brackets for optional arguments.
44
-     * Where multiple possibilities exist, they are typically separated by a
45
-     * pipe (<code>|</code>), for example: <code>command [--arg1|--arg2]</code>.
46
-     * The usage summary should then be followed by a dash and a brief
47
-     * summary of the purpose of the command.
40
+     * The help text should generally be one line, and must start with the name of the command. It
41
+     * should then summarise the arguments of that command, using
42
+     * <code>&lt;angled&gt;</code> brackets for required arguments, and
43
+     * <code>[square]</code> brackets for optional arguments. Where multiple possibilities exist,
44
+     * they are typically separated by a pipe (
45
+     * <code>|</code>), for example:
46
+     * <code>command [--arg1|--arg2]</code>. The usage summary should then be followed by a dash and
47
+     * a brief summary of the purpose of the command.
48 48
      * <p>
49 49
      * A typical help message would look similar to:
50 50
      * <p>

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

@@ -25,8 +25,7 @@ package com.dmdirc.commandparser;
25 25
 import com.dmdirc.commandparser.commands.Command;
26 26
 
27 27
 /**
28
- * A combination of a {@link Command} and the {@link CommandInfo} which
29
- * triggered it.
28
+ * A combination of a {@link Command} and the {@link CommandInfo} which triggered it.
30 29
  *
31 30
  * @since 0.6.4
32 31
  */
@@ -34,7 +33,6 @@ public class CommandInfoPair {
34 33
 
35 34
     /** The command info which caused the command to be triggered. */
36 35
     private final CommandInfo commandInfo;
37
-
38 36
     /** The command in question. */
39 37
     private final Command command;
40 38
 

+ 23
- 27
src/com/dmdirc/commandparser/CommandManager.java View File

@@ -40,24 +40,20 @@ import java.util.List;
40 40
 import java.util.Map;
41 41
 
42 42
 /**
43
- * The command manager creates and manages a single instance of all commands,
44
- * and provides methods to load each group of commands into a parser instance.
43
+ * The command manager creates and manages a single instance of all commands, and provides methods
44
+ * to load each group of commands into a parser instance.
45 45
  */
46 46
 public class CommandManager implements CommandController {
47 47
 
48 48
     /** A list of commands that have been instantiated. */
49 49
     private final Map<CommandInfo, Command> commands = new HashMap<>();
50
-
51 50
     /** A list of command parsers that have been instantiated. */
52 51
     private final MapList<CommandType, CommandParser> parsers = new MapList<>();
53
-
54 52
     /** The manager to use to iterate servers. */
55 53
     private final ServerManager serverManager;
56
-
57 54
     /** The command char we're using. */
58 55
     @ConfigBinding(domain = "general", key = "commandchar")
59 56
     private char commandChar;
60
-
61 57
     /** The silence char we're using. */
62 58
     @ConfigBinding(domain = "general", key = "silencechar")
63 59
     private char silenceChar;
@@ -105,10 +101,10 @@ public class CommandManager implements CommandController {
105 101
     /**
106 102
      * Registers or unregisters a command.
107 103
      *
108
-     * @param info The information about the command
109
-     * @param command The command to be (un)registered
110
-     * @param register True if the command should be registered, false if it
111
-     * should be unregistered.
104
+     * @param info     The information about the command
105
+     * @param command  The command to be (un)registered
106
+     * @param register True if the command should be registered, false if it should be unregistered.
107
+     *
112 108
      * @since 0.6.3m1
113 109
      */
114 110
     private void registerCommand(final CommandInfo info, final Command command,
@@ -129,10 +125,11 @@ public class CommandManager implements CommandController {
129 125
     /**
130 126
      * Registers or unregisters the specified command with all of the specified parsers.
131 127
      *
132
-     * @param info The command information object
133
-     * @param command The command to be registered
128
+     * @param info      The command information object
129
+     * @param command   The command to be registered
134 130
      * @param myParsers The parsers to register the command with
135
-     * @param register Whether to register or unregister the commands
131
+     * @param register  Whether to register or unregister the commands
132
+     *
136 133
      * @since 0.6.3m1
137 134
      */
138 135
     private void registerCommand(final CommandInfo info, final Command command,
@@ -147,12 +144,11 @@ public class CommandManager implements CommandController {
147 144
     }
148 145
 
149 146
     /**
150
-     * Registers or unregisters the specified command's name with the relevant
151
-     * tab completers.
147
+     * Registers or unregisters the specified command's name with the relevant tab completers.
148
+     *
149
+     * @param command  The command to be registered
150
+     * @param register True if the command should be registered, false if it should be unregistered.
152 151
      *
153
-     * @param command The command to be registered
154
-     * @param register True if the command should be registered, false if it
155
-     * should be unregistered.
156 152
      * @since 0.6.3m1
157 153
      */
158 154
     private void registerCommandName(final CommandInfo command,
@@ -186,19 +182,18 @@ public class CommandManager implements CommandController {
186 182
     }
187 183
 
188 184
     /**
189
-     * Registers or unregisters the specified command with the specified tab-
190
-     * completer.
185
+     * Registers or unregisters the specified command with the specified tab- completer.
191 186
      *
192 187
      * @param completer The tab completer to be used
193
-     * @param name The command name to be registered
194
-     * @param register True if the command should be registered, false if it
195
-     * should be unregistered.
188
+     * @param name      The command name to be registered
189
+     * @param register  True if the command should be registered, false if it should be
190
+     *                  unregistered.
196 191
      */
197 192
     private void registerCommandName(final TabCompleter completer,
198 193
             final String name, final boolean register) {
199 194
         if (register) {
200 195
             completer.addEntry(TabCompletionType.COMMAND, name);
201
-        }  else {
196
+        } else {
202 197
             completer.removeEntry(TabCompletionType.COMMAND, name);
203 198
         }
204 199
     }
@@ -206,7 +201,7 @@ public class CommandManager implements CommandController {
206 201
     /** {@inheritDoc} */
207 202
     @Override
208 203
     public void loadCommands(final CommandParser parser,
209
-            final CommandType ... supertypes) {
204
+            final CommandType... supertypes) {
210 205
         for (CommandType supertype : supertypes) {
211 206
             for (CommandType type : supertype.getComponentTypes()) {
212 207
                 for (Map.Entry<CommandInfo, Command> pair : getCommands(type, null).entrySet()) {
@@ -259,12 +254,13 @@ public class CommandManager implements CommandController {
259 254
     }
260 255
 
261 256
     /**
262
-     * Retrieves a map of all commands of the specified type, with the
263
-     * specified name.
257
+     * Retrieves a map of all commands of the specified type, with the specified name.
264 258
      *
265 259
      * @param type The type of command to list, or null for all types
266 260
      * @param name The name of the command to look for, or null for any name
261
+     *
267 262
      * @return A map of {@link CommandInfo}s and their associated {@link Command}.
263
+     *
268 264
      * @since 0.6.3m1
269 265
      */
270 266
     private Map<CommandInfo, Command> getCommands(final CommandType type,

+ 9
- 7
src/com/dmdirc/commandparser/CommandType.java View File

@@ -29,9 +29,11 @@ public enum CommandType {
29 29
 
30 30
     /** A global command, which may be executed anywhere. */
31 31
     TYPE_GLOBAL,
32
-    /** A server command, which only makes sense in the context of a connection. */
32
+    /** A server command, which only makes sense in the context of a
33
+     * connection. */
33 34
     TYPE_SERVER,
34
-    /** A chat command, which needs a MessageTarget to make sense. */
35
+    /** A chat command, which needs a MessageTarget to make
36
+     * sense. */
35 37
     TYPE_CHAT,
36 38
     /** A channel command. */
37 39
     TYPE_CHANNEL,
@@ -39,11 +41,10 @@ public enum CommandType {
39 41
     TYPE_QUERY;
40 42
 
41 43
     /**
42
-     * Retrieves an array of component types that make up this command type.
43
-     * Generally this will only contain the type itself, but some commands may
44
-     * be registered in multiple queues (such as CHANNEL commands going into
45
-     * both CHAT and CHANNEL queues). Note that for obvious reasons there is
46
-     * no recursion done on the values returned here.
44
+     * Retrieves an array of component types that make up this command type. Generally this will
45
+     * only contain the type itself, but some commands may be registered in multiple queues (such as
46
+     * CHANNEL commands going into both CHAT and CHANNEL queues). Note that for obvious reasons
47
+     * there is no recursion done on the values returned here.
47 48
      *
48 49
      * @since 0.6.3m1
49 50
      * @return An array of types which this type should be registered as.
@@ -74,4 +75,5 @@ public enum CommandType {
74 75
                 return "Unknown";
75 76
         }
76 77
     }
78
+
77 79
 }

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

@@ -48,11 +48,12 @@ public class PopupManager {
48 48
     }
49 49
 
50 50
     /**
51
-     * Returns the popup menu that should be used for the specified type.
52
-     * Configuration data is read from the specified config manager.
51
+     * Returns the popup menu that should be used for the specified type. Configuration data is read
52
+     * from the specified config manager.
53 53
      *
54
-     * @param menuType The type of the menu that is needed
54
+     * @param menuType      The type of the menu that is needed
55 55
      * @param configManager The config manager to be used for the menu
56
+     *
56 57
      * @return The PopupMenu that should be displayed
57 58
      */
58 59
     public PopupMenu getMenu(final PopupType menuType, final AggregateConfigProvider configManager) {
@@ -68,9 +69,10 @@ public class PopupManager {
68 69
     /**
69 70
      * Retrieves the menu with the specified name.
70 71
      *
71
-     * @param menuName The name of the menu to read
72
-     * @param type The type of the menu that is needed
72
+     * @param menuName      The name of the menu to read
73
+     * @param type          The type of the menu that is needed
73 74
      * @param configManager The config manager to be used for the menu
75
+     *
74 76
      * @return The PopupMenu with the specified name
75 77
      */
76 78
     private PopupMenu getMenu(final String menuName,
@@ -91,9 +93,10 @@ public class PopupManager {
91 93
     /**
92 94
      * Creates a PopupMenuItem for the specified item.
93 95
      *
94
-     * @param item The item to be turned into a PopupMenuItem
95
-     * @param type The type of popup item to create
96
+     * @param item          The item to be turned into a PopupMenuItem
97
+     * @param type          The type of popup item to create
96 98
      * @param configManager The config manager to beused for the menu
99
+     *
97 100
      * @return The corresponding PopupMenuItem
98 101
      */
99 102
     private PopupMenuItem getItem(final String item,

+ 10
- 9
src/com/dmdirc/commandparser/PopupMenuItem.java View File

@@ -56,7 +56,7 @@ public class PopupMenuItem {
56 56
      * Creates a new PopupMenuItem that is used as a submenu.
57 57
      *
58 58
      * @param manager The command manager to use to retrieve command information
59
-     * @param name The name of the menu item
59
+     * @param name    The name of the menu item
60 60
      * @param submenu The submenu of this item
61 61
      */
62 62
     public PopupMenuItem(final CommandController manager, final String name, final PopupMenu submenu) {
@@ -69,11 +69,12 @@ public class PopupMenuItem {
69 69
      * Creates a new PopupMenuItem that executes a command.
70 70
      *
71 71
      * @param manager The command manager to use to retrieve command information
72
-     * @param name The name of the menu item
73
-     * @param arity The arity of the command this item will execute
72
+     * @param name    The name of the menu item
73
+     * @param arity   The arity of the command this item will execute
74 74
      * @param command The command to be executed
75 75
      */
76
-    public PopupMenuItem(final CommandController manager, final String name, final int arity, final String command) {
76
+    public PopupMenuItem(final CommandController manager, final String name, final int arity,
77
+            final String command) {
77 78
         this.name = name;
78 79
         this.arity = arity;
79 80
         this.command = command;
@@ -117,12 +118,12 @@ public class PopupMenuItem {
117 118
     }
118 119
 
119 120
     /**
120
-     * Retrieves the command for this menu item, with the specified arguments
121
-     * substituted in. Note that the result may actually consist of multiple
122
-     * commands on separate lines.
121
+     * Retrieves the command for this menu item, with the specified arguments substituted in. Note
122
+     * that the result may actually consist of multiple commands on separate lines.
123
+     *
124
+     * @param arguments A two dimensional array containing one array of arguments for each subject
125
+     *                  of the command.
123 126
      *
124
-     * @param arguments A two dimensional array containing one array of
125
-     * arguments for each subject of the command.
126 127
      * @return The command to be passed to a command parser
127 128
      */
128 129
     public String getCommand(final Object[][] arguments) {

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

@@ -23,8 +23,7 @@
23 23
 package com.dmdirc.commandparser;
24 24
 
25 25
 /**
26
- * An enumeration of the types of popup menu which are supported by the
27
- * PopupManager.
26
+ * An enumeration of the types of popup menu which are supported by the PopupManager.
28 27
  */
29 28
 public enum PopupType {
30 29
 
@@ -34,84 +33,72 @@ public enum PopupType {
34 33
      * Expected arguments: none.
35 34
      */
36 35
     CHAN_NORMAL(0),
37
-
38 36
     /**
39 37
      * The menu that appears when right clicking in a nickname in a channel window.
40 38
      *
41 39
      * Expected arguments: the nickname of the user who was clicked on.
42 40
      */
43 41
     CHAN_NICK(1),
44
-
45 42
     /**
46 43
      * The menu that appears when right clicking in a channel in a channel window.
47 44
      *
48 45
      * Expected arguments: the nickname of the user who was clicked on.
49 46
      */
50 47
     CHAN_CHANNEL(1),
51
-
52 48
     /**
53 49
      * The menu that appears when right clicking in a hyperlink in a channel window.
54 50
      *
55 51
      * Expected arguments: the hyperlink clicked.
56 52
      */
57 53
     CHAN_HYPERLINK(1),
58
-
59 54
     /**
60 55
      * The menu that appears when right clicking in a query window.
61 56
      *
62 57
      * Expected arguments: the nickname of the user who the query is with.
63 58
      */
64 59
     QUERY_NORMAL(1),
65
-
66 60
     /**
67 61
      * The menu that appears when right clicking in a nickname in a query window.
68 62
      *
69 63
      * Expected arguments: the nickname of the user who the query is with.
70 64
      */
71 65
     QUERY_NICK(1),
72
-
73 66
     /**
74 67
      * The menu that appears when right clicking in a channel in a query window.
75 68
      *
76 69
      * Expected arguments: the nickname of the user who the query is with.
77 70
      */
78 71
     QUERY_CHANNEL(1),
79
-
80 72
     /**
81 73
      * The menu that appears when right clicking in a hyperlink in a query window.
82 74
      *
83 75
      * Expected arguments: the hyperlink clicked.
84 76
      */
85 77
     QUERY_HYPERLINK(1),
86
-
87 78
     /**
88 79
      * The menu that appears when right clicking in a server window.
89 80
      *
90 81
      * Expected arguments: the nickname of the user who the query is with.
91 82
      */
92 83
     SERVER_NORMAL(1),
93
-
94 84
     /**
95 85
      * The menu that appears when right clicking in a nickname in a server window.
96 86
      *
97 87
      * Expected arguments: the nickname of the user who the query is with.
98 88
      */
99 89
     SERVER_NICK(1),
100
-
101 90
     /**
102 91
      * The menu that appears when right clicking in a channel in a server window.
103 92
      *
104 93
      * Expected arguments: the nickname of the user who the query is with.
105 94
      */
106 95
     SERVER_CHANNEL(1),
107
-
108 96
     /**
109 97
      * The menu that appears when right clicking in a hyperlink in a server window.
110 98
      *
111 99
      * Expected arguments: the hyperlink clicked.
112 100
      */
113 101
     SERVER_HYPERLINK(1);
114
-
115 102
     /** The arity (number of expected arguments) of the type. */
116 103
     private final int arity;
117 104
 

+ 18
- 19
src/com/dmdirc/commandparser/commands/Command.java View File

@@ -35,10 +35,8 @@ public abstract class Command {
35 35
 
36 36
     /** The format name used for command output. */
37 37
     protected static final String FORMAT_OUTPUT = "commandOutput";
38
-
39 38
     /** The format name used for command errors. */
40 39
     protected static final String FORMAT_ERROR = "commandError";
41
-
42 40
     /** The controller this command is associated with. */
43 41
     private final CommandController controller;
44 42
 
@@ -52,13 +50,14 @@ public abstract class Command {
52 50
 
53 51
     /**
54 52
      * Sends a line, if appropriate, to the specified target.
55
-     * @param target The command window to send the line to
53
+     *
54
+     * @param target   The command window to send the line to
56 55
      * @param isSilent Whether this command is being silenced or not
57
-     * @param type The type of message to send
58
-     * @param args The arguments of the message
56
+     * @param type     The type of message to send
57
+     * @param args     The arguments of the message
59 58
      */
60 59
     protected final void sendLine(final FrameContainer target,
61
-            final boolean isSilent, final String type, final Object ... args) {
60
+            final boolean isSilent, final String type, final Object... args) {
62 61
         if (!isSilent && target != null) {
63 62
             target.addLine(type, args);
64 63
         }
@@ -67,10 +66,10 @@ public abstract class Command {
67 66
     /**
68 67
      * Sends a usage line, if appropriate, to the specified target.
69 68
      *
70
-     * @param target The command window to send the line to
69
+     * @param target   The command window to send the line to
71 70
      * @param isSilent Whether this command is being silenced or not
72
-     * @param name The name of the command that's raising the error
73
-     * @param args The arguments that the command accepts or expects
71
+     * @param name     The name of the command that's raising the error
72
+     * @param args     The arguments that the command accepts or expects
74 73
      */
75 74
     protected final void showUsage(final FrameContainer target,
76 75
             final boolean isSilent, final String name, final String args) {
@@ -80,12 +79,12 @@ public abstract class Command {
80 79
     }
81 80
 
82 81
     /**
83
-     * Formats the specified data into a table suitable for output in the
84
-     * textpane. It is expected that each String[] in data has the same number
85
-     * of elements as the headers array.
82
+     * Formats the specified data into a table suitable for output in the textpane. It is expected
83
+     * that each String[] in data has the same number of elements as the headers array.
86 84
      *
87 85
      * @param headers The headers of the table.
88
-     * @param data The contents of the table.
86
+     * @param data    The contents of the table.
87
+     *
89 88
      * @return A string containing an ASCII table
90 89
      */
91 90
     protected static String doTable(final String[] headers, final String[][] data) {
@@ -118,12 +117,11 @@ public abstract class Command {
118 117
     }
119 118
 
120 119
     /**
121
-     * Adds the specified data to the stringbuilder, padding with spaces to
122
-     * the specified size.
120
+     * Adds the specified data to the stringbuilder, padding with spaces to the specified size.
123 121
      *
124 122
      * @param builder The stringbuilder to append data to
125
-     * @param data The data to be added
126
-     * @param size The minimum size that should be used
123
+     * @param data    The data to be added
124
+     * @param size    The minimum size that should be used
127 125
      */
128 126
     private static void doPadding(final StringBuilder builder, final String data,
129 127
             final int size) {
@@ -137,9 +135,10 @@ public abstract class Command {
137 135
     /**
138 136
      * Executes this command.
139 137
      *
140
-     * @param origin The container which received the command
141
-     * @param args Arguments passed to this command
138
+     * @param origin  The container which received the command
139
+     * @param args    Arguments passed to this command
142 140
      * @param context The context the command was executed in
141
+     *
143 142
      * @since 0.6.4
144 143
      */
145 144
     public abstract void execute(FrameContainer origin,

+ 44
- 3
src/com/dmdirc/commandparser/commands/CommandModule.java View File

@@ -85,6 +85,7 @@ public class CommandModule {
85 85
      * Provides the /me command.
86 86
      *
87 87
      * @param command The instantiated command.
88
+     *
88 89
      * @return The command's details.
89 90
      */
90 91
     @Provides(type = Provides.Type.SET)
@@ -96,6 +97,7 @@ public class CommandModule {
96 97
      * Provides the /ban command.
97 98
      *
98 99
      * @param command The instantiated command.
100
+     *
99 101
      * @return The command's details.
100 102
      */
101 103
     @Provides(type = Provides.Type.SET)
@@ -107,6 +109,7 @@ public class CommandModule {
107 109
      * Provides the /cycle command.
108 110
      *
109 111
      * @param command The instantiated command.
112
+     *
110 113
      * @return The command's details.
111 114
      */
112 115
     @Provides(type = Provides.Type.SET)
@@ -118,6 +121,7 @@ public class CommandModule {
118 121
      * Provides the /invite command.
119 122
      *
120 123
      * @param command The instantiated command.
124
+     *
121 125
      * @return The command's details.
122 126
      */
123 127
     @Provides(type = Provides.Type.SET)
@@ -129,6 +133,7 @@ public class CommandModule {
129 133
      * Provides the /kick command.
130 134
      *
131 135
      * @param command The instantiated command.
136
+     *
132 137
      * @return The command's details.
133 138
      */
134 139
     @Provides(type = Provides.Type.SET)
@@ -140,6 +145,7 @@ public class CommandModule {
140 145
      * Provides the /mode command.
141 146
      *
142 147
      * @param command The instantiated command.
148
+     *
143 149
      * @return The command's details.
144 150
      */
145 151
     @Provides(type = Provides.Type.SET)
@@ -151,6 +157,7 @@ public class CommandModule {
151 157
      * Provides the /names command.
152 158
      *
153 159
      * @param command The instantiated command.
160
+     *
154 161
      * @return The command's details.
155 162
      */
156 163
     @Provides(type = Provides.Type.SET)
@@ -162,6 +169,7 @@ public class CommandModule {
162 169
      * Provides the /part command.
163 170
      *
164 171
      * @param command The instantiated command.
172
+     *
165 173
      * @return The command's details.
166 174
      */
167 175
     @Provides(type = Provides.Type.SET)
@@ -173,6 +181,7 @@ public class CommandModule {
173 181
      * Provides the /setnickcolour command.
174 182
      *
175 183
      * @param command The instantiated command.
184
+     *
176 185
      * @return The command's details.
177 186
      */
178 187
     @Provides(type = Provides.Type.SET)
@@ -184,6 +193,7 @@ public class CommandModule {
184 193
      * Provides the /topic command.
185 194
      *
186 195
      * @param command The instantiated command.
196
+     *
187 197
      * @return The command's details.
188 198
      */
189 199
     @Provides(type = Provides.Type.SET)
@@ -195,6 +205,7 @@ public class CommandModule {
195 205
      * Provides the /allchannels command.
196 206
      *
197 207
      * @param command The instantiated command.
208
+     *
198 209
      * @return The command's details.
199 210
      */
200 211
     @Provides(type = Provides.Type.SET)
@@ -206,6 +217,7 @@ public class CommandModule {
206 217
      * Provides the /away command.
207 218
      *
208 219
      * @param command The instantiated command.
220
+     *
209 221
      * @return The command's details.
210 222
      */
211 223
     @Provides(type = Provides.Type.SET)
@@ -217,6 +229,7 @@ public class CommandModule {
217 229
      * Provides the /back command.
218 230
      *
219 231
      * @param command The instantiated command.
232
+     *
220 233
      * @return The command's details.
221 234
      */
222 235
     @Provides(type = Provides.Type.SET)
@@ -228,6 +241,7 @@ public class CommandModule {
228 241
      * Provides the /server command.
229 242
      *
230 243
      * @param command The instantiated command.
244
+     *
231 245
      * @return The command's details.
232 246
      */
233 247
     @Provides(type = Provides.Type.SET)
@@ -239,6 +253,7 @@ public class CommandModule {
239 253
      * Provides the /ctcp command.
240 254
      *
241 255
      * @param command The instantiated command.
256
+     *
242 257
      * @return The command's details.
243 258
      */
244 259
     @Provides(type = Provides.Type.SET)
@@ -250,6 +265,7 @@ public class CommandModule {
250 265
      * Provides the /disconnect command.
251 266
      *
252 267
      * @param command The instantiated command.
268
+     *
253 269
      * @return The command's details.
254 270
      */
255 271
     @Provides(type = Provides.Type.SET)
@@ -261,6 +277,7 @@ public class CommandModule {
261 277
      * Provides the /ignore command.
262 278
      *
263 279
      * @param command The instantiated command.
280
+     *
264 281
      * @return The command's details.
265 282
      */
266 283
     @Provides(type = Provides.Type.SET)
@@ -272,6 +289,7 @@ public class CommandModule {
272 289
      * Provides the /join command.
273 290
      *
274 291
      * @param command The instantiated command.
292
+     *
275 293
      * @return The command's details.
276 294
      */
277 295
     @Provides(type = Provides.Type.SET)
@@ -283,6 +301,7 @@ public class CommandModule {
283 301
      * Provides the /msg command.
284 302
      *
285 303
      * @param command The instantiated command.
304
+     *
286 305
      * @return The command's details.
287 306
      */
288 307
     @Provides(type = Provides.Type.SET)
@@ -294,6 +313,7 @@ public class CommandModule {
294 313
      * Provides the /nick command.
295 314
      *
296 315
      * @param command The instantiated command.
316
+     *
297 317
      * @return The command's details.
298 318
      */
299 319
     @Provides(type = Provides.Type.SET)
@@ -305,6 +325,7 @@ public class CommandModule {
305 325
      * Provides the /notice command.
306 326
      *
307 327
      * @param command The instantiated command.
328
+     *
308 329
      * @return The command's details.
309 330
      */
310 331
     @Provides(type = Provides.Type.SET)
@@ -316,6 +337,7 @@ public class CommandModule {
316 337
      * Provides the /query command.
317 338
      *
318 339
      * @param command The instantiated command.
340
+     *
319 341
      * @return The command's details.
320 342
      */
321 343
     @Provides(type = Provides.Type.SET)
@@ -327,6 +349,7 @@ public class CommandModule {
327 349
      * Provides the /raw command.
328 350
      *
329 351
      * @param command The instantiated command.
352
+     *
330 353
      * @return The command's details.
331 354
      */
332 355
     @Provides(type = Provides.Type.SET)
@@ -338,6 +361,7 @@ public class CommandModule {
338 361
      * Provides the /reconnect command.
339 362
      *
340 363
      * @param command The instantiated command.
364
+     *
341 365
      * @return The command's details.
342 366
      */
343 367
     @Provides(type = Provides.Type.SET)
@@ -349,6 +373,7 @@ public class CommandModule {
349 373
      * Provides the /umode command.
350 374
      *
351 375
      * @param command The instantiated command.
376
+     *
352 377
      * @return The command's details.
353 378
      */
354 379
     @Provides(type = Provides.Type.SET)
@@ -360,12 +385,13 @@ public class CommandModule {
360 385
      * Provides a set of raw commands.
361 386
      *
362 387
      * @param controller The controller to use for command info.
388
+     *
363 389
      * @return A set of the commands' details.
364 390
      */
365 391
     @Provides(type = Provides.Type.SET_VALUES)
366 392
     public Set<CommandDetails> getRawCommands(final CommandController controller) {
367 393
         final Set<CommandDetails> results = new HashSet<>();
368
-        for (String name : new String[] { "lusers", "map", "motd", "oper", "whois", "who" }) {
394
+        for (String name : new String[]{"lusers", "map", "motd", "oper", "whois", "who"}) {
369 395
             final RawServerCommand rawCommand = new RawServerCommand(controller, name);
370 396
             results.add(new SimpleCommandDetails(rawCommand, rawCommand));
371 397
         }
@@ -376,6 +402,7 @@ public class CommandModule {
376 402
      * Provides the /alias command.
377 403
      *
378 404
      * @param command The instantiated command.
405
+     *
379 406
      * @return The command's details.
380 407
      */
381 408
     @Provides(type = Provides.Type.SET)
@@ -387,6 +414,7 @@ public class CommandModule {
387 414
      * Provides the /allservers command.
388 415
      *
389 416
      * @param command The instantiated command.
417
+     *
390 418
      * @return The command's details.
391 419
      */
392 420
     @Provides(type = Provides.Type.SET)
@@ -398,6 +426,7 @@ public class CommandModule {
398 426
      * Provides the /clear command.
399 427
      *
400 428
      * @param command The instantiated command.
429
+     *
401 430
      * @return The command's details.
402 431
      */
403 432
     @Provides(type = Provides.Type.SET)
@@ -409,6 +438,7 @@ public class CommandModule {
409 438
      * Provides the /echo command.
410 439
      *
411 440
      * @param command The instantiated command.
441
+     *
412 442
      * @return The command's details.
413 443
      */
414 444
     @Provides(type = Provides.Type.SET)
@@ -420,6 +450,7 @@ public class CommandModule {
420 450
      * Provides the /exit command.
421 451
      *
422 452
      * @param command The instantiated command.
453
+     *
423 454
      * @return The command's details.
424 455
      */
425 456
     @Provides(type = Provides.Type.SET)
@@ -431,6 +462,7 @@ public class CommandModule {
431 462
      * Provides the /Help command.
432 463
      *
433 464
      * @param command The instantiated command.
465
+     *
434 466
      * @return The command's details.
435 467
      */
436 468
     @Provides(type = Provides.Type.SET)
@@ -442,6 +474,7 @@ public class CommandModule {
442 474
      * Provides the /ifplugin command.
443 475
      *
444 476
      * @param command The instantiated command.
477
+     *
445 478
      * @return The command's details.
446 479
      */
447 480
     @Provides(type = Provides.Type.SET)
@@ -453,6 +486,7 @@ public class CommandModule {
453 486
      * Provides the /newserver command.
454 487
      *
455 488
      * @param command The instantiated command.
489
+     *
456 490
      * @return The command's details.
457 491
      */
458 492
     @Provides(type = Provides.Type.SET)
@@ -464,6 +498,7 @@ public class CommandModule {
464 498
      * Provides the /notify command.
465 499
      *
466 500
      * @param command The instantiated command.
501
+     *
467 502
      * @return The command's details.
468 503
      */
469 504
     @Provides(type = Provides.Type.SET)
@@ -475,6 +510,7 @@ public class CommandModule {
475 510
      * Provides the /loadplugin command.
476 511
      *
477 512
      * @param command The instantiated command.
513
+     *
478 514
      * @return The command's details.
479 515
      */
480 516
     @Provides(type = Provides.Type.SET)
@@ -486,6 +522,7 @@ public class CommandModule {
486 522
      * Provides the /unloadplugin command.
487 523
      *
488 524
      * @param command The instantiated command.
525
+     *
489 526
      * @return The command's details.
490 527
      */
491 528
     @Provides(type = Provides.Type.SET)
@@ -497,6 +534,7 @@ public class CommandModule {
497 534
      * Provides the /openwindow command.
498 535
      *
499 536
      * @param command The instantiated command.
537
+     *
500 538
      * @return The command's details.
501 539
      */
502 540
     @Provides(type = Provides.Type.SET)
@@ -508,6 +546,7 @@ public class CommandModule {
508 546
      * Provides the /reloadactions command.
509 547
      *
510 548
      * @param command The instantiated command.
549
+     *
511 550
      * @return The command's details.
512 551
      */
513 552
     @Provides(type = Provides.Type.SET)
@@ -519,6 +558,7 @@ public class CommandModule {
519 558
      * Provides the /reloadidentities command.
520 559
      *
521 560
      * @param command The instantiated command.
561
+     *
522 562
      * @return The command's details.
523 563
      */
524 564
     @Provides(type = Provides.Type.SET)
@@ -530,6 +570,7 @@ public class CommandModule {
530 570
      * Provides the /reloadplugin command.
531 571
      *
532 572
      * @param command The instantiated command.
573
+     *
533 574
      * @return The command's details.
534 575
      */
535 576
     @Provides(type = Provides.Type.SET)
@@ -541,6 +582,7 @@ public class CommandModule {
541 582
      * Provides the /saveconfig command.
542 583
      *
543 584
      * @param command The instantiated command.
585
+     *
544 586
      * @return The command's details.
545 587
      */
546 588
     @Provides(type = Provides.Type.SET)
@@ -552,6 +594,7 @@ public class CommandModule {
552 594
      * Provides the /set command.
553 595
      *
554 596
      * @param command The instantiated command.
597
+     *
555 598
      * @return The command's details.
556 599
      */
557 600
     @Provides(type = Provides.Type.SET)
@@ -578,10 +621,8 @@ public class CommandModule {
578 621
         public CommandInfo getInfo() {
579 622
             return info;
580 623
         }
581
-
582 624
         /** The command. */
583 625
         private final Command command;
584
-
585 626
         /** The command's info. */
586 627
         private final CommandInfo info;
587 628
 

+ 7
- 6
src/com/dmdirc/commandparser/commands/ExternalCommand.java View File

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.commandparser.commands;
23 24
 
24 25
 import com.dmdirc.FrameContainer;
@@ -26,19 +27,19 @@ import com.dmdirc.Server;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 
28 29
 /**
29
- * An external command is a channel command that can be executed from outside
30
- * of the channel.
30
+ * An external command is a channel command that can be executed from outside of the channel.
31 31
  */
32 32
 public interface ExternalCommand {
33 33
 
34 34
     /**
35 35
      * Executes the command externally.
36 36
      *
37
-     * @param origin The window in which the command was typed
38
-     * @param server The server instance that this command is being executed on
39
-     * @param channel The name of the channel the command is being executed for
37
+     * @param origin   The window in which the command was typed
38
+     * @param server   The server instance that this command is being executed on
39
+     * @param channel  The name of the channel the command is being executed for
40 40
      * @param isSilent Whether this command is silenced or not
41
-     * @param args Arguments passed to this command
41
+     * @param args     Arguments passed to this command
42
+     *
42 43
      * @since 0.6.3m1
43 44
      */
44 45
     void execute(FrameContainer origin, Server server, String channel,

+ 7
- 8
src/com/dmdirc/commandparser/commands/IntelligentCommand.java View File

@@ -28,18 +28,19 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
28 28
 import java.util.List;
29 29
 
30 30
 /**
31
- * Intelligent commands implement a method that provides a list of possible
32
- * options for them, for use (for example) by table completers.
31
+ * Intelligent commands implement a method that provides a list of possible options for them, for
32
+ * use (for example) by table completers.
33 33
  */
34 34
 public interface IntelligentCommand {
35 35
 
36 36
     /**
37
-     * Returns a list of suggestions for the specified argument, given the
38
-     * specified context.
37
+     * Returns a list of suggestions for the specified argument, given the specified context.
39 38
      *
40
-     * @param arg The argument that is being completed
39
+     * @param arg     The argument that is being completed
41 40
      * @param context The context in which suggestions are being sought
41
+     *
42 42
      * @return A list of suggestions for the argument
43
+     *
43 44
      * @since 0.6.4
44 45
      */
45 46
     AdditionalTabTargets getSuggestions(int arg, IntelligentCommandContext context);
@@ -70,15 +71,13 @@ public interface IntelligentCommand {
70 71
         public String getPartial() {
71 72
             return partial;
72 73
         }
73
-
74 74
         /** The window the command is being entered in. */
75 75
         private final WritableFrameContainer window;
76
-
77 76
         /** The previously supplied arguments, if any. */
78 77
         private final List<String> previousArgs;
79
-
80 78
         /** The partially typed word, if any. */
81 79
         private final String partial;
82 80
 
83 81
     }
82
+
84 83
 }

+ 0
- 1
src/com/dmdirc/commandparser/commands/PreviousCommand.java View File

@@ -32,7 +32,6 @@ public final class PreviousCommand {
32 32
 
33 33
     /** The full command that was executed. */
34 34
     private final String line;
35
-
36 35
     /** The timestamp of its execution. */
37 36
     private final long time = new Date().getTime();
38 37
 

+ 6
- 3
src/com/dmdirc/commandparser/commands/ValidatingCommand.java View File

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.commandparser.commands;
23 24
 
24 25
 import com.dmdirc.WritableFrameContainer;
@@ -26,17 +27,19 @@ import com.dmdirc.commandparser.CommandArguments;
26 27
 import com.dmdirc.util.validators.ValidationResponse;
27 28
 
28 29
 /**
29
- * Validating commands are capable of validating their arguments to determine
30
- * whether the input would be valid or not.
30
+ * Validating commands are capable of validating their arguments to determine whether the input
31
+ * would be valid or not.
31 32
  */
32 33
 public interface ValidatingCommand {
33 34
 
34 35
     /**
35 36
      * Validates the specified arguments.
36 37
      *
37
-     * @param origin The window the command is being executed in
38
+     * @param origin    The window the command is being executed in
38 39
      * @param arguments The arguments that the user has entered (so far)
40
+     *
39 41
      * @return A validation response indicating the validity of the arguments
42
+     *
40 43
      * @since 0.6.3m1
41 44
      */
42 45
     ValidationResponse validateArguments(WritableFrameContainer origin,

+ 5
- 5
src/com/dmdirc/commandparser/commands/WrappableCommand.java View File

@@ -26,18 +26,18 @@ import com.dmdirc.WritableFrameContainer;
26 26
 import com.dmdirc.commandparser.CommandArguments;
27 27
 
28 28
 /**
29
- * Wrapping commands are commands whose arguments may be wrapped into multiple
30
- * lines when sending.
29
+ * Wrapping commands are commands whose arguments may be wrapped into multiple lines when sending.
31 30
  */
32 31
 public interface WrappableCommand {
33 32
 
34 33
     /**
35
-     * Determines the number of lines that the specified arguments will be
36
-     * wrapped as.
34
+     * Determines the number of lines that the specified arguments will be wrapped as.
37 35
      *
38
-     * @param origin The window the command is being executed in
36
+     * @param origin    The window the command is being executed in
39 37
      * @param arguments The arguments that the user has entered (so far)
38
+     *
40 39
      * @return The number of lines that the arguments will result in
40
+     *
41 41
      * @since 0.6.3m1
42 42
      */
43 43
     int getLineCount(WritableFrameContainer origin, CommandArguments arguments);

+ 1
- 0
src/com/dmdirc/commandparser/commands/channel/Ban.java View File

@@ -93,4 +93,5 @@ public class Ban extends Command implements IntelligentCommand {
93 93
 
94 94
         return res;
95 95
     }
96
+
96 97
 }

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/KickReason.java View File

@@ -41,8 +41,8 @@ import com.dmdirc.ui.input.TabCompletionType;
41 41
 import javax.inject.Inject;
42 42
 
43 43
 /**
44
- * The kick command kicks a specified user from the channel.
45
- * This version allows the user to specify a reason.
44
+ * The kick command kicks a specified user from the channel. This version allows the user to specify
45
+ * a reason.
46 46
  */
47 47
 @CommandOptions(allowOffline = false)
48 48
 public class KickReason extends Command implements IntelligentCommand {

+ 1
- 1
src/com/dmdirc/commandparser/commands/channel/Part.java View File

@@ -39,7 +39,7 @@ import javax.inject.Inject;
39 39
 /**
40 40
  * The part command parts the current channel with a specified part message.
41 41
  */
42
-@CommandOptions(allowOffline=false)
42
+@CommandOptions(allowOffline = false)
43 43
 public class Part extends Command {
44 44
 
45 45
     /** A command info object for this command. */

+ 5
- 4
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java View File

@@ -52,14 +52,13 @@ public class SetNickColour extends Command implements IntelligentCommand {
52 52
             "setnickcolour [--nicklist|--text] <nick> [colour] - "
53 53
             + "set the specified person's display colour",
54 54
             CommandType.TYPE_CHANNEL);
55
-
56 55
     /** Manager to use to convert colours. */
57 56
     private final ColourManager colourManager;
58 57
 
59 58
     /**
60 59
      * Creates a new instance of the {@link SetNickColour} command.
61 60
      *
62
-     * @param controller The command controller that owns this command.
61
+     * @param controller    The command controller that owns this command.
63 62
      * @param colourManager The colour manager to use to convert colours.
64 63
      */
65 64
     @Inject
@@ -89,7 +88,8 @@ public class SetNickColour extends Command implements IntelligentCommand {
89 88
         }
90 89
 
91 90
         if (args.getArguments().length <= offset) {
92
-            showUsage(origin, args.isSilent(), "setnickcolour", "[--nicklist|--text] <nick> [colour]");
91
+            showUsage(origin, args.isSilent(), "setnickcolour",
92
+                    "[--nicklist|--text] <nick> [colour]");
93 93
             return;
94 94
         }
95 95
 
@@ -112,7 +112,8 @@ public class SetNickColour extends Command implements IntelligentCommand {
112 112
             channel.refreshClients();
113 113
         } else {
114 114
             // We're setting the colour
115
-            final Colour newColour = colourManager.getColourFromString(args.getArguments()[offset], null);
115
+            final Colour newColour = colourManager.getColourFromString(args.getArguments()[offset],
116
+                    null);
116 117
             if (newColour == null) {
117 118
                 sendLine(origin, args.isSilent(), FORMAT_ERROR, "Invalid colour specified.");
118 119
                 return;

+ 5
- 3
src/com/dmdirc/commandparser/commands/channel/ShowTopic.java View File

@@ -42,7 +42,7 @@ import javax.inject.Inject;
42 42
 /**
43 43
  * The show topic command shows the user the current topic.
44 44
  */
45
-@CommandOptions(allowOffline=false)
45
+@CommandOptions(allowOffline = false)
46 46
 public class ShowTopic extends Command implements ExternalCommand {
47 47
 
48 48
     /** A command info object for this command. */
@@ -71,7 +71,8 @@ public class ShowTopic extends Command implements ExternalCommand {
71 71
             if (cChannel.getTopic().isEmpty()) {
72 72
                 sendLine(origin, args.isSilent(), "channelNoTopic", cChannel);
73 73
             } else {
74
-                final String[] parts = channel.getConnection().parseHostmask(cChannel.getTopicSetter());
74
+                final String[] parts = channel.getConnection().parseHostmask(cChannel.
75
+                        getTopicSetter());
75 76
 
76 77
                 sendLine(origin, args.isSilent(), "channelTopicDiscovered",
77 78
                         "", parts[0], parts[1], parts[2], cChannel.getTopic(),
@@ -89,7 +90,8 @@ public class ShowTopic extends Command implements ExternalCommand {
89 90
         if (args.getArguments().length == 0) {
90 91
             server.getParser().sendRawMessage("TOPIC " + channel);
91 92
         } else {
92
-            server.getParser().sendRawMessage("TOPIC " + channel + " :" + args.getArgumentsAsString());
93
+            server.getParser().sendRawMessage("TOPIC " + channel + " :" + args.
94
+                    getArgumentsAsString());
93 95
         }
94 96
     }
95 97
 

+ 1
- 0
src/com/dmdirc/commandparser/commands/chat/Me.java View File

@@ -90,4 +90,5 @@ public class Me extends Command implements ValidatingCommand {
90 90
             return new ValidationResponse();
91 91
         }
92 92
     }
93
+
93 94
 }

+ 3
- 4
src/com/dmdirc/commandparser/commands/context/ChannelCommandContext.java View File

@@ -39,10 +39,9 @@ public class ChannelCommandContext extends ChatCommandContext {
39 39
     /**
40 40
      * Creates a new channel command context.
41 41
      *
42
-     * @param source The source of the command
43
-     * @param commandInfo The command info object which associated the command
44
-     * with the input
45
-     * @param channel The channel associated with the command
42
+     * @param source      The source of the command
43
+     * @param commandInfo The command info object which associated the command with the input
44
+     * @param channel     The channel associated with the command
46 45
      */
47 46
     public ChannelCommandContext(final FrameContainer source,
48 47
             final CommandInfo commandInfo, final Channel channel) {

+ 3
- 2
src/com/dmdirc/commandparser/commands/context/ChatCommandContext.java View File

@@ -40,9 +40,9 @@ public class ChatCommandContext extends ServerCommandContext {
40 40
     /**
41 41
      * Creates a new chat command context.
42 42
      *
43
-     * @param source The source of the command
43
+     * @param source      The source of the command
44 44
      * @param commandInfo The command info object which associated the command with the input
45
-     * @param chat The chat container associated with the command
45
+     * @param chat        The chat container associated with the command
46 46
      */
47 47
     public ChatCommandContext(final FrameContainer source,
48 48
             final CommandInfo commandInfo, final MessageTarget chat) {
@@ -58,4 +58,5 @@ public class ChatCommandContext extends ServerCommandContext {
58 58
     public MessageTarget getChat() {
59 59
         return chat;
60 60
     }
61
+
61 62
 }

+ 3
- 4
src/com/dmdirc/commandparser/commands/context/CommandContext.java View File

@@ -34,14 +34,13 @@ public class CommandContext {
34 34
 
35 35
     /** The command info object which associated the command with the input. */
36 36
     protected final CommandInfo commandInfo;
37
-
38 37
     /** The source of this command. */
39 38
     protected final FrameContainer source;
40 39
 
41 40
     /**
42 41
      * Creates a new command context.
43 42
      *
44
-     * @param source The source of the command
43
+     * @param source      The source of the command
45 44
      * @param commandInfo The command info object which associated the command with the input
46 45
      */
47 46
     public CommandContext(final FrameContainer source, final CommandInfo commandInfo) {
@@ -50,8 +49,8 @@ public class CommandContext {
50 49
     }
51 50
 
52 51
     /**
53
-     * Retrieves the command information object which caused the command to
54
-     * be selected in response to the user's input.
52
+     * Retrieves the command information object which caused the command to be selected in response
53
+     * to the user's input.
55 54
      *
56 55
      * @return The relevant command info object
57 56
      */

+ 3
- 4
src/com/dmdirc/commandparser/commands/context/QueryCommandContext.java View File

@@ -39,10 +39,9 @@ public class QueryCommandContext extends ChatCommandContext {
39 39
     /**
40 40
      * Creates a new query command context.
41 41
      *
42
-     * @param source The source of the command
43
-     * @param commandInfo The command info object which associated the command
44
-     * with the input
45
-     * @param query The query associated with the command
42
+     * @param source      The source of the command
43
+     * @param commandInfo The command info object which associated the command with the input
44
+     * @param query       The query associated with the command
46 45
      */
47 46
     public QueryCommandContext(final FrameContainer source,
48 47
             final CommandInfo commandInfo, final Query query) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/context/ServerCommandContext.java View File

@@ -39,9 +39,9 @@ public class ServerCommandContext extends CommandContext {
39 39
     /**
40 40
      * Creates a new server command context.
41 41
      *
42
-     * @param source The source of the command
42
+     * @param source      The source of the command
43 43
      * @param commandInfo The command info object which associated the command with the input
44
-     * @param server The server associated with the command
44
+     * @param server      The server associated with the command
45 45
      */
46 46
     public ServerCommandContext(final FrameContainer source, final CommandInfo commandInfo,
47 47
             final Server server) {

+ 14
- 18
src/com/dmdirc/commandparser/commands/flags/CommandFlag.java View File

@@ -29,11 +29,10 @@ import java.util.LinkedList;
29 29
 import java.util.List;
30 30
 
31 31
 /**
32
- * Describes a flag that may be used in a command. Each flag may be enabled
33
- * or disabled initially, can specify a number of immediate arguments (which
34
- * must follow the flag directly), a number of delayed arguments (which
35
- * are specified after any other flags), and a list of other flags that
36
- * the use of this one causes to be enabled or disabled.
32
+ * Describes a flag that may be used in a command. Each flag may be enabled or disabled initially,
33
+ * can specify a number of immediate arguments (which must follow the flag directly), a number of
34
+ * delayed arguments (which are specified after any other flags), and a list of other flags that the
35
+ * use of this one causes to be enabled or disabled.
37 36
  *
38 37
  * @since 0.6.5
39 38
  * @see CommandFlagHandler
@@ -65,7 +64,7 @@ public class CommandFlag {
65 64
     /**
66 65
      * Creates a new flag with the specified name and no arguments.
67 66
      *
68
-     * @param name The name of this flag
67
+     * @param name    The name of this flag
69 68
      * @param enabled Whether or not this flag is initially enabled
70 69
      */
71 70
     public CommandFlag(final String name, final boolean enabled) {
@@ -73,14 +72,13 @@ public class CommandFlag {
73 72
     }
74 73
 
75 74
     /**
76
-     * Creates a new flag with the specified name and the specified number
77
-     * of arguments. Flags may only use immediate OR delayed arguments, not
78
-     * both.
75
+     * Creates a new flag with the specified name and the specified number of arguments. Flags may
76
+     * only use immediate OR delayed arguments, not both.
79 77
      *
80
-     * @param name The name of this flag
81
-     * @param enabled Whether or not this flag is initially enabled
78
+     * @param name          The name of this flag
79
+     * @param enabled       Whether or not this flag is initially enabled
82 80
      * @param immediateArgs The number of immediate arguments
83
-     * @param delayedArgs The number of delayed arguments
81
+     * @param delayedArgs   The number of delayed arguments
84 82
      */
85 83
     public CommandFlag(final String name, final boolean enabled,
86 84
             final int immediateArgs, final int delayedArgs) {
@@ -95,22 +93,20 @@ public class CommandFlag {
95 93
     }
96 94
 
97 95
     /**
98
-     * Indicates that the specified flags will be enabled if this flag
99
-     * is used.
96
+     * Indicates that the specified flags will be enabled if this flag is used.
100 97
      *
101 98
      * @param enabled The flags which will be enabled
102 99
      */
103
-    public void addEnabled(final CommandFlag ... enabled) {
100
+    public void addEnabled(final CommandFlag... enabled) {
104 101
         this.enables.addAll(Arrays.asList(enabled));
105 102
     }
106 103
 
107 104
     /**
108
-     * Indicates that the specified flags will be disabled if this flag
109
-     * is used.
105
+     * Indicates that the specified flags will be disabled if this flag is used.
110 106
      *
111 107
      * @param disabled The flags which will be disabled
112 108
      */
113
-    public void addDisabled(final CommandFlag ... disabled) {
109
+    public void addDisabled(final CommandFlag... disabled) {
114 110
         this.disables.addAll(Arrays.asList(disabled));
115 111
     }
116 112
 

+ 37
- 35
src/com/dmdirc/commandparser/commands/flags/CommandFlagHandler.java View File

@@ -32,8 +32,8 @@ import java.util.List;
32 32
 import java.util.Map;
33 33
 
34 34
 /**
35
- * Utility class for commands which allow the user to specify shell-like
36
- * flags (<code>--foo</code>).
35
+ * Utility class for commands which allow the user to specify shell-like flags (
36
+ * <code>--foo</code>).
37 37
  *
38 38
  * @since 0.6.5
39 39
  */
@@ -49,27 +49,27 @@ public class CommandFlagHandler {
49 49
     private final Map<String, CommandFlag> disabledBy = new HashMap<>();
50 50
 
51 51
     /**
52
-     * Creates a new command flag handler which will handle all of the specified
53
-     * flags.
52
+     * Creates a new command flag handler which will handle all of the specified flags.
54 53
      *
55 54
      * @param flags The flags that will be handled
56 55
      */
57
-    public CommandFlagHandler(final CommandFlag ... flags) {
56
+    public CommandFlagHandler(final CommandFlag... flags) {
58 57
         for (CommandFlag flag : flags) {
59 58
             this.flags.put(flag.getName(), flag);
60 59
         }
61 60
     }
62 61
 
63 62
     /**
64
-     * Processes the specified arguments and parses out command flags. If
65
-     * the specified arguments aren't valid given the flags belonging to
66
-     * this command flag handler, an error message is sent to the origin and
63
+     * Processes the specified arguments and parses out command flags. If the specified arguments
64
+     * aren't valid given the flags belonging to this command flag handler, an error message is sent
65
+     * to the origin and
67 66
      * <code>null</code> is returned from this method.
68 67
      *
69
-     * @param origin The container where the command was entered
68
+     * @param origin    The container where the command was entered
70 69
      * @param arguments The arguments passed to the command
71
-     * @return A corresponding {@link CommandFlagResult} object, or null
72
-     * if some problem was encountered.
70
+     *
71
+     * @return A corresponding {@link CommandFlagResult} object, or null if some problem was
72
+     *         encountered.
73 73
      */
74 74
     public CommandFlagResult process(final FrameContainer origin,
75 75
             final CommandArguments arguments) {
@@ -79,14 +79,14 @@ public class CommandFlagHandler {
79 79
     }
80 80
 
81 81
     /**
82
-     * Parses the specified arguments and returns the offsets of the arguments
83
-     * for each found command flag.
82
+     * Parses the specified arguments and returns the offsets of the arguments for each found
83
+     * command flag.
84 84
      *
85
-     * @param origin The container where the command was entered
85
+     * @param origin    The container where the command was entered
86 86
      * @param arguments The arguments passed to the command
87
-     * @return A map of discovered command flags to the offset of the flag's
88
-     * first argument within the <code>arguments</code> object. If an error
89
-     * occurs, null is returned.
87
+     *
88
+     * @return A map of discovered command flags to the offset of the flag's first argument within
89
+     *         the <code>arguments</code> object. If an error occurs, null is returned.
90 90
      */
91 91
     protected Map<CommandFlag, Integer> parse(final FrameContainer origin,
92 92
             final CommandArguments arguments) {
@@ -160,14 +160,15 @@ public class CommandFlagHandler {
160 160
     /**
161 161
      * Reads the arguments for the specified flag.
162 162
      *
163
-     * @param flag The flag that is being read
163
+     * @param flag      The flag that is being read
164 164
      * @param arguments The raw arguments for the command
165
-     * @param offset The index that the first argument will be at
166
-     * @param argCount The number of arguments that need to be read
167
-     * @param origin The source of the command (for error messages)
168
-     * @param results The map to place results into
169
-     * @return The index of the last argument that was handled, or -1 if
170
-     * there were insufficient arguments for the flag
165
+     * @param offset    The index that the first argument will be at
166
+     * @param argCount  The number of arguments that need to be read
167
+     * @param origin    The source of the command (for error messages)
168
+     * @param results   The map to place results into
169
+     *
170
+     * @return The index of the last argument that was handled, or -1 if there were insufficient
171
+     *         arguments for the flag
171 172
      */
172 173
     protected int readArguments(final CommandFlag flag,
173 174
             final CommandArguments arguments, final int offset, final int argCount,
@@ -188,8 +189,8 @@ public class CommandFlagHandler {
188 189
     }
189 190
 
190 191
     /**
191
-     * Processes the enabled and disabled lists for the specified flag, and
192
-     * adds them to the relevant properties.
192
+     * Processes the enabled and disabled lists for the specified flag, and adds them to the
193
+     * relevant properties.
193 194
      *
194 195
      * @param flag The flag whose enables/disables lists should be processed
195 196
      */
@@ -212,13 +213,13 @@ public class CommandFlagHandler {
212 213
     }
213 214
 
214 215
     /**
215
-     * Constructs a user-friendly string describing the flag(s) which must
216
-     * be used in order to enable the specified flag. This is useful for
217
-     * error messages when the user tries to use a disabled flag.
216
+     * Constructs a user-friendly string describing the flag(s) which must be used in order to
217
+     * enable the specified flag. This is useful for error messages when the user tries to use a
218
+     * disabled flag.
218 219
      *
219 220
      * @param flag The flag to find enablers for
220
-     * @return A user-friendly string describing flags which enable the
221
-     * specified flag.
221
+     *
222
+     * @return A user-friendly string describing flags which enable the specified flag.
222 223
      */
223 224
     protected String getEnablers(final CommandFlag flag) {
224 225
         final List<CommandFlag> enablers = new LinkedList<>();
@@ -246,15 +247,16 @@ public class CommandFlagHandler {
246 247
     /**
247 248
      * Convenience method to send a line to the specified frame container.
248 249
      *
249
-     * @param origin The container to send the line to
250
-     * @param isSilent Whether the command is silenced or not
250
+     * @param origin      The container to send the line to
251
+     * @param isSilent    Whether the command is silenced or not
251 252
      * @param messageType The type of the line to be sent
252
-     * @param args The arguments for the specified messageType
253
+     * @param args        The arguments for the specified messageType
253 254
      */
254 255
     protected static void sendLine(final FrameContainer origin, final boolean isSilent,
255
-            final String messageType, final Object ... args) {
256
+            final String messageType, final Object... args) {
256 257
         if (origin != null && !isSilent) {
257 258
             origin.addLine(messageType, args);
258 259
         }
259 260
     }
261
+
260 262
 }

+ 13
- 10
src/com/dmdirc/commandparser/commands/flags/CommandFlagResult.java View File

@@ -27,14 +27,12 @@ import com.dmdirc.commandparser.CommandArguments;
27 27
 import java.util.Map;
28 28
 
29 29
 /**
30
- * Convenient wrapper around the results of a {@link CommandFlagHandler}'s
31
- * parsing routines.
30
+ * Convenient wrapper around the results of a {@link CommandFlagHandler}'s parsing routines.
32 31
  */
33 32
 public class CommandFlagResult {
34 33
 
35 34
     /** The original arguments for the command. */
36 35
     private final CommandArguments arguments;
37
-
38 36
     /** The offsets of the first argument for each flag. */
39 37
     private final Map<CommandFlag, Integer> offsets;
40 38
 
@@ -42,7 +40,7 @@ public class CommandFlagResult {
42 40
      * Creates a new CommandFlagResult with the specified results.
43 41
      *
44 42
      * @param arguments The original arguments for the command
45
-     * @param offsets The offsets for each flag's arguments
43
+     * @param offsets   The offsets for each flag's arguments
46 44
      */
47 45
     public CommandFlagResult(final CommandArguments arguments,
48 46
             final Map<CommandFlag, Integer> offsets) {
@@ -51,10 +49,10 @@ public class CommandFlagResult {
51 49
     }
52 50
 
53 51
     /**
54
-     * Determines if the specified command flag has been used when the command
55
-     * was executed.
52
+     * Determines if the specified command flag has been used when the command was executed.
56 53
      *
57 54
      * @param flag The flag to be checked
55
+     *
58 56
      * @return True iff the flag was specified legally, false otherwise
59 57
      */
60 58
     public boolean hasFlag(final CommandFlag flag) {
@@ -65,7 +63,9 @@ public class CommandFlagResult {
65 63
      * Retrieves all of the arguments passed for the specified flag as a string.
66 64
      *
67 65
      * @param flag The flag to retrieve arguments for
66
+     *
68 67
      * @return The arguments passed with the specified flag
68
+     *
69 69
      * @see #getArguments(com.dmdirc.commandparser.commands.flags.CommandFlag)
70 70
      */
71 71
     public String getArgumentsAsString(final CommandFlag flag) {
@@ -87,13 +87,14 @@ public class CommandFlagResult {
87 87
     }
88 88
 
89 89
     /**
90
-     * Retrieves a subset of the arguments not associated with any flags,
91
-     * starting at the specified offset.
90
+     * Retrieves a subset of the arguments not associated with any flags, starting at the specified
91
+     * offset.
92 92
      *
93 93
      * @see CommandArguments#getArgumentsAsString(int)
94 94
      * @param offset The offset of the argument to start at
95
-     * @return All arguments that aren't associated with a flag, as a string,
96
-     * starting with the argument at the specified offset
95
+     *
96
+     * @return All arguments that aren't associated with a flag, as a string, starting with the
97
+     *         argument at the specified offset
97 98
      */
98 99
     public String getArgumentsAsString(final int offset) {
99 100
         return arguments.getArgumentsAsString(offsets.get(null) + offset);
@@ -103,7 +104,9 @@ public class CommandFlagResult {
103 104
      * Retrieves the arguments passed with the specified flag as an array.
104 105
      *
105 106
      * @param flag The flag to be checked
107
+     *
106 108
      * @return The arguments passed with the specified flag
109
+     *
107 110
      * @see #getArgumentsAsString(com.dmdirc.commandparser.commands.flags.CommandFlag)
108 111
      */
109 112
     public String[] getArguments(final CommandFlag flag) {

+ 4
- 6
src/com/dmdirc/commandparser/commands/global/AliasCommand.java View File

@@ -50,19 +50,17 @@ public class AliasCommand extends Command implements IntelligentCommand {
50 50
     public static final CommandInfo INFO = new BaseCommandInfo("alias",
51 51
             "alias [--remove] <name> [command] - creates or removes the specified alias",
52 52
             CommandType.TYPE_GLOBAL);
53
-
54 53
     /** Factory to use when creating aliases. */
55 54
     private final ActionFactory actionFactory;
56
-
57 55
     /** Wrapper to use to modify aliases. */
58 56
     private final AliasWrapper aliasWrapper;
59 57
 
60 58
     /**
61 59
      * Creates a new instance of {@link AliasCommand}.
62 60
      *
63
-     * @param controller The controller that owns this command.
61
+     * @param controller    The controller that owns this command.
64 62
      * @param actionFactory The factory to use when creating new aliases.
65
-     * @param aliasWrapper The wrapper to use to modify aliases.
63
+     * @param aliasWrapper  The wrapper to use to modify aliases.
66 64
      */
67 65
     @Inject
68 66
     public AliasCommand(
@@ -84,8 +82,7 @@ public class AliasCommand extends Command implements IntelligentCommand {
84 82
         }
85 83
 
86 84
         if (args.getArguments()[0].equalsIgnoreCase("--remove")) {
87
-            final String name
88
-                    = args.getArguments()[1].charAt(0)
85
+            final String name = args.getArguments()[1].charAt(0)
89 86
                     == getController().getCommandChar()
90 87
                     ? args.getArguments()[1].substring(1) : args.getArguments()[1];
91 88
 
@@ -124,6 +121,7 @@ public class AliasCommand extends Command implements IntelligentCommand {
124 121
      * Removes the alias with the specified name.
125 122
      *
126 123
      * @param name The name of the alias to remove
124
+     *
127 125
      * @return True if the alias was deleted, false otherwise
128 126
      */
129 127
     private boolean doRemove(final String name) {

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

@@ -47,14 +47,13 @@ public class AllServers extends Command implements IntelligentCommand {
47 47
     public static final CommandInfo INFO = new BaseCommandInfo("allservers",
48 48
             "allservers <command> - executes the command as though it had"
49 49
             + " been entered on all servers", CommandType.TYPE_GLOBAL);
50
-
51 50
     /** Server manager to use to iterate servers. */
52 51
     private final ServerManager serverManager;
53 52
 
54 53
     /**
55 54
      * Creates a new instance of the {@link AllServers} command.
56 55
      *
57
-     * @param controller The controller that owns this command.
56
+     * @param controller    The controller that owns this command.
58 57
      * @param serverManager The server manager to use to iterate servers.
59 58
      */
60 59
     @Inject

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

@@ -55,7 +55,6 @@ public class Echo extends Command implements IntelligentCommand {
55 55
             "echo [--ts <timestamp>] [--target <window>] <line> "
56 56
             + "- echos the specified line to the window",
57 57
             CommandType.TYPE_GLOBAL);
58
-
59 58
     /** The flag used to specify a timestamp for the echo command. */
60 59
     private final CommandFlag timeStampFlag = new CommandFlag("ts", true, 1, 0);
61 60
     /** The flag used to specify a target for the echo command. */
@@ -68,7 +67,7 @@ public class Echo extends Command implements IntelligentCommand {
68 67
     /**
69 68
      * Creates a new instance of Echo.
70 69
      *
71
-     * @param controller Command controller
70
+     * @param controller    Command controller
72 71
      * @param windowManager Window management
73 72
      */
74 73
     @Inject

+ 3
- 5
src/com/dmdirc/commandparser/commands/global/Exit.java View File

@@ -35,9 +35,8 @@ import com.dmdirc.interfaces.LifecycleController;
35 35
 import javax.inject.Inject;
36 36
 
37 37
 /**
38
- * The exit command allows the user to quit DMDirc with a custom quit message.
39
- * When the client quits, it disconnects all servers (with the quit message
40
- * supplied) and saves the config file.
38
+ * The exit command allows the user to quit DMDirc with a custom quit message. When the client
39
+ * quits, it disconnects all servers (with the quit message supplied) and saves the config file.
41 40
  */
42 41
 public class Exit extends Command {
43 42
 
@@ -45,14 +44,13 @@ public class Exit extends Command {
45 44
     public static final CommandInfo INFO = new BaseCommandInfo("exit",
46 45
             "exit [reason] - exits the client",
47 46
             CommandType.TYPE_GLOBAL);
48
-
49 47
     /** The controller to use to quit the app. */
50 48
     private final LifecycleController controller;
51 49
 
52 50
     /**
53 51
      * Creates a new instance of the {@link Exit} command.
54 52
      *
55
-     * @param controller Command controller
53
+     * @param controller          Command controller
56 54
      * @param lifecycleController The controller to use to quit the app.
57 55
      */
58 56
     @Inject

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

@@ -44,9 +44,9 @@ import java.util.Map;
44 44
 import javax.inject.Inject;
45 45
 
46 46
 /**
47
- * The help command shows the user a list of available commands, along with
48
- * their arguments, and a description. It is context-aware, so channel commands
49
- * are only displayed when in a channel window, for example.
47
+ * The help command shows the user a list of available commands, along with their arguments, and a
48
+ * description. It is context-aware, so channel commands are only displayed when in a channel
49
+ * window, for example.
50 50
  */
51 51
 public class Help extends Command implements IntelligentCommand {
52 52
 
@@ -79,7 +79,7 @@ public class Help extends Command implements IntelligentCommand {
79 79
     /**
80 80
      * Shows a list of all commands valid for the current window.
81 81
      *
82
-     * @param origin The window the command was executed in
82
+     * @param origin   The window the command was executed in
83 83
      * @param isSilent Whether this command has been silenced or not
84 84
      */
85 85
     private void showAllCommands(final FrameContainer origin, final boolean isSilent) {
@@ -115,9 +115,9 @@ public class Help extends Command implements IntelligentCommand {
115 115
     /**
116 116
      * Shows information about the specified command.
117 117
      *
118
-     * @param origin The window the command was executed in
118
+     * @param origin   The window the command was executed in
119 119
      * @param isSilent Whether this command has been silenced or not
120
-     * @param name The name of the command to display info for
120
+     * @param name     The name of the command to display info for
121 121
      */
122 122
     private void showCommand(final FrameContainer origin, final boolean isSilent,
123 123
             final String name) {

+ 4
- 6
src/com/dmdirc/commandparser/commands/global/Ifplugin.java View File

@@ -42,8 +42,8 @@ import javax.inject.Inject;
42 42
 import javax.inject.Provider;
43 43
 
44 44
 /**
45
- * The if plugin command allows the user to execute commands based on whether
46
- * or not a plugin is loaded.
45
+ * The if plugin command allows the user to execute commands based on whether or not a plugin is
46
+ * loaded.
47 47
  */
48 48
 public class Ifplugin extends Command implements IntelligentCommand {
49 49
 
@@ -52,18 +52,16 @@ public class Ifplugin extends Command implements IntelligentCommand {
52 52
             "ifplugin <[!]plugin> <command> - executes a command if the "
53 53
             + "specified plugin is/isn't loaded",
54 54
             CommandType.TYPE_GLOBAL);
55
-
56 55
     /** The plugin manager to use to query plugins. */
57 56
     private final PluginManager pluginManager;
58
-
59 57
     /** Provider of global command parsers. */
60 58
     private final Provider<GlobalCommandParser> globalCommandParserProvider;
61 59
 
62 60
     /**
63 61
      * Creates a new instance of the {@link Ifplugin} command.
64 62
      *
65
-     * @param controller The controller to use for command information.
66
-     * @param pluginManager The plugin manager to use to query plugins.
63
+     * @param controller                  The controller to use for command information.
64
+     * @param pluginManager               The plugin manager to use to query plugins.
67 65
      * @param globalCommandParserProvider Provider to use to retrieve a global command parser.
68 66
      */
69 67
     @Inject

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

@@ -47,14 +47,13 @@ public class LoadPlugin extends Command implements IntelligentCommand {
47 47
     public static final CommandInfo INFO = new BaseCommandInfo("loadplugin",
48 48
             "loadplugin <plugin> - loads the specified class as a plugin",
49 49
             CommandType.TYPE_GLOBAL);
50
-
51 50
     /** The plugin manager to use to load plugins. */
52 51
     private final PluginManager pluginManager;
53 52
 
54 53
     /**
55 54
      * Creates a new instance of the {@link LoadPlugin} command.
56 55
      *
57
-     * @param controller The controller to use for command information.
56
+     * @param controller    The controller to use for command information.
58 57
      * @param pluginManager The plugin manager to load plugins with.
59 58
      */
60 59
     @Inject

+ 15
- 15
src/com/dmdirc/commandparser/commands/global/NewServer.java View File

@@ -58,28 +58,23 @@ public class NewServer extends Command implements IntelligentCommand {
58 58
     public static final CommandInfo INFO = new BaseCommandInfo("newserver",
59 59
             "newserver <host[:[+]port]> [password] - connect to a new server",
60 60
             CommandType.TYPE_GLOBAL);
61
-
62 61
     /** The factory to use to construct servers. */
63 62
     private final ServerFactory serverFactory;
64
-
65 63
     /** Plugin manager to query for available services. */
66 64
     private final PluginManager pluginManager;
67
-
68 65
     /** Identity controller to use to find profiles. */
69 66
     private final IdentityController identityController;
70
-
71 67
     /** The parser to use for user input. */
72 68
     private final URIParser uriParser;
73 69
 
74 70
     /**
75
-     * Creates a new newserver command which will use the specified factory
76
-     * to construct servers.
71
+     * Creates a new newserver command which will use the specified factory to construct servers.
77 72
      *
78
-     * @param controller The controller to use for command information.
79
-     * @param serverFactory The factory to use to construct servers.
80
-     * @param pluginManager The plugin manager to use to query available services.
73
+     * @param controller         The controller to use for command information.
74
+     * @param serverFactory      The factory to use to construct servers.
75
+     * @param pluginManager      The plugin manager to use to query available services.
81 76
      * @param identityController Identity controller to use to find profiles.
82
-     * @param uriParser The parser to use for user input.
77
+     * @param uriParser          The parser to use for user input.
83 78
      */
84 79
     @Inject
85 80
     public NewServer(
@@ -120,11 +115,13 @@ public class NewServer extends Command implements IntelligentCommand {
120 115
     }
121 116
 
122 117
     /**
123
-     * Get a URI from the given string.
124
-     * This method allows for +port in the uri (eg irc://server.host:+6668/)
118
+     * Get a URI from the given string. This method allows for +port in the uri (eg
119
+     * irc://server.host:+6668/)
125 120
      *
126 121
      * @param address Address to parse
122
+     *
127 123
      * @return URI from address.
124
+     *
128 125
      * @throws URISyntaxException If the string is not parseable.
129 126
      * @deprecated Use a {@link URIParser}.
130 127
      */
@@ -144,14 +141,16 @@ public class NewServer extends Command implements IntelligentCommand {
144 141
                 int newPort = -1;
145 142
                 try {
146 143
                     newPort = Integer.parseInt(m.group(2));
147
-                } catch (final NumberFormatException nfe) { }
144
+                } catch (final NumberFormatException nfe) {
145
+                }
148 146
 
149 147
                 // Add 's' to scheme if not already there.
150 148
                 String scheme = uri.getScheme();
151 149
                 if (scheme.charAt(scheme.length() - 1) != 's') {
152 150
                     scheme += "s";
153 151
                 }
154
-                return new URI(scheme, uri.getUserInfo(), uri.getHost(), newPort, uri.getPath(), uri.getQuery(), uri.getFragment());
152
+                return new URI(scheme, uri.getUserInfo(), uri.getHost(), newPort, uri.getPath(),
153
+                        uri.getQuery(), uri.getFragment());
155 154
             }
156 155
         }
157 156
 
@@ -168,10 +167,11 @@ public class NewServer extends Command implements IntelligentCommand {
168 167
 
169 168
         if (arg == 0) {
170 169
             for (Service parserType : pluginManager.getServicesByType("parser")) {
171
-                res.add(parserType.getName()+"://");
170
+                res.add(parserType.getName() + "://");
172 171
             }
173 172
         }
174 173
         res.excludeAll();
175 174
         return res;
176 175
     }
176
+
177 177
 }

+ 0
- 0
src/com/dmdirc/commandparser/commands/global/Notify.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save