Browse Source

Apply most inspections to the processors package.

Change-Id: I0034aa2dfa84a00adb47e7b6e766108aaf1f8c78
Reviewed-on: http://gerrit.dmdirc.com/3994
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
changes/94/3994/3
Chris Smith 9 years ago
parent
commit
830e54a9f7
24 changed files with 349 additions and 375 deletions
  1. 10
    8
      src/com/dmdirc/parser/irc/processors/IRCProcessor.java
  2. 6
    2
      src/com/dmdirc/parser/irc/processors/Process001.java
  3. 4
    4
      src/com/dmdirc/parser/irc/processors/Process004005.java
  4. 4
    5
      src/com/dmdirc/parser/irc/processors/Process464.java
  5. 1
    1
      src/com/dmdirc/parser/irc/processors/ProcessAccount.java
  6. 5
    5
      src/com/dmdirc/parser/irc/processors/ProcessAway.java
  7. 10
    10
      src/com/dmdirc/parser/irc/processors/ProcessCap.java
  8. 4
    5
      src/com/dmdirc/parser/irc/processors/ProcessInvite.java
  9. 15
    18
      src/com/dmdirc/parser/irc/processors/ProcessJoin.java
  10. 16
    20
      src/com/dmdirc/parser/irc/processors/ProcessKick.java
  11. 1
    1
      src/com/dmdirc/parser/irc/processors/ProcessList.java
  12. 33
    30
      src/com/dmdirc/parser/irc/processors/ProcessListModes.java
  13. 10
    13
      src/com/dmdirc/parser/irc/processors/ProcessMOTD.java
  14. 118
    116
      src/com/dmdirc/parser/irc/processors/ProcessMessage.java
  15. 34
    38
      src/com/dmdirc/parser/irc/processors/ProcessMode.java
  16. 5
    7
      src/com/dmdirc/parser/irc/processors/ProcessNames.java
  17. 11
    15
      src/com/dmdirc/parser/irc/processors/ProcessNick.java
  18. 2
    2
      src/com/dmdirc/parser/irc/processors/ProcessNickInUse.java
  19. 4
    5
      src/com/dmdirc/parser/irc/processors/ProcessNoticeAuth.java
  20. 11
    13
      src/com/dmdirc/parser/irc/processors/ProcessPart.java
  21. 11
    15
      src/com/dmdirc/parser/irc/processors/ProcessQuit.java
  22. 5
    9
      src/com/dmdirc/parser/irc/processors/ProcessTopic.java
  23. 13
    16
      src/com/dmdirc/parser/irc/processors/ProcessWallops.java
  24. 16
    17
      src/com/dmdirc/parser/irc/processors/ProcessWho.java

+ 10
- 8
src/com/dmdirc/parser/irc/processors/IRCProcessor.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.processors;
25 25
 import com.dmdirc.parser.common.CallbackManager;
26 26
 import com.dmdirc.parser.common.ParserError;
27 27
 import com.dmdirc.parser.common.QueuePriority;
28
+import com.dmdirc.parser.interfaces.callbacks.DebugInfoListener;
29
+import com.dmdirc.parser.interfaces.callbacks.ErrorInfoListener;
28 30
 import com.dmdirc.parser.irc.IRCChannelInfo;
29 31
 import com.dmdirc.parser.irc.IRCClientInfo;
30 32
 import com.dmdirc.parser.irc.IRCParser;
@@ -57,7 +59,7 @@ public abstract class IRCProcessor {
57 59
     /**
58 60
      * Callback to all objects implementing the IErrorInfo Interface.
59 61
      *
60
-     * @see com.dmdirc.parser.interfaces.callbacks.ErrorInfoListener
62
+     * @see ErrorInfoListener
61 63
      * @param errorInfo ParserError object representing the error.
62 64
      */
63 65
     protected final void callErrorInfo(final ParserError errorInfo) {
@@ -67,7 +69,7 @@ public abstract class IRCProcessor {
67 69
     /**
68 70
      * Callback to all objects implementing the DebugInfo Callback.
69 71
      *
70
-     * @see com.dmdirc.parser.interfaces.callbacks.DebugInfoListener
72
+     * @see DebugInfoListener
71 73
      * @param level Debugging Level (DEBUG_INFO, ndSocket etc)
72 74
      * @param data Debugging Information
73 75
      * @param args Formatting String Options
@@ -79,7 +81,7 @@ public abstract class IRCProcessor {
79 81
     /**
80 82
      * Callback to all objects implementing the DebugInfo Callback.
81 83
      *
82
-     * @see com.dmdirc.parser.interfaces.callbacks.DebugInfoListener
84
+     * @see DebugInfoListener
83 85
      * @param level Debugging Level (DEBUG_INFO, ndSocket etc)
84 86
      * @param data Debugging Information
85 87
      */
@@ -151,7 +153,7 @@ public abstract class IRCProcessor {
151 153
      * @param sParam Type of line to process ("005", "PRIVMSG" etc)
152 154
      * @param token IRCTokenised line to process
153 155
      */
154
-    public abstract void process(final String sParam, final String[] token);
156
+    public abstract void process(final String sParam, final String... token);
155 157
 
156 158
     /**
157 159
      * What does this IRCProcessor handle.
@@ -165,12 +167,12 @@ public abstract class IRCProcessor {
165 167
      * @return the name of this processor
166 168
      */
167 169
     public final String getName() {
168
-        final Package thisPackage = this.getClass().getPackage();
170
+        final Package thisPackage = getClass().getPackage();
169 171
         int packageLength = 0;
170 172
         if (thisPackage != null) {
171 173
             packageLength = thisPackage.getName().length() + 1;
172 174
         }
173
-        return this.getClass().getName().substring(packageLength);
175
+        return getClass().getName().substring(packageLength);
174 176
     }
175 177
 
176 178
     /**
@@ -178,7 +180,7 @@ public abstract class IRCProcessor {
178 180
      * @return lower case name of this processor
179 181
      */
180 182
     public final String getLowerName() {
181
-        return this.getName().toLowerCase();
183
+        return getName().toLowerCase();
182 184
     }
183 185
 
184 186
     /**
@@ -187,6 +189,6 @@ public abstract class IRCProcessor {
187 189
      */
188 190
     @Override
189 191
     public final String toString() {
190
-        return this.getName();
192
+        return getName();
191 193
     }
192 194
 }

+ 6
- 2
src/com/dmdirc/parser/irc/processors/Process001.java View File

@@ -27,6 +27,8 @@ import com.dmdirc.parser.common.ParserError;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28 28
 import com.dmdirc.parser.irc.ProcessingManager;
29 29
 
30
+import java.util.Collection;
31
+
30 32
 /**
31 33
  * Process a 001 message.
32 34
  */
@@ -49,7 +51,7 @@ public class Process001 extends IRCProcessor {
49 51
      * @param token IRCTokenised line to process
50 52
      */
51 53
     @Override
52
-    public void process(final String sParam, final String[] token) {
54
+    public void process(final String sParam, final String... token) {
53 55
         parser.got001 = true;
54 56
         // << :demon1.uk.quakenet.org 001 Java-Test :Welcome to the QuakeNet IRC Network, Java-Test
55 57
         parser.updateServerName(token[0].substring(1, token[0].length()));
@@ -80,7 +82,9 @@ public class Process001 extends IRCProcessor {
80 82
         }
81 83
 
82 84
         parser.startPingTimer();
83
-        parser.joinChannels(parser.extractChannels(parser.getURI()).toArray(new ChannelJoinRequest[0]));
85
+        final Collection<? extends ChannelJoinRequest> requests = parser.extractChannels(
86
+                parser.getURI());
87
+        parser.joinChannels(requests.toArray(new ChannelJoinRequest[requests.size()]));
84 88
     }
85 89
 
86 90
     /**

+ 4
- 4
src/com/dmdirc/parser/irc/processors/Process004005.java View File

@@ -56,7 +56,7 @@ public class Process004005 extends IRCProcessor {
56 56
      * @param token IRCTokenised line to process
57 57
      */
58 58
     @Override
59
-    public void process(final String sParam, final String[] token) {
59
+    public void process(final String sParam, final String... token) {
60 60
         switch (sParam) {
61 61
             case "002":
62 62
                 process002();
@@ -114,7 +114,7 @@ public class Process004005 extends IRCProcessor {
114 114
      *
115 115
      * @param token The tokenised line.
116 116
      */
117
-    private void process003(final String[] token) {
117
+    private void process003(final String... token) {
118 118
         parser.h005Info.put("003IRCD", token[token.length - 1]);
119 119
     }
120 120
 
@@ -123,7 +123,7 @@ public class Process004005 extends IRCProcessor {
123 123
      *
124 124
      * @param token The tokenised line.
125 125
      */
126
-    private void process004(final String[] token) {
126
+    private void process004(final String... token) {
127 127
         final boolean multiParam = token.length > 4;
128 128
         int i = multiParam ? 4 : 1;
129 129
         final String[] bits = multiParam ? token : token[3].split(" ");
@@ -159,7 +159,7 @@ public class Process004005 extends IRCProcessor {
159 159
      *
160 160
      * @param token The tokenised line.
161 161
      */
162
-    private void process005(final String[] token) {
162
+    private void process005(final String... token) {
163 163
         for (int i = 3; i < token.length; i++) {
164 164
             final String[] bits = token[i].split("=", 2);
165 165
 

+ 4
- 5
src/com/dmdirc/parser/irc/processors/Process464.java View File

@@ -48,7 +48,7 @@ public class Process464 extends IRCProcessor {
48 48
      * @param token IRCTokenised line to process
49 49
      */
50 50
     @Override
51
-    public void process(final String sParam, final String[] token) {
51
+    public void process(final String sParam, final String... token) {
52 52
         callPasswordRequired();
53 53
     }
54 54
 
@@ -65,10 +65,9 @@ public class Process464 extends IRCProcessor {
65 65
     /**
66 66
      * Callback to all objects implementing the PasswordRequired Callback.
67 67
      *
68
-     * @see com.dmdirc.parser.interfaces.callbacks.PasswordRequiredListener
69
-     * @return true if a method was called, false otherwise
68
+     * @see PasswordRequiredListener
70 69
      */
71
-    protected boolean callPasswordRequired() {
72
-        return getCallbackManager().getCallbackType(PasswordRequiredListener.class).call();
70
+    protected void callPasswordRequired() {
71
+        getCallbackManager().getCallbackType(PasswordRequiredListener.class).call();
73 72
     }
74 73
 }

+ 1
- 1
src/com/dmdirc/parser/irc/processors/ProcessAccount.java View File

@@ -48,7 +48,7 @@ public class ProcessAccount extends IRCProcessor {
48 48
      * @param token IRCTokenised line to process
49 49
      */
50 50
     @Override
51
-    public void process(final String sParam, final String[] token) {
51
+    public void process(final String sParam, final String... token) {
52 52
         // :nick!user@host ACCOUNT accountname
53 53
         final IRCClientInfo iClient = getClientInfo(token[0]);
54 54
         if (iClient != null) {

+ 5
- 5
src/com/dmdirc/parser/irc/processors/ProcessAway.java View File

@@ -49,7 +49,7 @@ public class ProcessAway extends IRCProcessor {
49 49
      * @param token IRCTokenised line to process
50 50
      */
51 51
     @Override
52
-    public void process(final String sParam, final String[] token) {
52
+    public void process(final String sParam, final String... token) {
53 53
         final IRCClientInfo iClient = getClientInfo(token[0]);
54 54
         switch (sParam) {
55 55
             case "AWAY":
@@ -83,14 +83,14 @@ public class ProcessAway extends IRCProcessor {
83 83
     /**
84 84
      * Callback to all objects implementing the onAwayState Callback.
85 85
      *
86
-     * @see com.dmdirc.parser.interfaces.callbacks.AwayStateListener
86
+     * @see AwayStateListener
87 87
      * @param oldState Old Away State
88 88
      * @param currentState Current Away State
89 89
      * @param reason Best guess at away reason
90
-     * @return true if a method was called, false otherwise
91 90
      */
92
-    protected boolean callAwayState(final AwayState oldState, final AwayState currentState, final String reason) {
93
-        return getCallbackManager().getCallbackType(AwayStateListener.class).call(oldState, currentState, reason);
91
+    protected void callAwayState(final AwayState oldState, final AwayState currentState,
92
+            final String reason) {
93
+        getCallbackManager().getCallbackType(AwayStateListener.class).call(oldState, currentState, reason);
94 94
     }
95 95
 
96 96
     /**

+ 10
- 10
src/com/dmdirc/parser/irc/processors/ProcessCap.java View File

@@ -28,8 +28,8 @@ import com.dmdirc.parser.irc.ProcessingManager;
28 28
 import com.dmdirc.parser.irc.TimestampedIRCProcessor;
29 29
 
30 30
 import java.util.ArrayList;
31
+import java.util.Collection;
31 32
 import java.util.Date;
32
-import java.util.List;
33 33
 
34 34
 /**
35 35
  * Process CAP extension.
@@ -45,9 +45,9 @@ import java.util.List;
45 45
  */
46 46
 public class ProcessCap extends TimestampedIRCProcessor {
47 47
     /** Have we handled the pre-connect cap request? */
48
-    private boolean hasCapped = false;
48
+    private boolean hasCapped;
49 49
     /** List of supported capabilities. */
50
-    private final List<String> supportedCapabilities = new ArrayList<>();
50
+    private final Collection<String> supportedCapabilities = new ArrayList<>();
51 51
 
52 52
     /**
53 53
      * Create a new instance of the IRCProcessor Object.
@@ -79,16 +79,16 @@ public class ProcessCap extends TimestampedIRCProcessor {
79 79
      * @param token IRCTokenised line to process
80 80
      */
81 81
     @Override
82
-    public void process(final Date date, final String sParam, final String[] token) {
82
+    public void process(final Date date, final String sParam, final String... token) {
83 83
         // We will only automatically handle the first ever pre-001 CAP LS
84 84
         // response.
85 85
         // After that, the user may be sending stuff themselves so we do
86 86
         // nothing.
87
-        if (!hasCapped && !parser.got001 && token.length > 4 && token[3].equalsIgnoreCase("LS")) {
87
+        if (!hasCapped && !parser.got001 && token.length > 4 && "LS".equalsIgnoreCase(token[3])) {
88 88
             final String[] caps = token[token.length - 1].split(" ");
89 89
             for (final String cap : caps) {
90 90
                 if (cap.isEmpty()) { continue; }
91
-                final String capability = (cap.charAt(0) == '=') ? cap.substring(1).toLowerCase() : cap.toLowerCase();
91
+                final String capability = cap.charAt(0) == '=' ? cap.substring(1).toLowerCase() : cap.toLowerCase();
92 92
 
93 93
                 parser.addCapability(capability);
94 94
 
@@ -106,19 +106,19 @@ public class ProcessCap extends TimestampedIRCProcessor {
106 106
             //     :DFBnc.Server CAP Dataforce LS
107 107
             // but not:
108 108
             //     :DFBnc.Server CAP Dataforce LS *
109
-            if (token.length == 4 || (token.length == 5 && !token[4].equals("*"))) {
109
+            if (token.length == 4 || token.length == 5 && !"*".equals(token[4])) {
110 110
                 hasCapped = true;
111 111
                 parser.sendRawMessage("CAP END");
112 112
             }
113
-        } else if (token[3].equalsIgnoreCase("ACK") || token[3].equalsIgnoreCase("CLEAR")) {
113
+        } else if ("ACK".equalsIgnoreCase(token[3]) || "CLEAR".equalsIgnoreCase(token[3])) {
114 114
             // Process the list.
115 115
             final String[] caps = token[token.length - 1].split(" ");
116 116
             for (final String cap : caps) {
117 117
                 if (cap.isEmpty()) { continue; }
118 118
                 final CapabilityState modifier = CapabilityState.fromModifier(cap.charAt(0));
119 119
 
120
-                final String capability = (modifier == CapabilityState.INVALID) ? cap.toLowerCase() : cap.substring(1).toLowerCase();
121
-                final CapabilityState state = (modifier == CapabilityState.INVALID) ? CapabilityState.ENABLED : modifier;
120
+                final String capability = modifier == CapabilityState.INVALID ? cap.toLowerCase() : cap.substring(1).toLowerCase();
121
+                final CapabilityState state = modifier == CapabilityState.INVALID ? CapabilityState.ENABLED : modifier;
122 122
 
123 123
                 if (state == CapabilityState.NEED_ACK) {
124 124
                     parser.sendRawMessage("CAP ACK :" + capability);

+ 4
- 5
src/com/dmdirc/parser/irc/processors/ProcessInvite.java View File

@@ -48,7 +48,7 @@ public class ProcessInvite extends IRCProcessor {
48 48
      * @param token IRCTokenised line to process
49 49
      */
50 50
     @Override
51
-    public void process(final String sParam, final String[] token) {
51
+    public void process(final String sParam, final String... token) {
52 52
         // :Tobavaj!shane@Tobavaj.users.quakenet.org INVITE Dataforce #dataforceisgod 1188846462
53 53
         if (token.length > 2) {
54 54
             callInvite(token[0].substring(1), token[3]);
@@ -58,13 +58,12 @@ public class ProcessInvite extends IRCProcessor {
58 58
     /**
59 59
      * Callback to all objects implementing the Invite Callback.
60 60
      *
61
-     * @see com.dmdirc.parser.interfaces.callbacks.InviteListener
61
+     * @see InviteListener
62 62
      * @param userHost The hostname of the person who invited us
63 63
      * @param channel The name of the channel we were invited to
64
-     * @return true if a method was called, false otherwise
65 64
      */
66
-    protected boolean callInvite(final String userHost, final String channel) {
67
-        return getCallbackManager().getCallbackType(InviteListener.class).call(userHost, channel);
65
+    protected void callInvite(final String userHost, final String channel) {
66
+        getCallbackManager().getCallbackType(InviteListener.class).call(userHost, channel);
68 67
     }
69 68
 
70 69
     /**

+ 15
- 18
src/com/dmdirc/parser/irc/processors/ProcessJoin.java View File

@@ -77,7 +77,7 @@ public class ProcessJoin extends IRCProcessor {
77 77
      * @param token IRCTokenised line to process
78 78
      */
79 79
     @Override
80
-    public void process(final String sParam, final String[] token) {
80
+    public void process(final String sParam, final String... token) {
81 81
         callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: %s | %s", sParam, Arrays.toString(token));
82 82
 
83 83
         if ("329".equals(sParam)) {
@@ -97,15 +97,13 @@ public class ProcessJoin extends IRCProcessor {
97 97
             if (token.length < 3) {
98 98
                 return;
99 99
             }
100
-            IRCClientInfo iClient;
101
-            IRCChannelInfo iChannel;
102
-            final IRCChannelClientInfo iChannelClient;
103
-            final String channelName;
104 100
             final boolean extendedJoin = parser.getCapabilityState("extended-join") == CapabilityState.ENABLED;
105
-            final String accountName;
106
-            final String realName;
107 101
 
108
-            iClient = getClientInfo(token[0]);
102
+
103
+            IRCClientInfo iClient = getClientInfo(token[0]);
104
+            final String realName;
105
+            final String accountName;
106
+            final String channelName;
109 107
             if (extendedJoin) {
110 108
                 // :nick!ident@host JOIN #Channel accountName :Real Name
111 109
                 channelName = token[2];
@@ -116,7 +114,7 @@ public class ProcessJoin extends IRCProcessor {
116 114
                 accountName = "*";
117 115
                 realName = "";
118 116
             }
119
-            iChannel = parser.getChannel(token[2]);
117
+            IRCChannelInfo iChannel = parser.getChannel(token[2]);
120 118
 
121 119
             callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: client: %s", iClient);
122 120
             callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: channel: %s", iChannel);
@@ -153,7 +151,7 @@ public class ProcessJoin extends IRCProcessor {
153 151
                     // This is only done if we are already the channel, and it isn't us that
154 152
                     // joined.
155 153
                     callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Adding client to channel.");
156
-                    iChannelClient = iChannel.addClient(iClient);
154
+                    final IRCChannelClientInfo iChannelClient = iChannel.addClient(iClient);
157 155
                     callChannelJoin(iChannel, iChannelClient);
158 156
                     callDebugInfo(IRCParser.DEBUG_INFO, "processJoin: Added client to channel.");
159 157
                     return;
@@ -178,24 +176,23 @@ public class ProcessJoin extends IRCProcessor {
178 176
     /**
179 177
      * Callback to all objects implementing the ChannelJoin Callback.
180 178
      *
181
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelJoinListener
179
+     * @see ChannelJoinListener
182 180
      * @param cChannel Channel Object
183 181
      * @param cChannelClient ChannelClient object for new person
184
-     * @return true if a method was called, false otherwise
185 182
      */
186
-    protected boolean callChannelJoin(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient) {
187
-        return getCallbackManager().getCallbackType(ChannelJoinListener.class).call(cChannel, cChannelClient);
183
+    protected void callChannelJoin(final ChannelInfo cChannel,
184
+            final ChannelClientInfo cChannelClient) {
185
+        getCallbackManager().getCallbackType(ChannelJoinListener.class).call(cChannel, cChannelClient);
188 186
     }
189 187
 
190 188
     /**
191 189
      * Callback to all objects implementing the ChannelSelfJoin Callback.
192 190
      *
193
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelSelfJoinListener
191
+     * @see ChannelSelfJoinListener
194 192
      * @param cChannel Channel Object
195
-     * @return true if a method was called, false otherwise
196 193
      */
197
-    protected boolean callChannelSelfJoin(final ChannelInfo cChannel) {
198
-        return getCallbackManager().getCallbackType(ChannelSelfJoinListener.class).call(cChannel);
194
+    protected void callChannelSelfJoin(final ChannelInfo cChannel) {
195
+        getCallbackManager().getCallbackType(ChannelSelfJoinListener.class).call(cChannel);
199 196
     }
200 197
 
201 198
     /**

+ 16
- 20
src/com/dmdirc/parser/irc/processors/ProcessKick.java View File

@@ -56,44 +56,39 @@ public class ProcessKick extends IRCProcessor {
56 56
      * @param token IRCTokenised line to process
57 57
      */
58 58
     @Override
59
-    public void process(final String sParam, final String[] token) {
59
+    public void process(final String sParam, final String... token) {
60 60
         callDebugInfo(IRCParser.DEBUG_INFO, "processKick: %s | %s", sParam, Arrays.toString(token));
61 61
 
62
-        final IRCChannelClientInfo iChannelClient;
63
-        final IRCChannelClientInfo iChannelKicker;
64
-        final IRCChannelInfo iChannel;
65
-        final IRCClientInfo iClient;
66
-        final IRCClientInfo iKicker;
67
-        String sReason = "";
68
-
69
-        iClient = getClientInfo(token[3]);
70
-        iKicker = getClientInfo(token[0]);
71
-        iChannel = getChannel(token[2]);
62
+        final IRCClientInfo iClient = getClientInfo(token[3]);
63
+        final IRCClientInfo iKicker = getClientInfo(token[0]);
64
+        final IRCChannelInfo iChannel = getChannel(token[2]);
72 65
 
73 66
         if (iClient == null) {
74 67
             return;
75 68
         }
76 69
 
77
-        if ((IRCParser.ALWAYS_UPDATECLIENT && iKicker != null) && iKicker.getHostname().isEmpty()) {
70
+        if (IRCParser.ALWAYS_UPDATECLIENT && iKicker != null && iKicker.getHostname().isEmpty()) {
78 71
             // To facilitate dmdirc formatter, get user information
79 72
             iKicker.setUserBits(token[0], false);
80 73
         }
81 74
 
82 75
         if (iChannel == null) {
83 76
             if (iClient != parser.getLocalClient()) {
84
-                callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got kick for channel (" + token[2] + ") that I am not on. [User: " + token[3] + "]", parser.getLastLine()));
77
+                callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got kick for channel (" + token[2] + ") that I am not on. [User: " + token[3] +
78
+
79
+                        ']', parser.getLastLine()));
85 80
             }
86
-            return;
87 81
         } else {
82
+            String sReason = "";
88 83
             if (token.length > 4) {
89 84
                 sReason = token[token.length - 1];
90 85
             }
91
-            iChannelClient = iChannel.getChannelClient(iClient);
86
+            final IRCChannelClientInfo iChannelClient = iChannel.getChannelClient(iClient);
92 87
             if (iChannelClient == null) {
93 88
                 // callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got kick for channel ("+token[2]+") for a non-existant user. [User: "+token[0]+"]", parser.getLastLine()));
94 89
                 return;
95 90
             }
96
-            iChannelKicker = iChannel.getChannelClient(token[0]);
91
+            final IRCChannelClientInfo iChannelKicker = iChannel.getChannelClient(token[0]);
97 92
             if (parser.getRemoveAfterCallback()) {
98 93
                 callDebugInfo(IRCParser.DEBUG_INFO, "processKick: calling kick before. {%s | %s | %s | %s | %s}", iChannel, iChannelClient, iChannelKicker, sReason, token[0]);
99 94
                 callChannelKick(iChannel, iChannelClient, iChannelKicker, sReason, token[0]);
@@ -115,16 +110,17 @@ public class ProcessKick extends IRCProcessor {
115 110
     /**
116 111
      * Callback to all objects implementing the ChannelKick Callback.
117 112
      *
118
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelKickListener
113
+     * @see ChannelKickListener
119 114
      * @param cChannel Channel where the kick took place
120 115
      * @param cKickedClient ChannelClient that got kicked
121 116
      * @param cKickedByClient ChannelClient that did the kicking (may be null if server)
122 117
      * @param sReason Reason for kick (may be "")
123 118
      * @param sKickedByHost Hostname of Kicker (or servername)
124
-     * @return true if a method was called, false otherwise
125 119
      */
126
-    protected boolean callChannelKick(final ChannelInfo cChannel, final ChannelClientInfo cKickedClient, final ChannelClientInfo cKickedByClient, final String sReason, final String sKickedByHost) {
127
-        return getCallbackManager().getCallbackType(ChannelKickListener.class).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
120
+    protected void callChannelKick(final ChannelInfo cChannel,
121
+            final ChannelClientInfo cKickedClient, final ChannelClientInfo cKickedByClient,
122
+            final String sReason, final String sKickedByHost) {
123
+        getCallbackManager().getCallbackType(ChannelKickListener.class).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
128 124
     }
129 125
 
130 126
     /**

+ 1
- 1
src/com/dmdirc/parser/irc/processors/ProcessList.java View File

@@ -50,7 +50,7 @@ public class ProcessList extends IRCProcessor {
50 50
      * @param token IRCTokenised line to process
51 51
      */
52 52
     @Override
53
-    public void process(final String sParam, final String[] token) {
53
+    public void process(final String sParam, final String... token) {
54 54
         // :port80b.se.quakenet.org 321 MD87 Channel :Users  Name
55 55
         // :port80b.se.quakenet.org 322 MD87 #DMDirc 10 :
56 56
         // :port80b.se.quakenet.org 323 MD87 :End of /LIST

+ 33
- 30
src/com/dmdirc/parser/irc/processors/ProcessListModes.java View File

@@ -57,20 +57,17 @@ public class ProcessListModes extends IRCProcessor {
57 57
      * @param token IRCTokenised line to process
58 58
      */
59 59
     @Override
60
-    public void process(final String sParam, final String[] token) {
60
+    public void process(final String sParam, final String... token) {
61 61
         final IRCChannelInfo channel = getChannel(token[3]);
62 62
         final ServerType serverType = parser.getServerType();
63
-        String item = "";
64
-        String owner = "";
65
-        byte tokenStart = 4; // Where do the relevent tokens start?
66
-        boolean isCleverMode = false;
67
-        long time = 0;
68
-        char mode = ' ';
69
-        boolean isItem = true; // true if item listing, false if "end of .." item
70 63
         if (channel == null) {
71 64
             return;
72 65
         }
73 66
 
67
+        boolean isItem = true; // true if item listing, false if "end of .." item
68
+        char mode = ' ';
69
+        boolean isCleverMode = false;
70
+        byte tokenStart = 4; // Where do the relevent tokens start?
74 71
         if ("367".equals(sParam) || "368".equals(sParam)) {
75 72
             // Ban List/Item.
76 73
             // (Also used for +d and +q on dancer/hyperion... -_-)
@@ -81,23 +78,25 @@ public class ProcessListModes extends IRCProcessor {
81 78
             // Except / Exempt List etc
82 79
             mode = 'e';
83 80
             isItem = "348".equals(sParam);
84
-        } else if (sParam.equals("346") || sParam.equals("347")) {
81
+        } else if ("346".equals(sParam) || "347".equals(sParam)) {
85 82
             // Invite List
86 83
             mode = 'I';
87
-            isItem = sParam.equals("346");
88
-        } else if (sParam.equals("940") || sParam.equals("941")) {
84
+            isItem = "346".equals(sParam);
85
+        } else if ("940".equals(sParam) || "941".equals(sParam)) {
89 86
             // Censored words List
90 87
             mode = 'g';
91
-            isItem = sParam.equals("941");
92
-        } else if ((serverType == ServerType.INSPIRCD) && (sParam.equals("910") || sParam.equals("911"))) {
88
+            isItem = "941".equals(sParam);
89
+        } else if (serverType == ServerType.INSPIRCD && ("910".equals(sParam) ||
90
+                "911".equals(sParam))) {
93 91
             // Channel Access List
94 92
             mode = 'w';
95
-            isItem = sParam.equals("910");
96
-        } else if ((serverType == ServerType.INSPIRCD) && (sParam.equals("954") || sParam.equals("953"))) {
93
+            isItem = "910".equals(sParam);
94
+        } else if (serverType == ServerType.INSPIRCD && ("954".equals(sParam) ||
95
+                "953".equals(sParam))) {
97 96
             // Channel exemptchanops List
98 97
             mode = 'X';
99
-            isItem = sParam.equals("954");
100
-        } else if (sParam.equals("344") || sParam.equals("345")) {
98
+            isItem = "954".equals(sParam);
99
+        } else if ("344".equals(sParam) || "345".equals(sParam)) {
101 100
             // Reop List, or bad words list, or quiet list. god damn.
102 101
             if (serverType == ServerType.EUIRCD) {
103 102
                 mode = 'w';
@@ -106,15 +105,17 @@ public class ProcessListModes extends IRCProcessor {
106 105
             } else {
107 106
                 mode = 'R';
108 107
             }
109
-            isItem = sParam.equals("344");
110
-        } else if (ServerTypeGroup.OWNER_386.isMember(serverType) && (sParam.equals("386") || sParam.equals("387"))) {
108
+            isItem = "344".equals(sParam);
109
+        } else if (ServerTypeGroup.OWNER_386.isMember(serverType) && ("386".equals(sParam) ||
110
+                "387".equals(sParam))) {
111 111
             // Channel Owner list
112 112
             mode = 'q';
113
-            isItem = sParam.equals("387");
114
-        } else if (ServerTypeGroup.PROTECTED_388.isMember(serverType) && (sParam.equals("388") || sParam.equals("389"))) {
113
+            isItem = "387".equals(sParam);
114
+        } else if (ServerTypeGroup.PROTECTED_388.isMember(serverType) && ("388".equals(sParam) ||
115
+                "389".equals(sParam))) {
115 116
             // Protected User list
116 117
             mode = 'a';
117
-            isItem = sParam.equals("389");
118
+            isItem = "389".equals(sParam);
118 119
         } else if (sParam.equals(parser.h005Info.get("LISTMODE")) || sParam.equals(parser.h005Info.get("LISTMODEEND"))) {
119 120
             // Support for potential future decent mode listing in the protocol
120 121
             //
@@ -190,7 +191,7 @@ public class ProcessListModes extends IRCProcessor {
190 191
                 final int identstart = token[tokenStart].indexOf('!');
191 192
                 final int hoststart = token[tokenStart].indexOf('@');
192 193
                 // Check that ! and @ are both in the string - as required by +b and +q
193
-                if ((identstart >= 0) && (identstart < hoststart)) {
194
+                if (identstart >= 0 && identstart < hoststart) {
194 195
                     if (serverType == ServerType.HYPERION && token[tokenStart].charAt(0) == '%') {
195 196
                         mode = 'q';
196 197
                     } else {
@@ -208,7 +209,7 @@ public class ProcessListModes extends IRCProcessor {
208 209
                     list.clear();
209 210
                     if (ServerTypeGroup.FREENODE.isMember(serverType) && (mode == 'b' || mode == 'q')) {
210 211
                         // Also clear the other list if b or q.
211
-                        final Character otherMode = (mode == 'b') ? 'q' : 'b';
212
+                        final Character otherMode = mode == 'b' ? 'q' : 'b';
212 213
 
213 214
                         if (!channel.getAddState(otherMode)) {
214 215
                             callDebugInfo(IRCParser.DEBUG_INFO, "New List Mode Batch (" + mode + "): Clearing!");
@@ -224,16 +225,19 @@ public class ProcessListModes extends IRCProcessor {
224 225
                 channel.setAddState(mode, true);
225 226
             }
226 227
 
227
-            if (token.length > (tokenStart + 2)) {
228
+            long time = 0;
229
+            if (token.length > tokenStart + 2) {
228 230
                 try {
229 231
                     time = Long.parseLong(token[tokenStart + 2]);
230 232
                 } catch (NumberFormatException e) {
231 233
                     time = 0;
232 234
                 }
233 235
             }
234
-            if (token.length > (tokenStart + 1)) {
236
+            String owner = "";
237
+            if (token.length > tokenStart + 1) {
235 238
                 owner = token[tokenStart + 1];
236 239
             }
240
+            String item = "";
237 241
             if (token.length > tokenStart) {
238 242
                 item = token[tokenStart];
239 243
             }
@@ -285,12 +289,11 @@ public class ProcessListModes extends IRCProcessor {
285 289
     /**
286 290
      * Callback to all objects implementing the ChannelGotListModes Callback.
287 291
      *
288
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelListModeListener
292
+     * @see ChannelListModeListener
289 293
      * @param cChannel Channel which the ListModes reply is for
290 294
      * @param mode the mode that we got list modes for.
291
-     * @return true if a method was called, false otherwise
292 295
      */
293
-    protected boolean callChannelGotListModes(final ChannelInfo cChannel, final char mode) {
294
-        return getCallbackManager().getCallbackType(ChannelListModeListener.class).call(cChannel, mode);
296
+    protected void callChannelGotListModes(final ChannelInfo cChannel, final char mode) {
297
+        getCallbackManager().getCallbackType(ChannelListModeListener.class).call(cChannel, mode);
295 298
     }
296 299
 }

+ 10
- 13
src/com/dmdirc/parser/irc/processors/ProcessMOTD.java View File

@@ -50,7 +50,7 @@ public class ProcessMOTD extends IRCProcessor {
50 50
      * @param token IRCTokenised line to process
51 51
      */
52 52
     @Override
53
-    public void process(final String sParam, final String[] token) {
53
+    public void process(final String sParam, final String... token) {
54 54
         switch (sParam) {
55 55
             case "375":
56 56
                 callMOTDStart(token[token.length - 1]);
@@ -69,33 +69,30 @@ public class ProcessMOTD extends IRCProcessor {
69 69
      *
70 70
      * @param noMOTD Was this an MOTDEnd or NoMOTD
71 71
      * @param data The contents of the line (incase of language changes or so)
72
-     * @see com.dmdirc.parser.interfaces.callbacks.MotdEndListener
73
-     * @return true if a method was called, false otherwise
72
+     * @see MotdEndListener
74 73
      */
75
-    protected boolean callMOTDEnd(final boolean noMOTD, final String data) {
76
-        return getCallbackManager().getCallbackType(MotdEndListener.class).call(noMOTD, data);
74
+    protected void callMOTDEnd(final boolean noMOTD, final String data) {
75
+        getCallbackManager().getCallbackType(MotdEndListener.class).call(noMOTD, data);
77 76
     }
78 77
 
79 78
     /**
80 79
      * Callback to all objects implementing the MOTDLine Callback.
81 80
      *
82
-     * @see com.dmdirc.parser.interfaces.callbacks.MotdLineListener
81
+     * @see MotdLineListener
83 82
      * @param data Incomming Line.
84
-     * @return true if a method was called, false otherwise
85 83
      */
86
-    protected boolean callMOTDLine(final String data) {
87
-        return getCallbackManager().getCallbackType(MotdLineListener.class).call(data);
84
+    protected void callMOTDLine(final String data) {
85
+        getCallbackManager().getCallbackType(MotdLineListener.class).call(data);
88 86
     }
89 87
 
90 88
     /**
91 89
      * Callback to all objects implementing the MOTDStart Callback.
92 90
      *
93
-     * @see com.dmdirc.parser.interfaces.callbacks.MotdStartListener
91
+     * @see MotdStartListener
94 92
      * @param data Incomming Line.
95
-     * @return true if a method was called, false otherwise
96 93
      */
97
-    protected boolean callMOTDStart(final String data) {
98
-        return getCallbackManager().getCallbackType(MotdStartListener.class).call(data);
94
+    protected void callMOTDStart(final String data) {
95
+        getCallbackManager().getCallbackType(MotdStartListener.class).call(data);
99 96
     }
100 97
 
101 98
     /**

+ 118
- 116
src/com/dmdirc/parser/irc/processors/ProcessMessage.java View File

@@ -94,7 +94,7 @@ public class ProcessMessage extends TimestampedIRCProcessor {
94 94
      * @param token IRCTokenised line to process
95 95
      */
96 96
     @Override
97
-    public void process(final Date date, final String sParam, final String[] token) {
97
+    public void process(final Date date, final String sParam, final String... token) {
98 98
         // Ignore people!
99 99
         String sMessage;
100 100
         if (token[0].charAt(0) == ':') {
@@ -121,7 +121,8 @@ public class ProcessMessage extends TimestampedIRCProcessor {
121 121
         }
122 122
 
123 123
         // Is this actually a notice auth?
124
-        if (token[0].indexOf('!') == -1 && token[1].equalsIgnoreCase("NOTICE") && token[2].equalsIgnoreCase("AUTH")) {
124
+        if (token[0].indexOf('!') == -1 && "NOTICE".equalsIgnoreCase(token[1]) &&
125
+                "AUTH".equalsIgnoreCase(token[2])) {
125 126
             try {
126 127
                 parser.getProcessingManager().process(date, "Notice Auth", token);
127 128
             } catch (ProcessorNotFoundException e) {
@@ -129,9 +130,6 @@ public class ProcessMessage extends TimestampedIRCProcessor {
129 130
             return;
130 131
         }
131 132
 
132
-        IRCChannelClientInfo iChannelClient = null;
133
-        final IRCChannelInfo iChannel;
134
-        final IRCClientInfo iClient;
135 133
         // "nick!user@host PRIVMSG #Channel" should be processed as "nick!user@host PRIVMSG #Channel :"
136 134
         if (token.length < 4) {
137 135
             sMessage = "";
@@ -139,7 +137,6 @@ public class ProcessMessage extends TimestampedIRCProcessor {
139 137
             sMessage = token[token.length - 1];
140 138
         }
141 139
         String[] bits = sMessage.split(" ", 2);
142
-        final Character char1 = (char) 1;
143 140
         String sCTCP = "";
144 141
         boolean isAction = false;
145 142
         boolean isCTCP = false;
@@ -148,7 +145,8 @@ public class ProcessMessage extends TimestampedIRCProcessor {
148 145
             // Actions are special CTCPs
149 146
             // Bits is the message been split into 2 parts
150 147
             //         the first word and the rest
151
-            if (sParam.equalsIgnoreCase("PRIVMSG") && bits[0].equalsIgnoreCase(char1 + "ACTION") && Character.valueOf(sMessage.charAt(sMessage.length() - 1)).equals(char1)) {
148
+            final Character char1 = (char) 1;
149
+            if ("PRIVMSG".equalsIgnoreCase(sParam) && bits[0].equalsIgnoreCase(char1 + "ACTION") && Character.valueOf(sMessage.charAt(sMessage.length() - 1)).equals(char1)) {
152 150
                 isAction = true;
153 151
                 if (bits.length > 1) {
154 152
                     sMessage = bits[1];
@@ -183,14 +181,17 @@ public class ProcessMessage extends TimestampedIRCProcessor {
183 181
         }
184 182
 
185 183
         // Remove the leading : from the host.
184
+        final String firstToken;
186 185
         if (token[0].charAt(0) == ':' && token[0].length() > 1) {
187
-            token[0] = token[0].substring(1);
186
+            firstToken = token[0].substring(1);
187
+        } else {
188
+            firstToken = token[0];
188 189
         }
189 190
 
190
-        iClient = getClientInfo(token[0]);
191
+        final IRCClientInfo iClient = getClientInfo(token[0]);
191 192
         // Facilitate DMDIRC Formatter
192
-        if ((IRCParser.ALWAYS_UPDATECLIENT && iClient != null) && iClient.getHostname().isEmpty()) {
193
-            iClient.setUserBits(token[0], false);
193
+        if (IRCParser.ALWAYS_UPDATECLIENT && iClient != null && iClient.getHostname().isEmpty()) {
194
+            iClient.setUserBits(firstToken, false);
194 195
         }
195 196
 
196 197
         // Fire the appropriate callbacks.
@@ -211,77 +212,78 @@ public class ProcessMessage extends TimestampedIRCProcessor {
211 212
         final String targetName = hasModePrefix ? token[2].substring(1) : token[2];
212 213
 
213 214
         if (isValidChannelName(targetName)) {
214
-            iChannel = getChannel(targetName);
215
+            final IRCChannelInfo iChannel = getChannel(targetName);
215 216
             if (iChannel == null) {
216 217
                 // callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got message for channel ("+targetName+") that I am not on.", parser.getLastLine()));
217 218
                 return;
218 219
             }
220
+            IRCChannelClientInfo iChannelClient = null;
219 221
             if (iClient != null) {
220 222
                 iChannelClient = iChannel.getChannelClient(iClient);
221 223
             }
222
-            if (sParam.equalsIgnoreCase("PRIVMSG")) {
224
+            if ("PRIVMSG".equalsIgnoreCase(sParam)) {
223 225
                 if (isAction) {
224
-                    callChannelAction(date, iChannel, iChannelClient, sMessage, token[0]);
226
+                    callChannelAction(date, iChannel, iChannelClient, sMessage, firstToken);
225 227
                 } else {
226 228
                     if (isCTCP) {
227
-                        callChannelCTCP(date, iChannel, iChannelClient, sCTCP, sMessage, token[0]);
229
+                        callChannelCTCP(date, iChannel, iChannelClient, sCTCP, sMessage, firstToken);
228 230
                     } else if (hasModePrefix) {
229
-                        callChannelModeMessage(date, modePrefix, iChannel, iChannelClient, sMessage, token[0]);
231
+                        callChannelModeMessage(date, modePrefix, iChannel, iChannelClient, sMessage, firstToken);
230 232
                     } else {
231
-                        callChannelMessage(date, iChannel, iChannelClient, sMessage, token[0]);
233
+                        callChannelMessage(date, iChannel, iChannelClient, sMessage, firstToken);
232 234
                     }
233 235
                 }
234
-            } else if (sParam.equalsIgnoreCase("NOTICE")) {
236
+            } else if ("NOTICE".equalsIgnoreCase(sParam)) {
235 237
                 if (isCTCP) {
236
-                    callChannelCTCPReply(date, iChannel, iChannelClient, sCTCP, sMessage, token[0]);
238
+                    callChannelCTCPReply(date, iChannel, iChannelClient, sCTCP, sMessage, firstToken);
237 239
                 } else if (hasModePrefix) {
238
-                    callChannelModeNotice(date, modePrefix, iChannel, iChannelClient, sMessage, token[0]);
240
+                    callChannelModeNotice(date, modePrefix, iChannel, iChannelClient, sMessage, firstToken);
239 241
                 } else {
240
-                    callChannelNotice(date, iChannel, iChannelClient, sMessage, token[0]);
242
+                    callChannelNotice(date, iChannel, iChannelClient, sMessage, firstToken);
241 243
                 }
242 244
             }
243 245
         } else if (parser.getStringConverter().equalsIgnoreCase(token[2], parser.getMyNickname())) {
244
-            if (sParam.equalsIgnoreCase("PRIVMSG")) {
246
+            if ("PRIVMSG".equalsIgnoreCase(sParam)) {
245 247
                 if (isAction) {
246
-                    callPrivateAction(date, sMessage, token[0]);
248
+                    callPrivateAction(date, sMessage, firstToken);
247 249
                 } else {
248 250
                     if (isCTCP) {
249
-                        callPrivateCTCP(date, sCTCP, sMessage, token[0]);
251
+                        callPrivateCTCP(date, sCTCP, sMessage, firstToken);
250 252
                     } else {
251
-                        callPrivateMessage(date, sMessage, token[0]);
253
+                        callPrivateMessage(date, sMessage, firstToken);
252 254
                     }
253 255
                 }
254
-            } else if (sParam.equalsIgnoreCase("NOTICE")) {
256
+            } else if ("NOTICE".equalsIgnoreCase(sParam)) {
255 257
                 if (isCTCP) {
256
-                    callPrivateCTCPReply(date, sCTCP, sMessage, token[0]);
258
+                    callPrivateCTCPReply(date, sCTCP, sMessage, firstToken);
257 259
                 } else {
258
-                    if (token[0].indexOf('@') == -1) {
259
-                        callServerNotice(date, sMessage, token[0]);
260
+                    if (firstToken.indexOf('@') == -1) {
261
+                        callServerNotice(date, sMessage, firstToken);
260 262
                     } else {
261
-                        callPrivateNotice(date, sMessage, token[0]);
263
+                        callPrivateNotice(date, sMessage, firstToken);
262 264
                     }
263 265
                 }
264 266
             }
265 267
         } else {
266
-            callDebugInfo(IRCParser.DEBUG_INFO, "Message for Other (" + token[2] + ")");
267
-            if (sParam.equalsIgnoreCase("PRIVMSG")) {
268
+            callDebugInfo(IRCParser.DEBUG_INFO, "Message for Other (" + token[2] + ')');
269
+            if ("PRIVMSG".equalsIgnoreCase(sParam)) {
268 270
                 if (isAction) {
269
-                    callUnknownAction(date, sMessage, token[2], token[0]);
271
+                    callUnknownAction(date, sMessage, token[2], firstToken);
270 272
                 } else {
271 273
                     if (isCTCP) {
272
-                        callUnknownCTCP(date, sCTCP, sMessage, token[2], token[0]);
274
+                        callUnknownCTCP(date, sCTCP, sMessage, token[2], firstToken);
273 275
                     } else {
274
-                        callUnknownMessage(date, sMessage, token[2], token[0]);
276
+                        callUnknownMessage(date, sMessage, token[2], firstToken);
275 277
                     }
276 278
                 }
277
-            } else if (sParam.equalsIgnoreCase("NOTICE")) {
279
+            } else if ("NOTICE".equalsIgnoreCase(sParam)) {
278 280
                 if (isCTCP) {
279
-                    callUnknownCTCPReply(date, sCTCP, sMessage, token[2], token[0]);
281
+                    callUnknownCTCPReply(date, sCTCP, sMessage, token[2], firstToken);
280 282
                 } else {
281
-                    if (token[0].indexOf('@') == -1) {
282
-                        callUnknownServerNotice(date, sMessage, token[2], token[0]);
283
+                    if (firstToken.indexOf('@') == -1) {
284
+                        callUnknownServerNotice(date, sMessage, token[2], firstToken);
283 285
                     } else {
284
-                        callUnknownNotice(date, sMessage, token[2], token[0]);
286
+                        callUnknownNotice(date, sMessage, token[2], firstToken);
285 287
                     }
286 288
                 }
287 289
             }
@@ -291,276 +293,276 @@ public class ProcessMessage extends TimestampedIRCProcessor {
291 293
     /**
292 294
      * Callback to all objects implementing the ChannelAction Callback.
293 295
      *
294
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelActionListener
296
+     * @see ChannelActionListener
295 297
      * @param date The date of this line
296 298
      * @param cChannel Channel where the action was sent to
297 299
      * @param cChannelClient ChannelClient who sent the action (may be null if server)
298 300
      * @param sMessage action contents
299 301
      * @param sHost Hostname of sender (or servername)
300
-     * @return true if a method was called, false otherwise
301 302
      */
302
-    protected boolean callChannelAction(final Date date, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
303
-        return getCallbackManager().getCallbackType(ChannelActionListener.class).call(date, cChannel, cChannelClient, sMessage, sHost);
303
+    protected void callChannelAction(final Date date, final ChannelInfo cChannel,
304
+            final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
305
+        getCallbackManager().getCallbackType(ChannelActionListener.class).call(date, cChannel, cChannelClient, sMessage, sHost);
304 306
     }
305 307
 
306 308
     /**
307 309
      * Callback to all objects implementing the ChannelCTCP Callback.
308 310
      *
309
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelCtcpListener
311
+     * @see ChannelCtcpListener
310 312
      * @param date The date of this line
311 313
      * @param cChannel Channel where CTCP was sent
312 314
      * @param cChannelClient ChannelClient who sent the message (may be null if server)
313 315
      * @param sType Type of CTCP (VERSION, TIME etc)
314 316
      * @param sMessage Additional contents
315 317
      * @param sHost Hostname of sender (or servername)
316
-     * @return true if a method was called, false otherwise
317 318
      */
318
-    protected boolean callChannelCTCP(final Date date, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
319
-        return getCallbackManager().getCallbackType(ChannelCtcpListener.class).call(date, cChannel, cChannelClient, sType, sMessage, sHost);
319
+    protected void callChannelCTCP(final Date date, final ChannelInfo cChannel,
320
+            final ChannelClientInfo cChannelClient, final String sType, final String sMessage,
321
+            final String sHost) {
322
+        getCallbackManager().getCallbackType(ChannelCtcpListener.class).call(date, cChannel, cChannelClient, sType, sMessage, sHost);
320 323
     }
321 324
 
322 325
     /**
323 326
      * Callback to all objects implementing the ChannelCTCPReply Callback.
324 327
      *
325
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelCtcpReplyListener
328
+     * @see ChannelCtcpReplyListener
326 329
      * @param date The date of this line
327 330
      * @param cChannel Channel where CTCPReply was sent
328 331
      * @param cChannelClient ChannelClient who sent the message (may be null if server)
329 332
      * @param sType Type of CTCPRReply (VERSION, TIME etc)
330 333
      * @param sMessage Reply Contents
331 334
      * @param sHost Hostname of sender (or servername)
332
-     * @return true if a method was called, false otherwise
333 335
      */
334
-    protected boolean callChannelCTCPReply(final Date date, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
335
-        return getCallbackManager().getCallbackType(ChannelCtcpReplyListener.class).call(date, cChannel, cChannelClient, sType, sMessage, sHost);
336
+    protected void callChannelCTCPReply(final Date date, final ChannelInfo cChannel,
337
+            final ChannelClientInfo cChannelClient, final String sType, final String sMessage,
338
+            final String sHost) {
339
+        getCallbackManager().getCallbackType(ChannelCtcpReplyListener.class).call(date, cChannel, cChannelClient, sType, sMessage, sHost);
336 340
     }
337 341
 
338 342
     /**
339 343
      * Callback to all objects implementing the ChannelMessage Callback.
340 344
      *
341
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelMessageListener
345
+     * @see ChannelMessageListener
342 346
      * @param date The date of this line
343 347
      * @param cChannel Channel where the message was sent to
344 348
      * @param cChannelClient ChannelClient who sent the message (may be null if server)
345 349
      * @param sMessage Message contents
346 350
      * @param sHost Hostname of sender (or servername)
347
-     * @return true if a method was called, false otherwise
348 351
      */
349
-    protected boolean callChannelMessage(final Date date, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
350
-        return getCallbackManager().getCallbackType(ChannelMessageListener.class).call(date, cChannel, cChannelClient, sMessage, sHost);
352
+    protected void callChannelMessage(final Date date, final ChannelInfo cChannel,
353
+            final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
354
+        getCallbackManager().getCallbackType(ChannelMessageListener.class).call(date, cChannel, cChannelClient, sMessage, sHost);
351 355
     }
352 356
 
353 357
     /**
354 358
      * Callback to all objects implementing the ChannelNotice Callback.
355 359
      *
356
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelNoticeListener
360
+     * @see ChannelNoticeListener
357 361
      * @param date The date of this line
358 362
      * @param cChannel Channel where the notice was sent to
359 363
      * @param cChannelClient ChannelClient who sent the notice (may be null if server)
360 364
      * @param sMessage notice contents
361 365
      * @param sHost Hostname of sender (or servername)
362
-     * @return true if a method was called, false otherwise
363 366
      */
364
-    protected boolean callChannelNotice(final Date date, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
365
-        return getCallbackManager().getCallbackType(ChannelNoticeListener.class).call(date, cChannel, cChannelClient, sMessage, sHost);
367
+    protected void callChannelNotice(final Date date, final ChannelInfo cChannel,
368
+            final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
369
+        getCallbackManager().getCallbackType(ChannelNoticeListener.class).call(date, cChannel, cChannelClient, sMessage, sHost);
366 370
     }
367 371
 
368 372
     /**
369 373
      * Callback to all objects implementing the ChannelModeNotice Callback.
370 374
      *
371
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelModeNoticeListener
375
+     * @see ChannelModeNoticeListener
372 376
      * @param date The date of this line
373 377
      * @param prefix Prefix that was used to send this notice.
374 378
      * @param cChannel Channel where the notice was sent to
375 379
      * @param cChannelClient ChannelClient who sent the notice (may be null if server)
376 380
      * @param sMessage notice contents
377 381
      * @param sHost Hostname of sender (or servername)
378
-     * @return true if a method was called, false otherwise
379 382
      */
380
-    protected boolean callChannelModeNotice(final Date date, final char prefix, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
381
-        return getCallbackManager().getCallbackType(ChannelModeNoticeListener.class).call(date, cChannel, prefix, cChannelClient, sMessage, sHost);
383
+    protected void callChannelModeNotice(final Date date, final char prefix,
384
+            final ChannelInfo cChannel, final ChannelClientInfo cChannelClient,
385
+            final String sMessage, final String sHost) {
386
+        getCallbackManager().getCallbackType(ChannelModeNoticeListener.class).call(date, cChannel, prefix, cChannelClient, sMessage, sHost);
382 387
     }
383 388
 
384 389
     /**
385 390
      * Callback to all objects implementing the ChannelModeMessage Callback.
386 391
      *
387
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelModeMessageListener
392
+     * @see ChannelModeMessageListener
388 393
      * @param date The date of this line
389 394
      * @param prefix Prefix that was used to send this notice.
390 395
      * @param cChannel Channel where the notice was sent to
391 396
      * @param cChannelClient ChannelClient who sent the notice (may be null if server)
392 397
      * @param sMessage message contents
393 398
      * @param sHost Hostname of sender (or servername)
394
-     * @return true if a method was called, false otherwise
395 399
      */
396
-    protected boolean callChannelModeMessage(final Date date, final char prefix, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
397
-        return getCallbackManager().getCallbackType(ChannelModeMessageListener.class).call(date, cChannel, prefix, cChannelClient, sMessage, sHost);
400
+    protected void callChannelModeMessage(final Date date, final char prefix,
401
+            final ChannelInfo cChannel, final ChannelClientInfo cChannelClient,
402
+            final String sMessage, final String sHost) {
403
+        getCallbackManager().getCallbackType(ChannelModeMessageListener.class).call(date, cChannel, prefix, cChannelClient, sMessage, sHost);
398 404
     }
399 405
 
400 406
     /**
401 407
      * Callback to all objects implementing the PrivateAction Callback.
402 408
      *
403
-     * @see com.dmdirc.parser.interfaces.callbacks.PrivateActionListener
409
+     * @see PrivateActionListener
404 410
      * @param date The date of this line
405 411
      * @param sMessage action contents
406 412
      * @param sHost Hostname of sender (or servername)
407
-     * @return true if a method was called, false otherwise
408 413
      */
409
-    protected boolean callPrivateAction(final Date date, final String sMessage, final String sHost) {
410
-        return getCallbackManager().getCallbackType(PrivateActionListener.class).call(date, sMessage, sHost);
414
+    protected void callPrivateAction(final Date date, final String sMessage, final String sHost) {
415
+        getCallbackManager().getCallbackType(PrivateActionListener.class).call(date, sMessage, sHost);
411 416
     }
412 417
 
413 418
     /**
414 419
      * Callback to all objects implementing the PrivateCTCP Callback.
415 420
      *
416
-     * @see com.dmdirc.parser.interfaces.callbacks.PrivateCtcpListener
421
+     * @see PrivateCtcpListener
417 422
      * @param date The date of this line
418 423
      * @param sType Type of CTCP (VERSION, TIME etc)
419 424
      * @param sMessage Additional contents
420 425
      * @param sHost Hostname of sender (or servername)
421
-     * @return true if a method was called, false otherwise
422 426
      */
423
-    protected boolean callPrivateCTCP(final Date date, final String sType, final String sMessage, final String sHost) {
424
-        return getCallbackManager().getCallbackType(PrivateCtcpListener.class).call(date, sType, sMessage, sHost);
427
+    protected void callPrivateCTCP(final Date date, final String sType, final String sMessage,
428
+            final String sHost) {
429
+        getCallbackManager().getCallbackType(PrivateCtcpListener.class).call(date, sType, sMessage, sHost);
425 430
     }
426 431
 
427 432
     /**
428 433
      * Callback to all objects implementing the PrivateCTCPReply Callback.
429 434
      *
430
-     * @see com.dmdirc.parser.interfaces.callbacks.PrivateCtcpReplyListener
435
+     * @see PrivateCtcpReplyListener
431 436
      * @param date The date of this line
432 437
      * @param sType Type of CTCPRReply (VERSION, TIME etc)
433 438
      * @param sMessage Reply Contents
434 439
      * @param sHost Hostname of sender (or servername)
435
-     * @return true if a method was called, false otherwise
436 440
      */
437
-    protected boolean callPrivateCTCPReply(final Date date, final String sType, final String sMessage, final String sHost) {
438
-        return getCallbackManager().getCallbackType(PrivateCtcpReplyListener.class).call(date, sType, sMessage, sHost);
441
+    protected void callPrivateCTCPReply(final Date date, final String sType, final String sMessage,
442
+            final String sHost) {
443
+        getCallbackManager().getCallbackType(PrivateCtcpReplyListener.class).call(date, sType, sMessage, sHost);
439 444
     }
440 445
 
441 446
     /**
442 447
      * Callback to all objects implementing the PrivateMessage Callback.
443 448
      *
444
-     * @see com.dmdirc.parser.interfaces.callbacks.PrivateMessageListener
449
+     * @see PrivateMessageListener
445 450
      * @param date The date of this line
446 451
      * @param sMessage Message contents
447 452
      * @param sHost Hostname of sender (or servername)
448
-     * @return true if a method was called, false otherwise
449 453
      */
450
-    protected boolean callPrivateMessage(final Date date, final String sMessage, final String sHost) {
451
-        return getCallbackManager().getCallbackType(PrivateMessageListener.class).call(date, sMessage, sHost);
454
+    protected void callPrivateMessage(final Date date, final String sMessage, final String sHost) {
455
+        getCallbackManager().getCallbackType(PrivateMessageListener.class).call(date, sMessage, sHost);
452 456
     }
453 457
 
454 458
     /**
455 459
      * Callback to all objects implementing the PrivateNotice Callback.
456 460
      *
457
-     * @see com.dmdirc.parser.interfaces.callbacks.PrivateNoticeListener
461
+     * @see PrivateNoticeListener
458 462
      * @param date The date of this line
459 463
      * @param sMessage Notice contents
460 464
      * @param sHost Hostname of sender (or servername)
461
-     * @return true if a method was called, false otherwise
462 465
      */
463
-    protected boolean callPrivateNotice(final Date date, final String sMessage, final String sHost) {
464
-        return getCallbackManager().getCallbackType(PrivateNoticeListener.class).call(date, sMessage, sHost);
466
+    protected void callPrivateNotice(final Date date, final String sMessage, final String sHost) {
467
+        getCallbackManager().getCallbackType(PrivateNoticeListener.class).call(date, sMessage, sHost);
465 468
     }
466 469
 
467 470
     /**
468 471
      * Callback to all objects implementing the ServerNotice Callback.
469 472
      *
470
-     * @see com.dmdirc.parser.interfaces.callbacks.ServerNoticeListener
473
+     * @see ServerNoticeListener
471 474
      * @param date The date of this line
472 475
      * @param sMessage Notice contents
473 476
      * @param sHost Hostname of sender (or servername)
474
-     * @return true if a method was called, false otherwise
475 477
      */
476
-    protected boolean callServerNotice(final Date date, final String sMessage, final String sHost) {
477
-        return getCallbackManager().getCallbackType(ServerNoticeListener.class).call(date, sMessage, sHost);
478
+    protected void callServerNotice(final Date date, final String sMessage, final String sHost) {
479
+        getCallbackManager().getCallbackType(ServerNoticeListener.class).call(date, sMessage, sHost);
478 480
     }
479 481
 
480 482
     /**
481 483
      * Callback to all objects implementing the UnknownAction Callback.
482 484
      *
483
-     * @see com.dmdirc.parser.interfaces.callbacks.UnknownActionListener
485
+     * @see UnknownActionListener
484 486
      * @param date The date of this line
485 487
      * @param sMessage Action contents
486 488
      * @param sTarget Actual target of action
487 489
      * @param sHost Hostname of sender (or servername)
488
-     * @return true if a method was called, false otherwise
489 490
      */
490
-    protected boolean callUnknownAction(final Date date, final String sMessage, final String sTarget, final String sHost) {
491
-        return getCallbackManager().getCallbackType(UnknownActionListener.class).call(date, sMessage, sTarget, sHost);
491
+    protected void callUnknownAction(final Date date, final String sMessage, final String sTarget,
492
+            final String sHost) {
493
+        getCallbackManager().getCallbackType(UnknownActionListener.class).call(date, sMessage, sTarget, sHost);
492 494
     }
493 495
 
494 496
     /**
495 497
      * Callback to all objects implementing the UnknownCTCP Callback.
496 498
      *
497
-     * @see com.dmdirc.parser.interfaces.callbacks.UnknownCtcpListener
499
+     * @see UnknownCtcpListener
498 500
      * @param date The date of this line
499 501
      * @param sType Type of CTCP (VERSION, TIME etc)
500 502
      * @param sMessage Additional contents
501 503
      * @param sTarget Actual Target of CTCP
502 504
      * @param sHost Hostname of sender (or servername)
503
-     * @return true if a method was called, false otherwise
504 505
      */
505
-    protected boolean callUnknownCTCP(final Date date, final String sType, final String sMessage, final String sTarget, final String sHost) {
506
-        return getCallbackManager().getCallbackType(UnknownCtcpListener.class).call(date, sType, sMessage, sTarget, sHost);
506
+    protected void callUnknownCTCP(final Date date, final String sType, final String sMessage,
507
+            final String sTarget, final String sHost) {
508
+        getCallbackManager().getCallbackType(UnknownCtcpListener.class).call(date, sType, sMessage, sTarget, sHost);
507 509
     }
508 510
 
509 511
     /**
510 512
      * Callback to all objects implementing the UnknownCTCPReply Callback.
511 513
      *
512
-     * @see com.dmdirc.parser.interfaces.callbacks.UnknownCtcpReplyListener
514
+     * @see UnknownCtcpReplyListener
513 515
      * @param date The date of this line
514 516
      * @param sType Type of CTCPRReply (VERSION, TIME etc)
515 517
      * @param sMessage Reply Contents
516 518
      * @param sTarget Actual Target of CTCPReply
517 519
      * @param sHost Hostname of sender (or servername)
518
-     * @return true if a method was called, false otherwise
519 520
      */
520
-    protected boolean callUnknownCTCPReply(final Date date, final String sType, final String sMessage, final String sTarget, final String sHost) {
521
-        return getCallbackManager().getCallbackType(UnknownCtcpReplyListener.class).call(date, sType, sMessage, sTarget, sHost);
521
+    protected void callUnknownCTCPReply(final Date date, final String sType, final String sMessage,
522
+            final String sTarget, final String sHost) {
523
+        getCallbackManager().getCallbackType(UnknownCtcpReplyListener.class).call(date, sType, sMessage, sTarget, sHost);
522 524
     }
523 525
 
524 526
     /**
525 527
      * Callback to all objects implementing the UnknownMessage Callback.
526 528
      *
527
-     * @see com.dmdirc.parser.interfaces.callbacks.UnknownMessageListener
529
+     * @see UnknownMessageListener
528 530
      * @param date The date of this line
529 531
      * @param sMessage Message contents
530 532
      * @param sTarget Actual target of message
531 533
      * @param sHost Hostname of sender (or servername)
532
-     * @return true if a method was called, false otherwise
533 534
      */
534
-    protected boolean callUnknownMessage(final Date date, final String sMessage, final String sTarget, final String sHost) {
535
-        return getCallbackManager().getCallbackType(UnknownMessageListener.class).call(date, sMessage, sTarget, sHost);
535
+    protected void callUnknownMessage(final Date date, final String sMessage, final String sTarget,
536
+            final String sHost) {
537
+        getCallbackManager().getCallbackType(UnknownMessageListener.class).call(date, sMessage, sTarget, sHost);
536 538
     }
537 539
 
538 540
     /**
539 541
      * Callback to all objects implementing the UnknownNotice Callback.
540 542
      *
541
-     * @see com.dmdirc.parser.interfaces.callbacks.UnknownNoticeListener
543
+     * @see UnknownNoticeListener
542 544
      * @param date The date of this line
543 545
      * @param sMessage Notice contents
544 546
      * @param sTarget Actual target of notice
545 547
      * @param sHost Hostname of sender (or servername)
546
-     * @return true if a method was called, false otherwise
547 548
      */
548
-    protected boolean callUnknownNotice(final Date date, final String sMessage, final String sTarget, final String sHost) {
549
-        return getCallbackManager().getCallbackType(UnknownNoticeListener.class).call(date, sMessage, sTarget, sHost);
549
+    protected void callUnknownNotice(final Date date, final String sMessage, final String sTarget,
550
+            final String sHost) {
551
+        getCallbackManager().getCallbackType(UnknownNoticeListener.class).call(date, sMessage, sTarget, sHost);
550 552
     }
551 553
 
552 554
     /**
553 555
      * Callback to all objects implementing the UnknownNotice Callback.
554 556
      *
555
-     * @see com.dmdirc.parser.interfaces.callbacks.UnknownServerNoticeListener
557
+     * @see UnknownServerNoticeListener
556 558
      * @param date The date of this line
557 559
      * @param sMessage Notice contents
558 560
      * @param sTarget Actual target of notice
559 561
      * @param sHost Hostname of sender (or servername)
560
-     * @return true if a method was called, false otherwise
561 562
      */
562
-    protected boolean callUnknownServerNotice(final Date date, final String sMessage, final String sTarget, final String sHost) {
563
-        return getCallbackManager().getCallbackType(UnknownServerNoticeListener.class).call(date, sMessage, sTarget, sHost);
563
+    protected void callUnknownServerNotice(final Date date, final String sMessage,
564
+            final String sTarget, final String sHost) {
565
+        getCallbackManager().getCallbackType(UnknownServerNoticeListener.class).call(date, sMessage, sTarget, sHost);
564 566
     }
565 567
 
566 568
     /**

+ 34
- 38
src/com/dmdirc/parser/irc/processors/ProcessMode.java View File

@@ -81,7 +81,7 @@ public class ProcessMode extends IRCProcessor {
81 81
      * @param token IRCTokenised line to process
82 82
      */
83 83
     @Override
84
-    public void process(final String sParam, final String[] token) {
84
+    public void process(final String sParam, final String... token) {
85 85
         final String[] sModestr;
86 86
         final String sChannelName;
87 87
         switch (sParam) {
@@ -127,17 +127,6 @@ public class ProcessMode extends IRCProcessor {
127 127
      */
128 128
     public void processChanMode(final String sParam, final String[] token, final String[] sModestr, final String sChannelName) {
129 129
         final StringBuilder sFullModeStr = new StringBuilder();
130
-        String sNonUserModeStr = "";
131
-        String sNonUserModeStrParams = "";
132
-        String sModeParam;
133
-        String sTemp;
134
-        int nParam = 1;
135
-        long nTemp, nValue = 0;
136
-        boolean bPositive = true, bBooleanMode;
137
-        char cPositive = '+';
138
-        final IRCChannelInfo iChannel;
139
-        IRCChannelClientInfo iChannelClientInfo;
140
-        final IRCChannelClientInfo setterCCI;
141 130
 
142 131
         CallbackObject cbSingle = null;
143 132
         CallbackObject cbNonUser = null;
@@ -147,7 +136,7 @@ public class ProcessMode extends IRCProcessor {
147 136
             cbNonUser = getCallbackManager().getCallbackType(ChannelNonUserModeChangeListener.class);
148 137
         }
149 138
 
150
-        iChannel = getChannel(sChannelName);
139
+        final IRCChannelInfo iChannel = getChannel(sChannelName);
151 140
         if (iChannel == null) {
152 141
             return;
153 142
         }
@@ -157,20 +146,26 @@ public class ProcessMode extends IRCProcessor {
157 146
             nCurrent = iChannel.getMode();
158 147
         }
159 148
 
160
-        setterCCI = iChannel.getChannelClient(token[0]);
149
+        final IRCChannelClientInfo setterCCI = iChannel.getChannelClient(token[0]);
161 150
         // Facilitate dmdirc formatter
162 151
         if (IRCParser.ALWAYS_UPDATECLIENT && setterCCI != null && setterCCI.getClient().getHostname().isEmpty()) {
163 152
             setterCCI.getClient().setUserBits(token[0], false);
164 153
         }
165 154
 
166 155
         // Loop through the mode string, and add/remove modes/params where they are needed
156
+        char cPositive = '+';
157
+        boolean bPositive = true;
158
+        long nValue = 0;
159
+        int nParam = 1;
160
+        final StringBuilder sNonUserModeStrParams = new StringBuilder();
161
+        final StringBuilder sNonUserModeStr = new StringBuilder();
167 162
         for (int i = 0; i < sModestr[0].length(); ++i) {
168 163
             final Character cMode = sModestr[0].charAt(i);
169 164
             if (cMode.equals(":".charAt(0))) {
170 165
                 continue;
171 166
             }
172 167
 
173
-            sNonUserModeStr += cMode;
168
+            sNonUserModeStr.append(cMode);
174 169
             if (cMode.equals("+".charAt(0))) {
175 170
                 cPositive = '+';
176 171
                 bPositive = true;
@@ -178,6 +173,8 @@ public class ProcessMode extends IRCProcessor {
178 173
                 cPositive = '-';
179 174
                 bPositive = false;
180 175
             } else {
176
+                final boolean bBooleanMode;
177
+                final String sModeParam;
181 178
                 if (chanModeManager.isMode(cMode)) {
182 179
                     bBooleanMode = true;
183 180
                 } else if (parser.chanModesOther.containsKey(cMode)) {
@@ -192,7 +189,7 @@ public class ProcessMode extends IRCProcessor {
192 189
                     sModeParam = sModestr[nParam++];
193 190
                     callDebugInfo(IRCParser.DEBUG_INFO, "User Mode: %c / %s {Positive: %b}",
194 191
                             cMode, sModeParam, bPositive);
195
-                    iChannelClientInfo = iChannel.getChannelClient(sModeParam);
192
+                    final IRCChannelClientInfo iChannelClientInfo = iChannel.getChannelClient(sModeParam);
196 193
                     if (iChannelClientInfo == null) {
197 194
                         // Client not known?
198 195
                         callDebugInfo(IRCParser.DEBUG_INFO, "User Mode for client not on channel." +
@@ -203,13 +200,11 @@ public class ProcessMode extends IRCProcessor {
203 200
                             iChannelClientInfo.getAllModes());
204 201
                     if (bPositive) {
205 202
                         iChannelClientInfo.addMode(cMode);
206
-                        sTemp = "+";
207 203
                     } else {
208 204
                         iChannelClientInfo.removeMode(cMode);
209
-                        sTemp = "-";
210 205
                     }
211
-                    sTemp += cMode;
212
-                    callChannelUserModeChanged(iChannel, iChannelClientInfo, setterCCI, token[0], sTemp);
206
+                    callChannelUserModeChanged(iChannel, iChannelClientInfo, setterCCI, token[0],
207
+                            (bPositive ? "+" : "-") + cMode);
213 208
                     continue;
214 209
                 } else {
215 210
                     // unknown mode - add as boolean
@@ -237,8 +232,8 @@ public class ProcessMode extends IRCProcessor {
237 232
                     if (nValue == IRCParser.MODE_LIST) {
238 233
                         // List Mode
239 234
                         sModeParam = sModestr[nParam++];
240
-                        sNonUserModeStrParams = sNonUserModeStrParams + ' ' + sModeParam;
241
-                        nTemp = Calendar.getInstance().getTimeInMillis() / 1000;
235
+                        sNonUserModeStrParams.append(' ').append(sModeParam);
236
+                        final long nTemp = Calendar.getInstance().getTimeInMillis() / 1000;
242 237
                         iChannel.setListModeParam(cMode, new ChannelListModeItem(sModeParam, token[0], nTemp), bPositive);
243 238
                         callDebugInfo(IRCParser.DEBUG_INFO, "List Mode: %c [%s] {Positive: %b}", cMode, sModeParam, bPositive);
244 239
                         if (cbSingle != null) {
@@ -249,7 +244,7 @@ public class ProcessMode extends IRCProcessor {
249 244
                         if (bPositive) {
250 245
                             // +Mode - always needs a parameter to set
251 246
                             sModeParam = sModestr[nParam++];
252
-                            sNonUserModeStrParams = sNonUserModeStrParams + ' ' + sModeParam;
247
+                            sNonUserModeStrParams.append(' ').append(sModeParam);
253 248
                             callDebugInfo(IRCParser.DEBUG_INFO, "Set Mode: %c [%s] {Positive: %b}", cMode, sModeParam, bPositive);
254 249
                             iChannel.setModeParam(cMode, sModeParam);
255 250
                             if (cbSingle != null) {
@@ -259,7 +254,7 @@ public class ProcessMode extends IRCProcessor {
259 254
                             // -Mode - parameter isn't always needed, we need to check
260 255
                             if ((nValue & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET) {
261 256
                                 sModeParam = sModestr[nParam++];
262
-                                sNonUserModeStrParams = sNonUserModeStrParams + ' ' + sModeParam;
257
+                                sNonUserModeStrParams.append(' ').append(sModeParam);
263 258
                             } else {
264 259
                                 sModeParam = "";
265 260
                             }
@@ -286,7 +281,8 @@ public class ProcessMode extends IRCProcessor {
286 281
             callChannelModeChanged(iChannel, setterCCI, token[0], sFullModeStr.toString().trim());
287 282
         }
288 283
         if (cbNonUser != null) {
289
-            cbNonUser.call(iChannel, setterCCI, token[0], trim(sNonUserModeStr + sNonUserModeStrParams));
284
+            cbNonUser.call(iChannel, setterCCI, token[0],
285
+                    trim(sNonUserModeStr.toString() + sNonUserModeStrParams));
290 286
         }
291 287
     }
292 288
 
@@ -350,10 +346,10 @@ public class ProcessMode extends IRCProcessor {
350 346
      * @param cChannelClient Client chaning the modes (null if server)
351 347
      * @param sHost Host doing the mode changing (User host or server name)
352 348
      * @param sModes Exact String parsed
353
-     * @return true if a method was called, false otherwise
354 349
      */
355
-    protected boolean callChannelModeChanged(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sHost, final String sModes) {
356
-        return getCallbackManager().getCallbackType(ChannelModeChangeListener.class).call(cChannel, cChannelClient, sHost, sModes);
350
+    protected void callChannelModeChanged(final ChannelInfo cChannel,
351
+            final ChannelClientInfo cChannelClient, final String sHost, final String sModes) {
352
+        getCallbackManager().getCallbackType(ChannelModeChangeListener.class).call(cChannel, cChannelClient, sHost, sModes);
357 353
     }
358 354
 
359 355
     /**
@@ -363,12 +359,13 @@ public class ProcessMode extends IRCProcessor {
363 359
      * @param cChannel Channel where modes were changed
364 360
      * @param cChangedClient Client being changed
365 361
      * @param cSetByClient Client chaning the modes (null if server)
366
-     * @param sMode String representing mode change (ie +o)
367 362
      * @param sHost Host doing the mode changing (User host or server name)
368
-     * @return true if a method was called, false otherwise
363
+     * @param sMode String representing mode change (ie +o)
369 364
      */
370
-    protected boolean callChannelUserModeChanged(final ChannelInfo cChannel, final ChannelClientInfo cChangedClient, final ChannelClientInfo cSetByClient, final String sHost, final String sMode) {
371
-        return getCallbackManager().getCallbackType(ChannelUserModeChangeListener.class).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
365
+    protected void callChannelUserModeChanged(final ChannelInfo cChannel,
366
+            final ChannelClientInfo cChangedClient, final ChannelClientInfo cSetByClient,
367
+            final String sHost, final String sMode) {
368
+        getCallbackManager().getCallbackType(ChannelUserModeChangeListener.class).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
372 369
     }
373 370
 
374 371
     /**
@@ -378,10 +375,10 @@ public class ProcessMode extends IRCProcessor {
378 375
      * @param cClient Client that had the mode changed (almost always us)
379 376
      * @param sSetby Host that set the mode (us or servername)
380 377
      * @param sModes The modes set.
381
-     * @return true if a method was called, false otherwise
382 378
      */
383
-    protected boolean callUserModeChanged(final ClientInfo cClient, final String sSetby, final String sModes) {
384
-        return getCallbackManager().getCallbackType(UserModeChangeListener.class).call(cClient, sSetby, sModes);
379
+    protected void callUserModeChanged(final ClientInfo cClient, final String sSetby,
380
+            final String sModes) {
381
+        getCallbackManager().getCallbackType(UserModeChangeListener.class).call(cClient, sSetby, sModes);
385 382
     }
386 383
 
387 384
     /**
@@ -390,10 +387,9 @@ public class ProcessMode extends IRCProcessor {
390 387
      * @see UserModeDiscoveryListener
391 388
      * @param cClient Client that had the mode changed (almost always us)
392 389
      * @param sModes The modes set.
393
-     * @return true if a method was called, false otherwise
394 390
      */
395
-    protected boolean callUserModeDiscovered(final ClientInfo cClient, final String sModes) {
396
-        return getCallbackManager().getCallbackType(UserModeDiscoveryListener.class).call(cClient, sModes);
391
+    protected void callUserModeDiscovered(final ClientInfo cClient, final String sModes) {
392
+        getCallbackManager().getCallbackType(UserModeDiscoveryListener.class).call(cClient, sModes);
397 393
     }
398 394
 
399 395
     /**

+ 5
- 7
src/com/dmdirc/parser/irc/processors/ProcessNames.java View File

@@ -65,7 +65,7 @@ public class ProcessNames extends IRCProcessor {
65 65
      * @param token IRCTokenised line to process
66 66
      */
67 67
     @Override
68
-    public void process(final String sParam, final String[] token) {
68
+    public void process(final String sParam, final String... token) {
69 69
         final IRCChannelInfo iChannel;
70 70
         if ("366".equals(sParam)) {
71 71
             // End of names
@@ -142,11 +142,10 @@ public class ProcessNames extends IRCProcessor {
142 142
      * @see ChannelTopicListener
143 143
      * @param cChannel Channel that topic was set on
144 144
      * @param bIsJoinTopic True when getting topic on join, false if set by user/server
145
-     * @return true if a method was called, false otherwise
146 145
      */
147
-    protected boolean callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
146
+    protected void callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
148 147
         ((IRCChannelInfo) cChannel).setHadTopic();
149
-        return getCallbackManager().getCallbackType(ChannelTopicListener.class).call(cChannel, bIsJoinTopic);
148
+        getCallbackManager().getCallbackType(ChannelTopicListener.class).call(cChannel, bIsJoinTopic);
150 149
     }
151 150
 
152 151
     /**
@@ -154,10 +153,9 @@ public class ProcessNames extends IRCProcessor {
154 153
      *
155 154
      * @see ChannelNamesListener
156 155
      * @param cChannel Channel which the names reply is for
157
-     * @return true if a method was called, false otherwise
158 156
      */
159
-    protected boolean callChannelGotNames(final ChannelInfo cChannel) {
160
-        return getCallbackManager().getCallbackType(ChannelNamesListener.class).call(cChannel);
157
+    protected void callChannelGotNames(final ChannelInfo cChannel) {
158
+        getCallbackManager().getCallbackType(ChannelNamesListener.class).call(cChannel);
161 159
     }
162 160
 
163 161
     /**

+ 11
- 15
src/com/dmdirc/parser/irc/processors/ProcessNick.java View File

@@ -56,16 +56,13 @@ public class ProcessNick extends IRCProcessor {
56 56
      * @param token IRCTokenised line to process
57 57
      */
58 58
     @Override
59
-    public void process(final String sParam, final String[] token) {
60
-        final IRCClientInfo iClient;
61
-        IRCChannelClientInfo iChannelClient;
62
-        final String oldNickname;
59
+    public void process(final String sParam, final String... token) {
63 60
 
64
-        iClient = getClientInfo(token[0]);
61
+        final IRCClientInfo iClient = getClientInfo(token[0]);
65 62
         if (iClient == null) {
66 63
             return;
67 64
         }
68
-        oldNickname = parser.getStringConverter().toLowerCase(iClient.getNickname());
65
+        final String oldNickname = parser.getStringConverter().toLowerCase(iClient.getNickname());
69 66
         // Remove the client from the known clients list
70 67
         final boolean isSameNick = parser.getStringConverter().equalsIgnoreCase(oldNickname, token[token.length - 1]);
71 68
 
@@ -84,7 +81,7 @@ public class ProcessNick extends IRCProcessor {
84 81
 
85 82
             for (IRCChannelInfo iChannel : parser.getChannels()) {
86 83
                 // Find the user (using the old nickname)
87
-                iChannelClient = iChannel.getChannelClient(oldNickname);
84
+                final IRCChannelClientInfo iChannelClient = iChannel.getChannelClient(oldNickname);
88 85
                 if (iChannelClient != null) {
89 86
                     // Rename them. This uses the old nickname (the key in the hashtable)
90 87
                     // and the channelClient object has access to the new nickname (by way
@@ -103,26 +100,25 @@ public class ProcessNick extends IRCProcessor {
103 100
     /**
104 101
      * Callback to all objects implementing the ChannelNickChanged Callback.
105 102
      *
106
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelNickChangeListener
103
+     * @see ChannelNickChangeListener
107 104
      * @param cChannel One of the channels that the user is on
108 105
      * @param cChannelClient Client changing nickname
109 106
      * @param sOldNick Nickname before change
110
-     * @return true if a method was called, false otherwise
111 107
      */
112
-    protected boolean callChannelNickChanged(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sOldNick) {
113
-        return getCallbackManager().getCallbackType(ChannelNickChangeListener.class).call(cChannel, cChannelClient, sOldNick);
108
+    protected void callChannelNickChanged(final ChannelInfo cChannel,
109
+            final ChannelClientInfo cChannelClient, final String sOldNick) {
110
+        getCallbackManager().getCallbackType(ChannelNickChangeListener.class).call(cChannel, cChannelClient, sOldNick);
114 111
     }
115 112
 
116 113
     /**
117 114
      * Callback to all objects implementing the NickChanged Callback.
118 115
      *
119
-     * @see com.dmdirc.parser.interfaces.callbacks.NickChangeListener
116
+     * @see NickChangeListener
120 117
      * @param cClient Client changing nickname
121 118
      * @param sOldNick Nickname before change
122
-     * @return true if a method was called, false otherwise
123 119
      */
124
-    protected boolean callNickChanged(final ClientInfo cClient, final String sOldNick) {
125
-        return getCallbackManager().getCallbackType(NickChangeListener.class).call(cClient, sOldNick);
120
+    protected void callNickChanged(final ClientInfo cClient, final String sOldNick) {
121
+        getCallbackManager().getCallbackType(NickChangeListener.class).call(cClient, sOldNick);
126 122
     }
127 123
 
128 124
     /**

+ 2
- 2
src/com/dmdirc/parser/irc/processors/ProcessNickInUse.java View File

@@ -61,7 +61,7 @@ public class ProcessNickInUse extends IRCProcessor {
61 61
      * @param token IRCTokenised line to process
62 62
      */
63 63
     @Override
64
-    public void process(final String sParam, final String[] token) {
64
+    public void process(final String sParam, final String... token) {
65 65
         if (!callNickInUse(token[3])) {
66 66
             // Manually handle nick in use.
67 67
             callDebugInfo(IRCParser.DEBUG_INFO, "No Nick in use Handler.");
@@ -87,7 +87,7 @@ public class ProcessNickInUse extends IRCProcessor {
87 87
      * Callback to all objects implementing the NickInUse Callback.
88 88
      *
89 89
      * @param nickname Nickname that was wanted.
90
-     * @see com.dmdirc.parser.interfaces.callbacks.NickInUseListener
90
+     * @see NickInUseListener
91 91
      * @return true if a method was called, false otherwise
92 92
      */
93 93
     protected boolean callNickInUse(final String nickname) {

+ 4
- 5
src/com/dmdirc/parser/irc/processors/ProcessNoticeAuth.java View File

@@ -48,19 +48,18 @@ public class ProcessNoticeAuth extends IRCProcessor {
48 48
      * @param token IRCTokenised line to process
49 49
      */
50 50
     @Override
51
-    public void process(final String sParam, final String[] token) {
51
+    public void process(final String sParam, final String... token) {
52 52
         callNoticeAuth(token[token.length - 1]);
53 53
     }
54 54
 
55 55
     /**
56 56
      * Callback to all objects implementing the NoticeAuth Callback.
57 57
      *
58
-     * @see com.dmdirc.parser.interfaces.callbacks.AuthNoticeListener
58
+     * @see AuthNoticeListener
59 59
      * @param data Incomming Line.
60
-     * @return true if a method was called, false otherwise
61 60
      */
62
-    protected boolean callNoticeAuth(final String data) {
63
-        return getCallbackManager().getCallbackType(AuthNoticeListener.class).call(data);
61
+    protected void callNoticeAuth(final String data) {
62
+        getCallbackManager().getCallbackType(AuthNoticeListener.class).call(data);
64 63
     }
65 64
 
66 65
     /**

+ 11
- 13
src/com/dmdirc/parser/irc/processors/ProcessPart.java View File

@@ -54,18 +54,15 @@ public class ProcessPart extends IRCProcessor {
54 54
      * @param token IRCTokenised line to process
55 55
      */
56 56
     @Override
57
-    public void process(final String sParam, final String[] token) {
57
+    public void process(final String sParam, final String... token) {
58 58
         // :nick!ident@host PART #Channel
59 59
         // :nick!ident@host PART #Channel :reason
60 60
         if (token.length < 3) {
61 61
             return;
62 62
         }
63
-        final IRCClientInfo iClient;
64
-        final IRCChannelInfo iChannel;
65
-        final IRCChannelClientInfo iChannelClient;
66 63
 
67
-        iClient = getClientInfo(token[0]);
68
-        iChannel = getChannel(token[2]);
64
+        final IRCClientInfo iClient = getClientInfo(token[0]);
65
+        final IRCChannelInfo iChannel = getChannel(token[2]);
69 66
 
70 67
         if (iClient == null) {
71 68
             return;
@@ -76,15 +73,16 @@ public class ProcessPart extends IRCProcessor {
76 73
         }
77 74
         if (iChannel == null) {
78 75
             if (iClient != parser.getLocalClient()) {
79
-                callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got part for channel (" + token[2] + ") that I am not on. [User: " + token[0] + "]", parser.getLastLine()));
76
+                callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got part for channel (" + token[2] + ") that I am not on. [User: " + token[0] +
77
+
78
+                        ']', parser.getLastLine()));
80 79
             }
81
-            return;
82 80
         } else {
83 81
             String sReason = "";
84 82
             if (token.length > 3) {
85 83
                 sReason = token[token.length - 1];
86 84
             }
87
-            iChannelClient = iChannel.getChannelClient(iClient);
85
+            final IRCChannelClientInfo iChannelClient = iChannel.getChannelClient(iClient);
88 86
             if (iChannelClient == null) {
89 87
                 // callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got part for channel ("+token[2]+") for a non-existant user. [User: "+token[0]+"]", parser.getLastLine()));
90 88
                 return;
@@ -107,14 +105,14 @@ public class ProcessPart extends IRCProcessor {
107 105
     /**
108 106
      * Callback to all objects implementing the ChannelPart Callback.
109 107
      *
110
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelPartListener
108
+     * @see ChannelPartListener
111 109
      * @param cChannel Channel that the user parted
112 110
      * @param cChannelClient Client that parted
113 111
      * @param sReason Reason given for parting (May be "")
114
-     * @return true if a method was called, false otherwise
115 112
      */
116
-    protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
117
-        return getCallbackManager().getCallbackType(ChannelPartListener.class).call(cChannel, cChannelClient, sReason);
113
+    protected void callChannelPart(final ChannelInfo cChannel,
114
+            final ChannelClientInfo cChannelClient, final String sReason) {
115
+        getCallbackManager().getCallbackType(ChannelPartListener.class).call(cChannel, cChannelClient, sReason);
118 116
     }
119 117
 
120 118
     /**

+ 11
- 15
src/com/dmdirc/parser/irc/processors/ProcessQuit.java View File

@@ -34,7 +34,6 @@ import com.dmdirc.parser.irc.IRCParser;
34 34
 import com.dmdirc.parser.irc.ProcessingManager;
35 35
 
36 36
 import java.util.ArrayList;
37
-import java.util.List;
38 37
 
39 38
 /**
40 39
  * Process a Quit message.
@@ -58,16 +57,14 @@ public class ProcessQuit extends IRCProcessor {
58 57
      * @param token IRCTokenised line to process
59 58
      */
60 59
     @Override
61
-    public void process(final String sParam, final String[] token) {
60
+    public void process(final String sParam, final String... token) {
62 61
         // :nick!ident@host QUIT
63 62
         // :nick!ident@host QUIT :reason
64 63
         if (token.length < 2) {
65 64
             return;
66 65
         }
67
-        final IRCClientInfo iClient;
68
-        IRCChannelClientInfo iChannelClient;
69 66
 
70
-        iClient = getClientInfo(token[0]);
67
+        final IRCClientInfo iClient = getClientInfo(token[0]);
71 68
 
72 69
         if (iClient == null) {
73 70
             return;
@@ -81,9 +78,9 @@ public class ProcessQuit extends IRCProcessor {
81 78
             sReason = token[token.length - 1];
82 79
         }
83 80
 
84
-        final List<IRCChannelInfo> channelList = new ArrayList<>(parser.getChannels());
81
+        final Iterable<IRCChannelInfo> channelList = new ArrayList<>(parser.getChannels());
85 82
         for (IRCChannelInfo iChannel : channelList) {
86
-            iChannelClient = iChannel.getChannelClient(iClient);
83
+            final IRCChannelClientInfo iChannelClient = iChannel.getChannelClient(iClient);
87 84
             if (iChannelClient != null) {
88 85
                 if (parser.getRemoveAfterCallback()) {
89 86
                     callChannelQuit(iChannel, iChannelClient, sReason);
@@ -116,26 +113,25 @@ public class ProcessQuit extends IRCProcessor {
116 113
     /**
117 114
      * Callback to all objects implementing the ChannelQuit Callback.
118 115
      *
119
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelQuitListener
116
+     * @see ChannelQuitListener
120 117
      * @param cChannel Channel that user was on
121 118
      * @param cChannelClient User thats quitting
122 119
      * @param sReason Quit reason
123
-     * @return true if a method was called, false otherwise
124 120
      */
125
-    protected boolean callChannelQuit(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
126
-        return getCallbackManager().getCallbackType(ChannelQuitListener.class).call(cChannel, cChannelClient, sReason);
121
+    protected void callChannelQuit(final ChannelInfo cChannel,
122
+            final ChannelClientInfo cChannelClient, final String sReason) {
123
+        getCallbackManager().getCallbackType(ChannelQuitListener.class).call(cChannel, cChannelClient, sReason);
127 124
     }
128 125
 
129 126
     /**
130 127
      * Callback to all objects implementing the Quit Callback.
131 128
      *
132
-     * @see com.dmdirc.parser.interfaces.callbacks.QuitListener
129
+     * @see QuitListener
133 130
      * @param cClient Client Quitting
134 131
      * @param sReason Reason for quitting (may be "")
135
-     * @return true if a method was called, false otherwise
136 132
      */
137
-    protected boolean callQuit(final ClientInfo cClient, final String sReason) {
138
-        return getCallbackManager().getCallbackType(QuitListener.class).call(cClient, sReason);
133
+    protected void callQuit(final ClientInfo cClient, final String sReason) {
134
+        getCallbackManager().getCallbackType(QuitListener.class).call(cClient, sReason);
139 135
     }
140 136
 
141 137
     /**

+ 5
- 9
src/com/dmdirc/parser/irc/processors/ProcessTopic.java View File

@@ -51,7 +51,7 @@ public class ProcessTopic extends IRCProcessor {
51 51
      * @param token IRCTokenised line to process
52 52
      */
53 53
     @Override
54
-    public void process(final String sParam, final String[] token) {
54
+    public void process(final String sParam, final String... token) {
55 55
         final IRCChannelInfo iChannel;
56 56
         switch (sParam) {
57 57
             case "332":
@@ -86,10 +86,7 @@ public class ProcessTopic extends IRCProcessor {
86 86
                     return;
87 87
                 }
88 88
                 iChannel.setTopicTime(System.currentTimeMillis() / 1000);
89
-                if (token[0].charAt(0) == ':') {
90
-                    token[0] = token[0].substring(1);
91
-                }
92
-                iChannel.setTopicUser(token[0]);
89
+                iChannel.setTopicUser(token[0].charAt(0) == ':' ? token[0].substring(1) : token[0]);
93 90
                 iChannel.setInternalTopic(token[token.length - 1]);
94 91
                 callChannelTopic(iChannel, false);
95 92
                 break;
@@ -99,14 +96,13 @@ public class ProcessTopic extends IRCProcessor {
99 96
     /**
100 97
      * Callback to all objects implementing the ChannelTopic Callback.
101 98
      *
102
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelTopicListener
99
+     * @see ChannelTopicListener
103 100
      * @param cChannel Channel that topic was set on
104 101
      * @param bIsJoinTopic True when getting topic on join, false if set by user/server
105
-     * @return true if a method was called, false otherwise
106 102
      */
107
-    protected boolean callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
103
+    protected void callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
108 104
         ((IRCChannelInfo) cChannel).setHadTopic();
109
-        return getCallbackManager().getCallbackType(ChannelTopicListener.class).call(cChannel, bIsJoinTopic);
105
+        getCallbackManager().getCallbackType(ChannelTopicListener.class).call(cChannel, bIsJoinTopic);
110 106
     }
111 107
 
112 108
     /**

+ 13
- 16
src/com/dmdirc/parser/irc/processors/ProcessWallops.java View File

@@ -50,7 +50,7 @@ public class ProcessWallops extends IRCProcessor {
50 50
      * @param token IRCTokenised line to process
51 51
      */
52 52
     @Override
53
-    public void process(final String sParam, final String[] token) {
53
+    public void process(final String sParam, final String... token) {
54 54
         if (token.length < 3) {
55 55
             return;
56 56
         }
@@ -77,37 +77,34 @@ public class ProcessWallops extends IRCProcessor {
77 77
     /**
78 78
      * Callback to all objects implementing the Wallop Callback.
79 79
      *
80
-     * @see com.dmdirc.parser.interfaces.callbacks.WallopListener
81
-     * @param host Host of the user who sent the wallop
80
+     * @see WallopListener
82 81
      * @param message The message
83
-     * @return true if a method was called, false otherwise
82
+     * @param host Host of the user who sent the wallop
84 83
      */
85
-    protected boolean callWallop(final String message, final String host) {
86
-        return getCallbackManager().getCallbackType(WallopListener.class).call(message, host);
84
+    protected void callWallop(final String message, final String host) {
85
+        getCallbackManager().getCallbackType(WallopListener.class).call(message, host);
87 86
     }
88 87
 
89 88
     /**
90 89
      * Callback to all objects implementing the Walluser Callback.
91 90
      *
92
-     * @see com.dmdirc.parser.interfaces.callbacks.WalluserListener
93
-     * @param host Host of the user who sent the walluser
91
+     * @see WalluserListener
94 92
      * @param message The message
95
-     * @return true if a method was called, false otherwise
93
+     * @param host Host of the user who sent the walluser
96 94
      */
97
-    protected boolean callWalluser(final String message, final String host) {
98
-        return getCallbackManager().getCallbackType(WalluserListener.class).call(message, host);
95
+    protected void callWalluser(final String message, final String host) {
96
+        getCallbackManager().getCallbackType(WalluserListener.class).call(message, host);
99 97
     }
100 98
 
101 99
     /**
102 100
      * Callback to all objects implementing the WallDesync Callback.
103 101
      *
104
-     * @see com.dmdirc.parser.interfaces.callbacks.WallDesyncListener
105
-     * @param host Host of the user who sent the WallDesync
102
+     * @see WallDesyncListener
106 103
      * @param message The message
107
-     * @return true if a method was called, false otherwise
104
+     * @param host Host of the user who sent the WallDesync
108 105
      */
109
-    protected boolean callWallDesync(final String message, final String host) {
110
-        return getCallbackManager().getCallbackType(WallDesyncListener.class).call(message, host);
106
+    protected void callWallDesync(final String message, final String host) {
107
+        getCallbackManager().getCallbackType(WallDesyncListener.class).call(message, host);
111 108
     }
112 109
 
113 110
     /**

+ 16
- 17
src/com/dmdirc/parser/irc/processors/ProcessWho.java View File

@@ -55,7 +55,7 @@ public class ProcessWho extends IRCProcessor {
55 55
      * @param token IRCTokenised line to process
56 56
      */
57 57
     @Override
58
-    public void process(final String sParam, final String[] token) {
58
+    public void process(final String sParam, final String... token) {
59 59
         // :blueyonder2.uk.quakenet.org 352 Dataforce #mdbot shane Tobavaj.users.quakenet.org *.quakenet.org Tobavaj G+x :3 Tobavaj - http://shane.dmdirc.com/scriptbot.php
60 60
         //              0               1      2        3     4              5                      6           7     8        9
61 61
         // :blueyonder2.uk.quakenet.org 352 Dataforce #mdbot ~Dataforce ResNetUser-BrynDinas-147.143.246.102.bangor.ac.uk *.quakenet.org Dataforce H@ :0 Dataforce
@@ -68,7 +68,7 @@ public class ProcessWho extends IRCProcessor {
68 68
         final IRCClientInfo client = getClientInfo(token[7]);
69 69
         if (client != null) {
70 70
             // Update ident/host
71
-            client.setUserBits(token[7] + "!" + token[4] + "@" + token[5], false);
71
+            client.setUserBits(token[7] + '!' + token[4] + '@' + token[5], false);
72 72
             // Update real name
73 73
             if (client.getRealname().isEmpty()) {
74 74
                 final String name = token[9].split(" ", 2)[1];
@@ -76,7 +76,7 @@ public class ProcessWho extends IRCProcessor {
76 76
             }
77 77
             // Update away state
78 78
             final String mode = token[8];
79
-            final AwayState isAway = (mode.indexOf('G') == -1) ? AwayState.HERE : AwayState.AWAY;
79
+            final AwayState isAway = mode.indexOf('G') == -1 ? AwayState.HERE : AwayState.AWAY;
80 80
             if (client.getAwayState() != isAway) {
81 81
                 final AwayState oldState = client.getAwayState();
82 82
                 client.setAwayState(isAway);
@@ -85,9 +85,8 @@ public class ProcessWho extends IRCProcessor {
85 85
                 } else {
86 86
                     callAwayStateOther(client, oldState, isAway);
87 87
 
88
-                    ChannelClientInfo iChannelClient;
89 88
                     for (ChannelInfo iChannel : parser.getChannels()) {
90
-                        iChannelClient = iChannel.getChannelClient(client);
89
+                        final ChannelClientInfo iChannelClient = iChannel.getChannelClient(client);
91 90
                         if (iChannelClient != null) {
92 91
                             callChannelAwayStateOther(iChannel, iChannelClient, oldState, isAway);
93 92
                         }
@@ -100,41 +99,41 @@ public class ProcessWho extends IRCProcessor {
100 99
     /**
101 100
      * Callback to all objects implementing the onAwayState Callback.
102 101
      *
103
-     * @see com.dmdirc.parser.interfaces.callbacks.AwayStateListener
102
+     * @see AwayStateListener
104 103
      * @param oldState Old Away State
105 104
      * @param currentState Current Away State
106 105
      * @param reason Best guess at away reason
107
-     * @return true if a method was called, false otherwise
108 106
      */
109
-    protected boolean callAwayState(final AwayState oldState, final AwayState currentState, final String reason) {
110
-        return getCallbackManager().getCallbackType(AwayStateListener.class).call(oldState, currentState, reason);
107
+    protected void callAwayState(final AwayState oldState, final AwayState currentState,
108
+            final String reason) {
109
+        getCallbackManager().getCallbackType(AwayStateListener.class).call(oldState, currentState, reason);
111 110
     }
112 111
 
113 112
     /**
114 113
      * Callback to all objects implementing the onAwayStateOther Callback.
115 114
      *
116
-     * @see com.dmdirc.parser.interfaces.callbacks.OtherAwayStateListener
115
+     * @see OtherAwayStateListener
117 116
      * @param client Client this is for
118 117
      * @param oldState Old Away State
119 118
      * @param state Current Away State
120
-     * @return true if a method was called, false otherwise
121 119
      */
122
-    protected boolean callAwayStateOther(final ClientInfo client, final AwayState oldState, final AwayState state) {
123
-        return getCallbackManager().getCallbackType(OtherAwayStateListener.class).call(client, oldState, state);
120
+    protected void callAwayStateOther(final ClientInfo client, final AwayState oldState,
121
+            final AwayState state) {
122
+        getCallbackManager().getCallbackType(OtherAwayStateListener.class).call(client, oldState, state);
124 123
     }
125 124
 
126 125
     /**
127 126
      * Callback to all objects implementing the onChannelAwayStateOther Callback.
128 127
      *
129
-     * @see com.dmdirc.parser.interfaces.callbacks.ChannelOtherAwayStateListener
128
+     * @see ChannelOtherAwayStateListener
130 129
      * @param channel Channel this is for
131 130
      * @param channelClient ChannelClient this is for
132 131
      * @param oldState Old Away State
133 132
      * @param state Current Away State
134
-     * @return true if a method was called, false otherwise
135 133
      */
136
-    protected boolean callChannelAwayStateOther(final ChannelInfo channel, final ChannelClientInfo channelClient, final AwayState oldState, final AwayState state) {
137
-        return getCallbackManager().getCallbackType(ChannelOtherAwayStateListener.class).call(channel, channelClient, oldState, state);
134
+    protected void callChannelAwayStateOther(final ChannelInfo channel,
135
+            final ChannelClientInfo channelClient, final AwayState oldState, final AwayState state) {
136
+        getCallbackManager().getCallbackType(ChannelOtherAwayStateListener.class).call(channel, channelClient, oldState, state);
138 137
     }
139 138
 
140 139
     /**

Loading…
Cancel
Save