Browse Source

Remove deprecated parser methods for converting strings

	- Updated everything to use non-deprecated way
Replace stupid implementations of handles() in callbacks with decent code.
Spaces -> Tabs *runs*

Issue 1274


git-svn-id: http://svn.dmdirc.com/trunk@4157 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 years ago
parent
commit
264cf29661
31 changed files with 220 additions and 362 deletions
  1. 2
    2
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  2. 2
    2
      src/com/dmdirc/commandparser/commands/server/Ignore.java
  3. 2
    3
      src/com/dmdirc/parser/ChannelClientInfo.java
  4. 7
    7
      src/com/dmdirc/parser/ChannelInfo.java
  5. 7
    7
      src/com/dmdirc/parser/ChannelListModeItem.java
  6. 9
    9
      src/com/dmdirc/parser/ClientInfo.java
  7. 27
    75
      src/com/dmdirc/parser/IRCParser.java
  8. 5
    8
      src/com/dmdirc/parser/Process001.java
  9. 4
    5
      src/com/dmdirc/parser/Process004005.java
  10. 5
    8
      src/com/dmdirc/parser/Process464.java
  11. 4
    9
      src/com/dmdirc/parser/ProcessAway.java
  12. 4
    5
      src/com/dmdirc/parser/ProcessInvite.java
  13. 7
    12
      src/com/dmdirc/parser/ProcessJoin.java
  14. 6
    9
      src/com/dmdirc/parser/ProcessKick.java
  15. 6
    8
      src/com/dmdirc/parser/ProcessListModes.java
  16. 7
    15
      src/com/dmdirc/parser/ProcessMOTD.java
  17. 35
    53
      src/com/dmdirc/parser/ProcessMessage.java
  18. 11
    19
      src/com/dmdirc/parser/ProcessMode.java
  19. 5
    9
      src/com/dmdirc/parser/ProcessNames.java
  20. 9
    13
      src/com/dmdirc/parser/ProcessNick.java
  21. 8
    11
      src/com/dmdirc/parser/ProcessNickInUse.java
  22. 5
    8
      src/com/dmdirc/parser/ProcessNoticeAuth.java
  23. 6
    9
      src/com/dmdirc/parser/ProcessPart.java
  24. 8
    12
      src/com/dmdirc/parser/ProcessQuit.java
  25. 5
    10
      src/com/dmdirc/parser/ProcessTopic.java
  26. 9
    13
      src/com/dmdirc/parser/ProcessWallops.java
  27. 5
    9
      src/com/dmdirc/parser/ProcessWho.java
  28. 1
    2
      src/com/dmdirc/parser/ProcessingManager.java
  29. 6
    6
      src/com/dmdirc/parser/callbacks/CallbackManager.java
  30. 1
    2
      src/com/dmdirc/parser/callbacks/CallbackObject.java
  31. 2
    2
      src/com/dmdirc/parser/callbacks/CallbackObjectSpecific.java

+ 2
- 2
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java View File

@@ -93,9 +93,9 @@ public final class NickColourPlugin extends Plugin implements ActionListener {
93 93
         final Map map = client.getMap();
94 94
         final ClientInfo myself = client.getClient().getParser().getMyself();
95 95
         final String nickOption1 = "color:"
96
-                + client.getClient().getParser().toLowerCase(network + ":" + client.getNickname());
96
+                + client.getClient().getParser().getIRCStringConverter().toLowerCase(network + ":" + client.getNickname());
97 97
         final String nickOption2 = "color:"
98
-                + client.getClient().getParser().toLowerCase("*:" + client.getNickname());
98
+                + client.getClient().getParser().getIRCStringConverter().toLowerCase("*:" + client.getNickname());
99 99
         
100 100
         if (IdentityManager.getGlobalConfig().getOptionBool(DOMAIN, "useowncolour", false)
101 101
                 && client.getClient().equals(myself)) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Ignore.java View File

@@ -102,7 +102,7 @@ public final class Ignore extends ServerCommand implements IntelligentCommand {
102 102
             
103 103
         } else if (args[0].toLowerCase().equals("remove") && args.length > 1) {
104 104
             
105
-            final String host = server.getParser().toLowerCase(implodeArgs(1, args));
105
+            final String host = server.getParser().getIRCStringConverter().toLowerCase(implodeArgs(1, args));
106 106
             
107 107
             final StringBuffer newlist = new StringBuffer();
108 108
             boolean found = false;
@@ -112,7 +112,7 @@ public final class Ignore extends ServerCommand implements IntelligentCommand {
112 112
                 
113 113
                 
114 114
                 for (String entry : list.split("\n")) {
115
-                    if (server.getParser().toLowerCase(entry).equals(host)) {
115
+                    if (server.getParser().getIRCStringConverter().toLowerCase(entry).equals(host)) {
116 116
                         found = true;
117 117
                     } else {
118 118
                         if (newlist.length() > 0) {

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

@@ -191,7 +191,7 @@ public final class ChannelClientInfo {
191 191
 	 *
192 192
 	 * @return String Value of user (inc prefix) (ie @Nickname)
193 193
 	 */
194
-    @Override
194
+	@Override
195 195
 	public String toString() { 
196 196
 		return this.getImportantModePrefix() + this.getNickname();
197 197
 	}	
@@ -202,8 +202,7 @@ public final class ChannelClientInfo {
202 202
 	 * @param sReason Why are they being kicked? "" for no reason
203 203
 	 */
204 204
 	public void kick(final String sReason) {
205
-		myParser.sendString("KICK " + myChannel + " " + this.getNickname()
206
-                + (sReason.isEmpty() ? sReason : " :" + sReason));
205
+		myParser.sendString("KICK " + myChannel + " " + this.getNickname() + (sReason.isEmpty() ? sReason : " :" + sReason));
207 206
 	}
208 207
 	
209 208
 	/**

+ 7
- 7
src/com/dmdirc/parser/ChannelInfo.java View File

@@ -64,7 +64,7 @@ public final class ChannelInfo {
64 64
 	
65 65
 	/** Channel Name. */
66 66
 	private final String sName;
67
-    
67
+	
68 68
 	/** Hashtable containing references to ChannelClients. */
69 69
 	private final Map<String, ChannelClientInfo> hChannelUserList = new Hashtable<String, ChannelClientInfo>();
70 70
 	/** Hashtable storing values for modes set in the channel that use parameters. */
@@ -294,7 +294,7 @@ public final class ChannelInfo {
294 294
 	 */
295 295
 	public ChannelClientInfo getUser(String sWho) {
296 296
 		sWho = ClientInfo.parseHost(sWho);
297
-		sWho = myParser.toLowerCase(sWho);
297
+		sWho = myParser.getIRCStringConverter().toLowerCase(sWho);
298 298
 		if (hChannelUserList.containsKey(sWho)) {
299 299
 			return hChannelUserList.get(sWho);
300 300
 		}
@@ -326,7 +326,7 @@ public final class ChannelInfo {
326 326
 		ChannelClientInfo cTemp = getUser(cClient);
327 327
 		if (cTemp == null) { 
328 328
 			cTemp = new ChannelClientInfo(myParser, cClient, this);
329
-			hChannelUserList.put(myParser.toLowerCase(cTemp.getNickname()), cTemp);
329
+			hChannelUserList.put(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()), cTemp);
330 330
 		}
331 331
 		return cTemp;
332 332
 	}
@@ -345,7 +345,7 @@ public final class ChannelInfo {
345 345
 			if (clTemp != myParser.getMyself() && !clTemp.checkVisibility()) {
346 346
 				myParser.removeClient(clTemp);
347 347
 			}
348
-			hChannelUserList.remove(myParser.toLowerCase(cTemp.getNickname()));
348
+			hChannelUserList.remove(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()));
349 349
 		}
350 350
 	}	
351 351
 	
@@ -364,7 +364,7 @@ public final class ChannelInfo {
364 364
 				hChannelUserList.remove(oldNickname);
365 365
 				// Add with the new key. (getNickname will return the new name not the
366 366
 				// old one)
367
-				hChannelUserList.put(myParser.toLowerCase(cTemp.getNickname()), cTemp);
367
+				hChannelUserList.put(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()), cTemp);
368 368
 			}
369 369
 		}
370 370
 	}
@@ -520,7 +520,7 @@ public final class ChannelInfo {
520 520
 		}
521 521
 		final ArrayList<ChannelListModeItem> lModes = hListModes.get(cMode);
522 522
 		for (int i = 0; i < lModes.size(); i++) {
523
-			if (myParser.equalsIgnoreCase(lModes.get(i).getItem(), newItem.getItem())) { 
523
+			if (myParser.getIRCStringConverter().equalsIgnoreCase(lModes.get(i).getItem(), newItem.getItem())) { 
524 524
 				if (bAdd) { return; }
525 525
 				else { 
526 526
 					lModes.remove(i);
@@ -742,7 +742,7 @@ public final class ChannelInfo {
742 742
 	 *
743 743
 	 * @return String representation of the Channel.
744 744
 	 */
745
-    @Override
745
+	@Override
746 746
 	public String toString() { return sName; }
747 747
 	
748 748
 	/**

+ 7
- 7
src/com/dmdirc/parser/ChannelListModeItem.java View File

@@ -34,7 +34,7 @@ package com.dmdirc.parser;
34 34
  */
35 35
 public final class ChannelListModeItem {
36 36
 
37
-    /** The Item itself. */
37
+	/** The Item itself. */
38 38
 	private final String myItem;
39 39
 	
40 40
 	/** The Time the item was created. */
@@ -55,10 +55,10 @@ public final class ChannelListModeItem {
55 55
 		myTime = time;
56 56
 
57 57
 		if (!owner.isEmpty() && owner.charAt(0) == ':') {
58
-            myOwner = owner.substring(1);
59
-        } else {
60
-            myOwner = owner;
61
-        }
58
+			myOwner = owner.substring(1);
59
+		} else {
60
+			myOwner = owner;
61
+		}
62 62
 	}
63 63
 	
64 64
 	/**
@@ -87,9 +87,9 @@ public final class ChannelListModeItem {
87 87
 	*
88 88
 	* @return String representation of this object
89 89
 	*/
90
-    @Override
90
+	@Override
91 91
 	public String toString() {
92
-			return getItem();
92
+		return getItem();
93 93
 	}
94 94
 
95 95
 }

+ 9
- 9
src/com/dmdirc/parser/ClientInfo.java View File

@@ -179,7 +179,7 @@ public final class ClientInfo {
179 179
 	 *
180 180
 	 * @return String representation of the user.
181 181
 	 */
182
-    @Override
182
+	@Override
183 183
 	public String toString() { return sNickname + "!" + sIdent + "@" + sHost; }
184 184
 	
185 185
 	/**
@@ -188,14 +188,14 @@ public final class ClientInfo {
188 188
 	 * @return Known nickname for user.
189 189
 	 */
190 190
 	public String getNickname() { return sNickname; }
191
-    
191
+	
192 192
 	/**
193 193
 	 * Get the ident for this user.
194 194
 	 *
195 195
 	 * @return Known ident for user. (May be "")
196 196
 	 */		
197 197
 	public String getIdent() { return sIdent; }
198
-    
198
+	
199 199
 	/**
200 200
 	 * Get the hostname for this user.
201 201
 	 *
@@ -213,7 +213,7 @@ public final class ClientInfo {
213 213
 		bIsAway = bNewState;
214 214
 		if (!bIsAway) { myAwayReason = ""; }
215 215
 	}
216
-    
216
+	
217 217
 	/**
218 218
 	 * Get the away state of a user.
219 219
 	 *
@@ -227,7 +227,7 @@ public final class ClientInfo {
227 227
 	 * @return Known away reason for user.
228 228
 	 */
229 229
 	public String getAwayReason() { return myAwayReason; }
230
-    
230
+	
231 231
 	/**
232 232
 	 * Set the Away Reason for this user.
233 233
 	 * Automatically set to "" if awaystate is set to false
@@ -242,7 +242,7 @@ public final class ClientInfo {
242 242
 	 * @return Known RealName for user.
243 243
 	 */
244 244
 	public String getRealName() { return sRealName; }
245
-    
245
+	
246 246
 	/**
247 247
 	 * Set the RealName for this user.
248 248
 	 *
@@ -256,7 +256,7 @@ public final class ClientInfo {
256 256
 	 * @param nNewMode new long representing channel modes. (Boolean only)
257 257
 	 */	
258 258
 	protected void setUserMode(final long nNewMode) { nModes = nNewMode; }
259
-    
259
+	
260 260
 	/**
261 261
 	 * Get the user modes (as an integer).
262 262
 	 *
@@ -300,7 +300,7 @@ public final class ClientInfo {
300 300
 	 * @param cci ChannelClientInfo to add as a known reference
301 301
 	 */	
302 302
 	public void addChannelClientInfo(final ChannelClientInfo cci) {
303
-		final String key = myParser.toLowerCase(cci.getChannel().getName());
303
+		final String key = myParser.getIRCStringConverter().toLowerCase(cci.getChannel().getName());
304 304
 		if (!myChannelClientInfos.containsKey(key)) {
305 305
 			myChannelClientInfos.put(key, cci);
306 306
 		}
@@ -312,7 +312,7 @@ public final class ClientInfo {
312 312
 	 * @param cci ChannelClientInfo to remove as a known reference
313 313
 	 */	
314 314
 	public void delChannelClientInfo(final ChannelClientInfo cci) {
315
-		final String key = myParser.toLowerCase(cci.getChannel().getName());
315
+		final String key = myParser.getIRCStringConverter().toLowerCase(cci.getChannel().getName());
316 316
 		if (myChannelClientInfos.containsKey(key)) {
317 317
 			myChannelClientInfos.remove(key);
318 318
 		}

+ 27
- 75
src/com/dmdirc/parser/IRCParser.java View File

@@ -238,11 +238,11 @@ public class IRCParser implements Runnable {
238 238
 	/** This is the default TrustManager for SSL Sockets, it trusts all ssl certs. */
239 239
 	private final TrustManager[] trustAllCerts = {
240 240
 		new X509TrustManager() {
241
-            @Override
242
-            public X509Certificate[] getAcceptedIssuers() { return null;	}
243
-            @Override
241
+			@Override
242
+			public X509Certificate[] getAcceptedIssuers() { return null; }
243
+			@Override
244 244
 			public void checkClientTrusted(final X509Certificate[] certs, final String authType) { }
245
-            @Override
245
+			@Override
246 246
 			public void checkServerTrusted(final X509Certificate[] certs, final String authType) { }
247 247
 		},
248 248
 	};
@@ -432,8 +432,7 @@ public class IRCParser implements Runnable {
432 432
 	 * @return true if a method was called, false otherwise
433 433
 	 */
434 434
 	protected boolean callServerError(final String message) {
435
-		return ((CallbackOnServerError) myCallbackManager
436
-                .getCallbackType("OnServerError")).call(message);
435
+		return ((CallbackOnServerError) myCallbackManager.getCallbackType("OnServerError")).call(message);
437 436
 	}
438 437
 
439 438
 	/**
@@ -444,8 +443,7 @@ public class IRCParser implements Runnable {
444 443
 	 * @return true if a method was called, false otherwise
445 444
 	 */
446 445
 	protected boolean callDataIn(final String data) {
447
-		return ((CallbackOnDataIn) myCallbackManager
448
-                .getCallbackType("OnDataIn")).call(data);
446
+		return ((CallbackOnDataIn) myCallbackManager.getCallbackType("OnDataIn")).call(data);
449 447
 	}
450 448
 
451 449
 	/**
@@ -457,8 +455,7 @@ public class IRCParser implements Runnable {
457 455
 	 * @see com.dmdirc.parser.callbacks.interfaces.IDataOut
458 456
 	 */
459 457
 	protected boolean callDataOut(final String data, final boolean fromParser) {
460
-		return ((CallbackOnDataOut) myCallbackManager
461
-                .getCallbackType("OnDataOut")).call(data, fromParser);
458
+		return ((CallbackOnDataOut) myCallbackManager.getCallbackType("OnDataOut")).call(data, fromParser);
462 459
 	}
463 460
 
464 461
 	/**
@@ -482,8 +479,7 @@ public class IRCParser implements Runnable {
482 479
 	 * @return true if a method was called, false otherwise
483 480
 	 */
484 481
 	protected boolean callDebugInfo(final int level, final String data) {
485
-		return ((CallbackOnDebugInfo) myCallbackManager
486
-                .getCallbackType("OnDebugInfo")).call(level, data);
482
+		return ((CallbackOnDebugInfo) myCallbackManager.getCallbackType("OnDebugInfo")).call(level, data);
487 483
 	}
488 484
 
489 485
 	/**
@@ -494,8 +490,7 @@ public class IRCParser implements Runnable {
494 490
 	 * @return true if a method was called, false otherwise
495 491
 	 */
496 492
 	protected boolean callErrorInfo(final ParserError errorInfo) {
497
-		return ((CallbackOnErrorInfo) myCallbackManager
498
-                .getCallbackType("OnErrorInfo")).call(errorInfo);
493
+		return ((CallbackOnErrorInfo) myCallbackManager.getCallbackType("OnErrorInfo")).call(errorInfo);
499 494
 	}
500 495
 
501 496
 	/**
@@ -506,8 +501,7 @@ public class IRCParser implements Runnable {
506 501
 	 * @return true if a method was called, false otherwise
507 502
 	 */
508 503
 	protected boolean callConnectError(final ParserError errorInfo) {
509
-		return ((CallbackOnConnectError) myCallbackManager
510
-                .getCallbackType("OnConnectError")).call(errorInfo);
504
+		return ((CallbackOnConnectError) myCallbackManager.getCallbackType("OnConnectError")).call(errorInfo);
511 505
 	}
512 506
 
513 507
 	/**
@@ -517,8 +511,7 @@ public class IRCParser implements Runnable {
517 511
 	 * @return true if a method was called, false otherwise
518 512
 	 */
519 513
 	protected boolean callSocketClosed() {
520
-		return ((CallbackOnSocketClosed) myCallbackManager
521
-                .getCallbackType("OnSocketClosed")).call();
514
+		return ((CallbackOnSocketClosed) myCallbackManager.getCallbackType("OnSocketClosed")).call();
522 515
 	}
523 516
 
524 517
 	/**
@@ -528,8 +521,7 @@ public class IRCParser implements Runnable {
528 521
 	 * @return true if a method was called, false otherwise
529 522
 	 */
530 523
 	protected boolean callPingFailed() {
531
-		return ((CallbackOnPingFailed) myCallbackManager
532
-                .getCallbackType("OnPingFailed")).call();
524
+		return ((CallbackOnPingFailed) myCallbackManager.getCallbackType("OnPingFailed")).call();
533 525
 	}
534 526
 
535 527
 	/**
@@ -539,8 +531,7 @@ public class IRCParser implements Runnable {
539 531
 	 * @return true if a method was called, false otherwise
540 532
 	 */
541 533
 	protected boolean callPingSent() {
542
-		return ((CallbackOnPingSent) myCallbackManager
543
-                .getCallbackType("OnPingSent")).call();
534
+		return ((CallbackOnPingSent) myCallbackManager.getCallbackType("OnPingSent")).call();
544 535
 	}
545 536
 
546 537
 	/**
@@ -550,8 +541,7 @@ public class IRCParser implements Runnable {
550 541
 	 * @return true if a method was called, false otherwise
551 542
 	 */
552 543
 	protected boolean callPingSuccess() {
553
-		return ((CallbackOnPingSuccess) myCallbackManager
554
-                .getCallbackType("OnPingSuccess")).call();
544
+		return ((CallbackOnPingSuccess) myCallbackManager.getCallbackType("OnPingSuccess")).call();
555 545
 	}
556 546
 
557 547
 	/**
@@ -563,9 +553,8 @@ public class IRCParser implements Runnable {
563 553
 	protected synchronized boolean callPost005() {
564 554
 		if (post005) { return false; }
565 555
 		post005 = true;
566
-        
567
-		return ((CallbackOnPost005) getCallbackManager()
568
-                .getCallbackType("OnPost005")).call();
556
+		
557
+		return ((CallbackOnPost005) getCallbackManager().getCallbackType("OnPost005")).call();
569 558
 	}
570 559
 
571 560
 	//---------------------------------------------------------------------------
@@ -726,7 +715,7 @@ public class IRCParser implements Runnable {
726 715
 		} catch (UnknownHostException uhe) {
727 716
 			localhost = "*";
728 717
 		}
729
-		sendString("USER " + toLowerCase(me.getUsername()) + " "+localhost+" "+server.getHost()+" :" + me.getRealname());
718
+		sendString("USER " + getIRCStringConverter().toLowerCase(me.getUsername()) + " "+localhost+" "+server.getHost()+" :" + me.getRealname());
730 719
 	}
731 720
 
732 721
 	/**
@@ -808,7 +797,7 @@ public class IRCParser implements Runnable {
808 797
 	}
809 798
 
810 799
 	/** Close socket on destroy. */
811
-    @Override
800
+	@Override
812 801
 	protected void finalize() throws Throwable {
813 802
 		try { socket.close(); }
814 803
 		catch (IOException e) {
@@ -864,7 +853,7 @@ public class IRCParser implements Runnable {
864 853
 	 * @return ClientInfo Object for the client, or null
865 854
 	 */
866 855
 	public ClientInfo getClientInfo(final String sHost) {
867
-		final String sWho = toLowerCase(ClientInfo.parseHost(sHost));
856
+		final String sWho = getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sHost));
868 857
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
869 858
 		else { return null; }
870 859
 	}
@@ -876,7 +865,7 @@ public class IRCParser implements Runnable {
876 865
 	 * @return ClientInfo Object for the client.
877 866
 	 */
878 867
 	public ClientInfo getClientInfoOrFake(final String sHost) {
879
-		final String sWho = toLowerCase(ClientInfo.parseHost(sHost));
868
+		final String sWho = getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sHost));
880 869
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
881 870
 		else { return new ClientInfo(this, sHost).setFake(true); }
882 871
 	}
@@ -889,7 +878,7 @@ public class IRCParser implements Runnable {
889 878
 	 */
890 879
 	public ChannelInfo getChannelInfo(String sWhat) {
891 880
 		synchronized (hChannelList) {
892
-			sWhat = toLowerCase(sWhat);
881
+			sWhat = getIRCStringConverter().toLowerCase(sWhat);
893 882
 			if (hChannelList.containsKey(sWhat)) { return hChannelList.get(sWhat); } else { return null; }
894 883
 		}
895 884
 	}
@@ -1084,43 +1073,6 @@ public class IRCParser implements Runnable {
1084 1073
 		stringConverter = new IRCStringConverter(limit);
1085 1074
 	}
1086 1075
 
1087
-	/**
1088
-	 * Get the lowercase version of a String for this Server.
1089
-	 *
1090
-	 * @param input String to convert lowercase
1091
-	 * @return input String converterd to lowercase
1092
-     * @deprecated Use IRCStringConverter instead
1093
-	 */
1094
-    @Deprecated
1095
-	public String toLowerCase(final String input) {
1096
-		return getIRCStringConverter().toLowerCase(input);
1097
-	}
1098
-
1099
-	/**
1100
-	 * Get the uppercase version of a String for this Server.
1101
-	 *
1102
-	 * @param input String to convert uppercase
1103
-	 * @return input String converterd to uppercase
1104
-     * @deprecated Use IRCStringConverter instead
1105
-	 */
1106
-    @Deprecated
1107
-	public String toUpperCase(final String input) {
1108
-		return getIRCStringConverter().toUpperCase(input);
1109
-	}
1110
-
1111
-	/**
1112
-	 * Check if 2 strings are equal to each other ignoring case.
1113
-	 *
1114
-	 * @param first First string to check
1115
-	 * @param second Second string to check
1116
-	 * @return True if both strings are equal after being lowercased
1117
-     * @deprecated Use IRCStringConverter instead
1118
-	 */
1119
-    @Deprecated
1120
-	public boolean equalsIgnoreCase(final String first, final String second) {
1121
-		return getIRCStringConverter().equalsIgnoreCase(first, second);
1122
-	}
1123
-
1124 1076
 	/**
1125 1077
 	 * Get the known boolean chanmodes in 005 order.
1126 1078
 	 * Modes are returned in the order that the ircd specifies the modes in 005
@@ -1479,7 +1431,7 @@ public class IRCParser implements Runnable {
1479 1431
 		final String channelName;
1480 1432
 		if (isValidChannelName(sChannelName)) {
1481 1433
 			channelName = sChannelName;
1482
-        } else {
1434
+		} else {
1483 1435
 			if (autoPrefix) {
1484 1436
 				if (h005Info.containsKey("CHANTYPES")) {
1485 1437
 					final String chantypes = h005Info.get("CHANTYPES");
@@ -1734,7 +1686,7 @@ public class IRCParser implements Runnable {
1734 1686
 		// Check sChannelName is not empty or null
1735 1687
 		if (sChannelName == null || sChannelName.isEmpty()) { return false; }
1736 1688
 		// Check its not ourself (PM recieved before 005)
1737
-		if (equalsIgnoreCase(getMyNickname(), sChannelName)) { return false; }
1689
+		if (getIRCStringConverter().equalsIgnoreCase(getMyNickname(), sChannelName)) { return false; }
1738 1690
 		// Check if we are already on this channel
1739 1691
 		if (getChannelInfo(sChannelName) != null) { return true; }
1740 1692
 		// Check if we know of any valid chan prefixes
@@ -1999,7 +1951,7 @@ public class IRCParser implements Runnable {
1999 1951
 	 * @param client Client to add
2000 1952
 	 */
2001 1953
 	public void addClient(final ClientInfo client) {
2002
-		hClientList.put(toLowerCase(client.getNickname()),client);
1954
+		hClientList.put(getIRCStringConverter().toLowerCase(client.getNickname()),client);
2003 1955
 	}
2004 1956
 
2005 1957
 	/**
@@ -2021,7 +1973,7 @@ public class IRCParser implements Runnable {
2021 1973
 	 * @param client Client to remove
2022 1974
 	 */
2023 1975
 	protected void forceRemoveClient(final ClientInfo client) {
2024
-		hClientList.remove(toLowerCase(client.getNickname()));
1976
+		hClientList.remove(getIRCStringConverter().toLowerCase(client.getNickname()));
2025 1977
 	}
2026 1978
 
2027 1979
 	/**
@@ -2057,7 +2009,7 @@ public class IRCParser implements Runnable {
2057 2009
 	 */
2058 2010
 	public void addChannel(final ChannelInfo channel) {
2059 2011
 		synchronized (hChannelList) {
2060
-			hChannelList.put(toLowerCase(channel.getName()), channel);
2012
+			hChannelList.put(getIRCStringConverter().toLowerCase(channel.getName()), channel);
2061 2013
 		}
2062 2014
 	}
2063 2015
 
@@ -2068,7 +2020,7 @@ public class IRCParser implements Runnable {
2068 2020
 	 */
2069 2021
 	public void removeChannel(final ChannelInfo channel) {
2070 2022
 		synchronized (hChannelList) {
2071
-			hChannelList.remove(toLowerCase(channel.getName()));
2023
+			hChannelList.remove(getIRCStringConverter().toLowerCase(channel.getName()));
2072 2024
 		}
2073 2025
 	}
2074 2026
 

+ 5
- 8
src/com/dmdirc/parser/Process001.java View File

@@ -36,7 +36,7 @@ public class Process001 extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("001")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(final String sParam, final String[] token) {
41 41
 		myParser.got001 = true;
42 42
 		// << :demon1.uk.quakenet.org 001 Java-Test :Welcome to the QuakeNet IRC Network, Java-Test
@@ -65,11 +65,10 @@ public class Process001 extends IRCProcessor {
65 65
 	 * Callback to all objects implementing the ServerReady Callback.
66 66
 	 *
67 67
 	 * @see IServerReady
68
-         * @return true if a method was called, false otherwise
68
+	 * @return true if a method was called, false otherwise
69 69
 	 */	
70 70
 	protected boolean callServerReady() {
71
-		return ((CallbackOnServerReady) getCallbackManager()
72
-                .getCallbackType("OnServerReady")).call();
71
+		return ((CallbackOnServerReady) getCallbackManager().getCallbackType("OnServerReady")).call();
73 72
 	}
74 73
 	
75 74
 	/**
@@ -77,11 +76,9 @@ public class Process001 extends IRCProcessor {
77 76
 	 *
78 77
 	 * @return String[] with the names of the tokens we handle.
79 78
 	 */
80
-    @Override
79
+	@Override
81 80
 	public String[] handles() {
82
-		String[] iHandle = new String[1];
83
-		iHandle[0] = "001";
84
-		return iHandle;
81
+		return new String[]{"001"};
85 82
 	} 
86 83
 	
87 84
 	/**

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

@@ -36,7 +36,7 @@ public class Process004005 extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("005", "004")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(final String sParam, final String[] token) {
41 41
 		if (sParam.equals("003")) {
42 42
 			myParser.h005Info.put("003IRCD",token[token.length-1]);
@@ -107,7 +107,7 @@ public class Process004005 extends IRCProcessor {
107 107
 	 *
108 108
 	 * @return String[] with the names of the tokens we handle.
109 109
 	 */
110
-    @Override
110
+	@Override
111 111
 	public String[] handles() {
112 112
 		return new String[]{"003", "004", "005"};
113 113
 	} 
@@ -117,15 +117,14 @@ public class Process004005 extends IRCProcessor {
117 117
 	 * This takes no params of its own, but works them out itself.
118 118
 	 *
119 119
 	 * @see IGotNetwork
120
-         * @return true if a method was called, false otherwise
120
+	 * @return true if a method was called, false otherwise
121 121
 	 */
122 122
 	protected boolean callGotNetwork() {
123 123
 		final String networkName = myParser.sNetworkName;
124 124
 		final String ircdVersion = myParser.getIRCD(false);
125 125
 		final String ircdType = myParser.getIRCD(true);
126 126
 		
127
-		return ((CallbackOnGotNetwork) getCallbackManager()
128
-                .getCallbackType("OnGotNetwork")).call(networkName, ircdVersion, ircdType);
127
+		return ((CallbackOnGotNetwork) getCallbackManager().getCallbackType("OnGotNetwork")).call(networkName, ircdVersion, ircdType);
129 128
 	}
130 129
 	
131 130
 	/**

+ 5
- 8
src/com/dmdirc/parser/Process464.java View File

@@ -36,7 +36,7 @@ public class Process464 extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("464")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(String sParam, String[] token) {
41 41
 		callPasswordRequired();
42 42
 //		ParserError ei = new ParserError(ParserError.ERROR_ERROR, "Password Required");
@@ -48,22 +48,19 @@ public class Process464 extends IRCProcessor {
48 48
 	 *
49 49
 	 * @return String[] with the names of the tokens we handle.
50 50
 	 */
51
-    @Override
51
+	@Override
52 52
 	public String[] handles() {
53
-		String[] iHandle = new String[1];
54
-		iHandle[0] = "464";
55
-		return iHandle;
53
+		return new String[]{"464"};
56 54
 	} 
57 55
 	
58 56
 	/**
59 57
 	 * Callback to all objects implementing the PasswordRequired Callback.
60 58
 	 *
61 59
 	 * @see IPasswordRequired
62
-         * @return true if a method was called, false otherwise
60
+	 * @return true if a method was called, false otherwise
63 61
 	 */
64 62
 	protected boolean callPasswordRequired() {
65
-		return ((CallbackOnPasswordRequired) getCallbackManager()
66
-                .getCallbackType("OnPasswordRequired")).call();
63
+		return ((CallbackOnPasswordRequired) getCallbackManager().getCallbackType("OnPasswordRequired")).call();
67 64
 	}
68 65
 	
69 66
 	/**

+ 4
- 9
src/com/dmdirc/parser/ProcessAway.java View File

@@ -36,7 +36,7 @@ public class ProcessAway extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("305", "306")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(String sParam, String[] token) {
41 41
 		if (sParam.equals("301")) {
42 42
 			ClientInfo iClient = myParser.getClientInfo(token[3]);
@@ -56,8 +56,7 @@ public class ProcessAway extends IRCProcessor {
56 56
 	 * @return true if a method was called, false otherwise
57 57
 	 */
58 58
 	protected boolean callAwayState(boolean currentState, String reason) {
59
-		return ((CallbackOnAwayState) myParser.getCallbackManager()
60
-                .getCallbackType("OnAwayState")).call(currentState, reason);
59
+		return ((CallbackOnAwayState) myParser.getCallbackManager().getCallbackType("OnAwayState")).call(currentState, reason);
61 60
 	}
62 61
 	
63 62
 	/**
@@ -65,13 +64,9 @@ public class ProcessAway extends IRCProcessor {
65 64
 	 *
66 65
 	 * @return String[] with the names of the tokens we handle.
67 66
 	 */
68
-    @Override
67
+	@Override
69 68
 	public String[] handles() {
70
-		String[] iHandle = new String[3];
71
-		iHandle[0] = "301"; // Whois Away
72
-		iHandle[1] = "305";
73
-		iHandle[2] = "306";
74
-		return iHandle;
69
+		return new String[]{"301", "305", "306"};
75 70
 	} 
76 71
 	
77 72
 	/**

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

@@ -36,7 +36,7 @@ public class ProcessInvite extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("INVITE")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(final String sParam, final String[] token) {
41 41
 		// :Tobavaj!shane@Tobavaj.users.quakenet.org INVITE Dataforce #dataforceisgod 1188846462
42 42
 		if (token.length > 2) {
@@ -50,11 +50,10 @@ public class ProcessInvite extends IRCProcessor {
50 50
 	 * @see IInvite
51 51
 	 * @param userHost The hostname of the person who invited us
52 52
 	 * @param channel The name of the channel we were invited to
53
-         * @return true if a method was called, false otherwise
53
+	 * @return true if a method was called, false otherwise
54 54
 	 */
55 55
 	protected boolean callInvite(final String userHost, final String channel) {
56
-		return ((CallbackOnInvite) getCallbackManager()
57
-                .getCallbackType("OnInvite")).call(userHost, channel);
56
+		return ((CallbackOnInvite) getCallbackManager().getCallbackType("OnInvite")).call(userHost, channel);
58 57
 	}
59 58
 	
60 59
 	/**
@@ -62,7 +61,7 @@ public class ProcessInvite extends IRCProcessor {
62 61
 	 *
63 62
 	 * @return String[] with the names of the tokens we handle.
64 63
 	 */
65
-    @Override
64
+	@Override
66 65
 	public String[] handles() {
67 66
 		return new String[]{"INVITE"};
68 67
 	} 

+ 7
- 12
src/com/dmdirc/parser/ProcessJoin.java View File

@@ -32,13 +32,13 @@ import com.dmdirc.parser.callbacks.CallbackOnChannelSelfJoin;
32 32
  */
33 33
 public class ProcessJoin extends IRCProcessor {
34 34
 
35
-    /**
35
+	/**
36 36
 	 * Process a channel join.
37 37
 	 *
38 38
 	 * @param sParam Type of line to process ("JOIN")
39 39
 	 * @param token IRCTokenised line to process
40 40
 	 */
41
-    @Override
41
+	@Override
42 42
 	public void process(final String sParam, final String[] token) {
43 43
 		if (sParam.equals("329")) {
44 44
 			if (token.length < 5) { return; }
@@ -111,8 +111,7 @@ public class ProcessJoin extends IRCProcessor {
111 111
 	 * @return true if a method was called, false otherwise
112 112
 	 */
113 113
 	protected boolean callChannelJoin(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient) {
114
-		return ((CallbackOnChannelJoin)getCallbackManager()
115
-                .getCallbackType("OnChannelJoin")).call(cChannel, cChannelClient);
114
+		return ((CallbackOnChannelJoin)getCallbackManager().getCallbackType("OnChannelJoin")).call(cChannel, cChannelClient);
116 115
 	}
117 116
 	
118 117
 	/**
@@ -120,11 +119,10 @@ public class ProcessJoin extends IRCProcessor {
120 119
 	 *
121 120
 	 * @see IChannelSelfJoin
122 121
 	 * @param cChannel Channel Object
123
-         * @return true if a method was called, false otherwise
122
+	 * @return true if a method was called, false otherwise
124 123
 	 */
125 124
 	protected boolean callChannelSelfJoin(final ChannelInfo cChannel) {
126
-		return ((CallbackOnChannelSelfJoin) getCallbackManager()
127
-                .getCallbackType("OnChannelSelfJoin")).call(cChannel);
125
+		return ((CallbackOnChannelSelfJoin) getCallbackManager().getCallbackType("OnChannelSelfJoin")).call(cChannel);
128 126
 	}
129 127
 	
130 128
 	/**
@@ -132,12 +130,9 @@ public class ProcessJoin extends IRCProcessor {
132 130
 	 *
133 131
 	 * @return String[] with the names of the tokens we handle.
134 132
 	 */
135
-    @Override
133
+	@Override
136 134
 	public String[] handles() {
137
-		String[] iHandle = new String[2];
138
-		iHandle[0] = "JOIN";
139
-		iHandle[1] = "329";
140
-		return iHandle;
135
+		return new String[]{"JOIN", "329"};
141 136
 	} 
142 137
 	
143 138
 	/**

+ 6
- 9
src/com/dmdirc/parser/ProcessKick.java View File

@@ -31,13 +31,13 @@ import com.dmdirc.parser.callbacks.CallbackOnChannelKick;
31 31
  */
32 32
 public class ProcessKick extends IRCProcessor {
33 33
 
34
-    /**
34
+	/**
35 35
 	 * Process a channel kick.
36 36
 	 *
37 37
 	 * @param sParam Type of line to process ("KICK")
38 38
 	 * @param token IRCTokenised line to process
39 39
 	 */
40
-    @Override
40
+	@Override
41 41
 	public void process(final String sParam, final String[] token) {
42 42
 		ChannelClientInfo iChannelClient;
43 43
 		ChannelClientInfo iChannelKicker;
@@ -89,11 +89,10 @@ public class ProcessKick extends IRCProcessor {
89 89
 	 * @param cKickedByClient ChannelClient that did the kicking (may be null if server)
90 90
 	 * @param sReason Reason for kick (may be "")
91 91
 	 * @param sKickedByHost Hostname of Kicker (or servername)
92
-         * @return true if a method was called, false otherwise
92
+	 * @return true if a method was called, false otherwise
93 93
 	 */
94 94
 	protected boolean callChannelKick(ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost) {
95
-		return ((CallbackOnChannelKick) getCallbackManager()
96
-                .getCallbackType("OnChannelKick")).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
95
+		return ((CallbackOnChannelKick) getCallbackManager().getCallbackType("OnChannelKick")).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
97 96
 	}
98 97
 	
99 98
 	/**
@@ -101,11 +100,9 @@ public class ProcessKick extends IRCProcessor {
101 100
 	 *
102 101
 	 * @return String[] with the names of the tokens we handle.
103 102
 	 */
104
-    @Override
103
+	@Override
105 104
 	public String[] handles() {
106
-		String[] iHandle = new String[1];
107
-		iHandle[0] = "KICK";
108
-		return iHandle;
105
+		return new String[]{"KICK"};
109 106
 	} 
110 107
 	
111 108
 	/**

+ 6
- 8
src/com/dmdirc/parser/ProcessListModes.java View File

@@ -41,7 +41,7 @@ public class ProcessListModes extends IRCProcessor {
41 41
 	 * @param token IRCTokenised line to process
42 42
 	 */
43 43
 	@SuppressWarnings("unchecked")
44
-    @Override
44
+	@Override
45 45
 	public void process(String sParam, String[] token) {
46 46
 		ChannelInfo channel = getChannelInfo(token[3]);
47 47
 		String thisIRCD = myParser.getIRCD(true).toLowerCase();
@@ -157,10 +157,9 @@ public class ProcessListModes extends IRCProcessor {
157 157
 	 *
158 158
 	 * @return String[] with the names of the tokens we handle.
159 159
 	 */
160
-    @Override
160
+	@Override
161 161
 	public String[] handles() {
162
-		String[] iHandle = new String[10];
163
-		int i = 0;
162
+		/*
164 163
 		// Ban List - All IRCds
165 164
 		iHandle[i++] = "367"; // Item
166 165
 		iHandle[i++] = "368"; // End
@@ -186,8 +185,8 @@ public class ProcessListModes extends IRCProcessor {
186 185
 		iHandle[i++] = "482"; // End
187 186
 		
188 187
 		// This is here to allow finding the processor for adding LISTMODE support
189
-		iHandle[i++] = "__LISTMODE__";
190
-		return iHandle;
188
+		iHandle[i++] = "__LISTMODE__"; */
189
+		return new String[]{"367", "368", "344", "345", "346", "347", "348", "349", "482", "__LISTMODE__"};
191 190
 	}
192 191
 	
193 192
 	/**
@@ -198,8 +197,7 @@ public class ProcessListModes extends IRCProcessor {
198 197
 	 * @return true if a method was called, false otherwise
199 198
 	 */
200 199
 	protected boolean callChannelGotListModes(ChannelInfo cChannel) {
201
-		return ((CallbackOnChannelGotListModes) getCallbackManager()
202
-                .getCallbackType("OnChannelGotListModes")).call(cChannel);
200
+		return ((CallbackOnChannelGotListModes) getCallbackManager().getCallbackType("OnChannelGotListModes")).call(cChannel);
203 201
 	}
204 202
 	
205 203
 	/**

+ 7
- 15
src/com/dmdirc/parser/ProcessMOTD.java View File

@@ -33,13 +33,13 @@ import com.dmdirc.parser.callbacks.CallbackOnMOTDStart;
33 33
  */
34 34
 public class ProcessMOTD extends IRCProcessor {
35 35
 
36
-    /**
36
+	/**
37 37
 	 * Process a MOTD Related Line.
38 38
 	 *
39 39
 	 * @param sParam Type of line to process ("375", "372", "376", "422")
40 40
 	 * @param token IRCTokenised line to process
41 41
 	 */
42
-    @Override
42
+	@Override
43 43
 	public void process(String sParam, String[] token) {
44 44
 		if (sParam.equals("375")) {
45 45
 			callMOTDStart(token[token.length-1]);
@@ -63,8 +63,7 @@ public class ProcessMOTD extends IRCProcessor {
63 63
 	 * @return true if a method was called, false otherwise
64 64
 	 */
65 65
 	protected boolean callMOTDEnd(final boolean noMOTD, final String data) {
66
-		return ((CallbackOnMOTDEnd) getCallbackManager()
67
-                .getCallbackType("OnMOTDEnd")).call(noMOTD, data);
66
+		return ((CallbackOnMOTDEnd) getCallbackManager().getCallbackType("OnMOTDEnd")).call(noMOTD, data);
68 67
 	}
69 68
 	
70 69
 	/**
@@ -75,8 +74,7 @@ public class ProcessMOTD extends IRCProcessor {
75 74
 	 * @return true if a method was called, false otherwise
76 75
 	 */
77 76
 	protected boolean callMOTDLine(final String data) {
78
-		return ((CallbackOnMOTDLine) getCallbackManager()
79
-                .getCallbackType("OnMOTDLine")).call(data);
77
+		return ((CallbackOnMOTDLine) getCallbackManager().getCallbackType("OnMOTDLine")).call(data);
80 78
 	}
81 79
 	
82 80
 	/**
@@ -87,8 +85,7 @@ public class ProcessMOTD extends IRCProcessor {
87 85
 	 * @return true if a method was called, false otherwise
88 86
 	 */
89 87
 	protected boolean callMOTDStart(String data) {
90
-		return ((CallbackOnMOTDStart) getCallbackManager()
91
-                .getCallbackType("OnMOTDStart")).call(data);
88
+		return ((CallbackOnMOTDStart) getCallbackManager().getCallbackType("OnMOTDStart")).call(data);
92 89
 	}
93 90
 	
94 91
 	/**
@@ -96,14 +93,9 @@ public class ProcessMOTD extends IRCProcessor {
96 93
 	 *
97 94
 	 * @return String[] with the names of the tokens we handle.
98 95
 	 */
99
-    @Override
96
+	@Override
100 97
 	public String[] handles() {
101
-		String[] iHandle = new String[4];
102
-		iHandle[0] = "372";
103
-		iHandle[1] = "375";
104
-		iHandle[2] = "376";
105
-		iHandle[3] = "422";
106
-		return iHandle;
98
+		return new String[]{"372", "375", "376", "422"};
107 99
 	} 
108 100
 	
109 101
 	/**

+ 35
- 53
src/com/dmdirc/parser/ProcessMessage.java View File

@@ -61,7 +61,7 @@ public class ProcessMessage extends IRCProcessor {
61 61
 	 * @param sParam Type of line to process ("NOTICE", "PRIVMSG")
62 62
 	 * @param token IRCTokenised line to process
63 63
 	 */
64
-    @Override
64
+	@Override
65 65
 	public void process(final String sParam, String[] token) {
66 66
 		// Ignore people!
67 67
 		String sMessage = "";
@@ -167,7 +167,7 @@ public class ProcessMessage extends IRCProcessor {
167 167
 					callChannelNotice(iChannel, iChannelClient, sMessage, token[0]);
168 168
 				}
169 169
 			}
170
-		} else if (myParser.equalsIgnoreCase(token[2], myParser.getMyNickname())) {
170
+		} else if (myParser.getIRCStringConverter().equalsIgnoreCase(token[2], myParser.getMyNickname())) {
171 171
 			if (sParam.equalsIgnoreCase("PRIVMSG")) {
172 172
 				if (!isAction) {
173 173
 					if (isCTCP) {
@@ -215,11 +215,10 @@ public class ProcessMessage extends IRCProcessor {
215 215
 	 * @param cChannelClient ChannelClient who sent the action (may be null if server)
216 216
 	 * @param sMessage action contents
217 217
 	 * @param sHost Hostname of sender (or servername)
218
-         * @return true if a method was called, false otherwise
218
+	 * @return true if a method was called, false otherwise
219 219
 	 */
220 220
 	protected boolean callChannelAction(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
221
-		return ((CallbackOnChannelAction) getCallbackManager()
222
-                .getCallbackType("OnChannelAction")).call(cChannel, cChannelClient, sMessage, sHost);
221
+		return ((CallbackOnChannelAction) getCallbackManager().getCallbackType("OnChannelAction")).call(cChannel, cChannelClient, sMessage, sHost);
223 222
 	}
224 223
 	
225 224
 	/**
@@ -231,11 +230,10 @@ public class ProcessMessage extends IRCProcessor {
231 230
 	 * @param sType Type of CTCP (VERSION, TIME etc)
232 231
 	 * @param sMessage Additional contents
233 232
 	 * @param sHost Hostname of sender (or servername)
234
-         * @return true if a method was called, false otherwise
233
+	 * @return true if a method was called, false otherwise
235 234
 	 */
236 235
 	protected boolean callChannelCTCP(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
237
-		return ((CallbackOnChannelCTCP) getCallbackManager()
238
-                .getCallbackType("OnChannelCTCP")).call(cChannel, cChannelClient, sType, sMessage, sHost);
236
+		return ((CallbackOnChannelCTCP) getCallbackManager().getCallbackType("OnChannelCTCP")).call(cChannel, cChannelClient, sType, sMessage, sHost);
239 237
 	}
240 238
 
241 239
 	/**
@@ -247,11 +245,10 @@ public class ProcessMessage extends IRCProcessor {
247 245
 	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
248 246
 	 * @param sMessage Reply Contents
249 247
 	 * @param sHost Hostname of sender (or servername)
250
-         * @return true if a method was called, false otherwise
248
+	 * @return true if a method was called, false otherwise
251 249
 	 */
252 250
 	protected boolean callChannelCTCPReply(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
253
-		return ((CallbackOnChannelCTCPReply) getCallbackManager()
254
-                .getCallbackType("OnChannelCTCPReply")).call(cChannel, cChannelClient, sType, sMessage, sHost);
251
+		return ((CallbackOnChannelCTCPReply) getCallbackManager().getCallbackType("OnChannelCTCPReply")).call(cChannel, cChannelClient, sType, sMessage, sHost);
255 252
 	}
256 253
 	
257 254
 	/**
@@ -262,11 +259,10 @@ public class ProcessMessage extends IRCProcessor {
262 259
 	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
263 260
 	 * @param sMessage Message contents
264 261
 	 * @param sHost Hostname of sender (or servername)
265
-     * @return true if a method was called, false otherwise
262
+	 * @return true if a method was called, false otherwise
266 263
 	 */
267 264
 	protected boolean callChannelMessage(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
268
-		return ((CallbackOnChannelMessage) getCallbackManager()
269
-                .getCallbackType("OnChannelMessage")).call(cChannel, cChannelClient, sMessage, sHost);
265
+		return ((CallbackOnChannelMessage) getCallbackManager().getCallbackType("OnChannelMessage")).call(cChannel, cChannelClient, sMessage, sHost);
270 266
 	}
271 267
 	
272 268
 	/**
@@ -277,11 +273,10 @@ public class ProcessMessage extends IRCProcessor {
277 273
 	 * @param cChannelClient ChannelClient who sent the notice (may be null if server)
278 274
 	 * @param sMessage notice contents
279 275
 	 * @param sHost Hostname of sender (or servername)
280
-     * @return true if a method was called, false otherwise
276
+	 * @return true if a method was called, false otherwise
281 277
 	 */
282 278
 	protected boolean callChannelNotice(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
283
-		return ((CallbackOnChannelNotice) getCallbackManager()
284
-                .getCallbackType("OnChannelNotice")).call(cChannel, cChannelClient, sMessage, sHost);
279
+		return ((CallbackOnChannelNotice) getCallbackManager().getCallbackType("OnChannelNotice")).call(cChannel, cChannelClient, sMessage, sHost);
285 280
 	}
286 281
 	
287 282
 	/**
@@ -290,11 +285,10 @@ public class ProcessMessage extends IRCProcessor {
290 285
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateAction
291 286
 	 * @param sMessage action contents
292 287
 	 * @param sHost Hostname of sender (or servername)
293
-     * @return true if a method was called, false otherwise
288
+	 * @return true if a method was called, false otherwise
294 289
 	 */
295 290
 	protected boolean callPrivateAction(final String sMessage, final String sHost) {
296
-		return ((CallbackOnPrivateAction) getCallbackManager()
297
-                .getCallbackType("OnPrivateAction")).call(sMessage, sHost);
291
+		return ((CallbackOnPrivateAction) getCallbackManager().getCallbackType("OnPrivateAction")).call(sMessage, sHost);
298 292
 	}
299 293
 
300 294
 	/**
@@ -304,11 +298,10 @@ public class ProcessMessage extends IRCProcessor {
304 298
 	 * @param sType Type of CTCP (VERSION, TIME etc)
305 299
 	 * @param sMessage Additional contents
306 300
 	 * @param sHost Hostname of sender (or servername)
307
-     * @return true if a method was called, false otherwise
301
+	 * @return true if a method was called, false otherwise
308 302
 	 */
309 303
 	protected boolean callPrivateCTCP(final String sType, final String sMessage, final String sHost) {
310
-		return ((CallbackOnPrivateCTCP) getCallbackManager()
311
-                .getCallbackType("OnPrivateCTCP")).call(sType, sMessage, sHost);
304
+		return ((CallbackOnPrivateCTCP) getCallbackManager().getCallbackType("OnPrivateCTCP")).call(sType, sMessage, sHost);
312 305
 	}
313 306
 
314 307
 	/**
@@ -318,11 +311,10 @@ public class ProcessMessage extends IRCProcessor {
318 311
 	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
319 312
 	 * @param sMessage Reply Contents
320 313
 	 * @param sHost Hostname of sender (or servername)
321
-         * @return true if a method was called, false otherwise
314
+	 * @return true if a method was called, false otherwise
322 315
 	 */
323 316
 	protected boolean callPrivateCTCPReply(final String sType, final String sMessage, final String sHost) {
324
-		return ((CallbackOnPrivateCTCPReply) getCallbackManager()
325
-                .getCallbackType("OnPrivateCTCPReply")).call(sType, sMessage, sHost);
317
+		return ((CallbackOnPrivateCTCPReply) getCallbackManager().getCallbackType("OnPrivateCTCPReply")).call(sType, sMessage, sHost);
326 318
 	}
327 319
 
328 320
 	/**
@@ -331,11 +323,10 @@ public class ProcessMessage extends IRCProcessor {
331 323
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateMessage
332 324
 	 * @param sMessage Message contents
333 325
 	 * @param sHost Hostname of sender (or servername)
334
-         * @return true if a method was called, false otherwise
326
+	 * @return true if a method was called, false otherwise
335 327
 	 */
336 328
 	protected boolean callPrivateMessage(final String sMessage, final String sHost) {
337
-		return ((CallbackOnPrivateMessage) getCallbackManager()
338
-                .getCallbackType("OnPrivateMessage")).call(sMessage, sHost);
329
+		return ((CallbackOnPrivateMessage) getCallbackManager().getCallbackType("OnPrivateMessage")).call(sMessage, sHost);
339 330
 	}
340 331
 
341 332
 	/**
@@ -344,11 +335,10 @@ public class ProcessMessage extends IRCProcessor {
344 335
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateNotice
345 336
 	 * @param sMessage Notice contents
346 337
 	 * @param sHost Hostname of sender (or servername)
347
-         * @return true if a method was called, false otherwise
338
+	 * @return true if a method was called, false otherwise
348 339
 	 */
349 340
 	protected boolean callPrivateNotice(final String sMessage, final String sHost) {
350
-		return ((CallbackOnPrivateNotice)getCallbackManager()
351
-                .getCallbackType("OnPrivateNotice")).call(sMessage, sHost);
341
+		return ((CallbackOnPrivateNotice)getCallbackManager().getCallbackType("OnPrivateNotice")).call(sMessage, sHost);
352 342
 	}
353 343
 	
354 344
 	/**
@@ -358,11 +348,10 @@ public class ProcessMessage extends IRCProcessor {
358 348
 	 * @param sMessage Action contents
359 349
 	 * @param sTarget Actual target of action
360 350
 	 * @param sHost Hostname of sender (or servername)
361
-         * @return true if a method was called, false otherwise
351
+	 * @return true if a method was called, false otherwise
362 352
 	 */
363 353
 	protected boolean callUnknownAction(final String sMessage, final String sTarget, final String sHost) {
364
-		return ((CallbackOnUnknownAction) getCallbackManager()
365
-                .getCallbackType("OnUnknownAction")).call(sMessage, sTarget, sHost);
354
+		return ((CallbackOnUnknownAction) getCallbackManager().getCallbackType("OnUnknownAction")).call(sMessage, sTarget, sHost);
366 355
 	}
367 356
 
368 357
 	/**
@@ -373,11 +362,10 @@ public class ProcessMessage extends IRCProcessor {
373 362
 	 * @param sMessage Additional contents
374 363
 	 * @param sTarget Actual Target of CTCP
375 364
 	 * @param sHost Hostname of sender (or servername)
376
-         * @return true if a method was called, false otherwise
365
+	 * @return true if a method was called, false otherwise
377 366
 	 */
378 367
 	protected boolean callUnknownCTCP(final String sType, final String sMessage, final String sTarget, final String sHost) {
379
-		return ((CallbackOnUnknownCTCP)getCallbackManager()
380
-                .getCallbackType("OnUnknownCTCP")).call(sType, sMessage, sTarget, sHost);
368
+		return ((CallbackOnUnknownCTCP)getCallbackManager().getCallbackType("OnUnknownCTCP")).call(sType, sMessage, sTarget, sHost);
381 369
 	}
382 370
 
383 371
 	/**
@@ -388,11 +376,10 @@ public class ProcessMessage extends IRCProcessor {
388 376
 	 * @param sMessage Reply Contents
389 377
 	 * @param sTarget Actual Target of CTCPReply
390 378
 	 * @param sHost Hostname of sender (or servername)
391
-         * @return true if a method was called, false otherwise
379
+	 * @return true if a method was called, false otherwise
392 380
 	 */
393 381
 	protected boolean callUnknownCTCPReply(final String sType, final String sMessage, final String sTarget, final String sHost) {
394
-		return ((CallbackOnUnknownCTCPReply) getCallbackManager()
395
-                .getCallbackType("OnUnknownCTCPReply")).call(sType, sMessage, sTarget, sHost);
382
+		return ((CallbackOnUnknownCTCPReply) getCallbackManager().getCallbackType("OnUnknownCTCPReply")).call(sType, sMessage, sTarget, sHost);
396 383
 	}
397 384
 
398 385
 	/**
@@ -402,11 +389,10 @@ public class ProcessMessage extends IRCProcessor {
402 389
 	 * @param sMessage Message contents
403 390
 	 * @param sTarget Actual target of message
404 391
 	 * @param sHost Hostname of sender (or servername)
405
-         * @return true if a method was called, false otherwise
392
+	 * @return true if a method was called, false otherwise
406 393
 	 */
407 394
 	protected boolean callUnknownMessage(final String sMessage, final String sTarget, final String sHost) {
408
-		return ((CallbackOnUnknownMessage)getCallbackManager()
409
-                .getCallbackType("OnUnknownMessage")).call(sMessage, sTarget, sHost);
395
+		return ((CallbackOnUnknownMessage)getCallbackManager().getCallbackType("OnUnknownMessage")).call(sMessage, sTarget, sHost);
410 396
 	}
411 397
 
412 398
 	/**
@@ -416,11 +402,10 @@ public class ProcessMessage extends IRCProcessor {
416 402
 	 * @param sMessage Notice contents
417 403
 	 * @param sTarget Actual target of notice
418 404
 	 * @param sHost Hostname of sender (or servername)
419
-         * @return true if a method was called, false otherwise
405
+	 * @return true if a method was called, false otherwise
420 406
 	 */
421 407
 	protected boolean callUnknownNotice(final String sMessage, final String sTarget, final String sHost) {
422
-		return ((CallbackOnUnknownNotice) getCallbackManager()
423
-                .getCallbackType("OnUnknownNotice")).call(sMessage, sTarget, sHost);
408
+		return ((CallbackOnUnknownNotice) getCallbackManager().getCallbackType("OnUnknownNotice")).call(sMessage, sTarget, sHost);
424 409
 	}
425 410
 
426 411
 	
@@ -429,13 +414,10 @@ public class ProcessMessage extends IRCProcessor {
429 414
 	 *
430 415
 	 * @return String[] with the names of the tokens we handle.
431 416
 	 */
432
-    @Override
417
+	@Override
433 418
 	public String[] handles() {
434
-		String[] iHandle = new String[2];
435
-		iHandle[0] = "PRIVMSG";
436
-		iHandle[1] = "NOTICE";
437
-		return iHandle;
438
-	} 
419
+		return new String[]{"PRIVMSG", "NOTICE"};
420
+	}
439 421
 	
440 422
 	/**
441 423
 	 * Create a new instance of the IRCProcessor Object.

+ 11
- 19
src/com/dmdirc/parser/ProcessMode.java View File

@@ -43,7 +43,7 @@ public class ProcessMode extends IRCProcessor {
43 43
 	 * @param sParam Type of line to process ("MODE", "324")
44 44
 	 * @param token IRCTokenised line to process
45 45
 	 */
46
-    @Override
46
+	@Override
47 47
 	public void process(String sParam, String[] token) {
48 48
 		String[] sModestr;
49 49
 		String sChannelName;
@@ -98,7 +98,7 @@ public class ProcessMode extends IRCProcessor {
98 98
 		CallbackOnChannelSingleModeChanged cbSingle = null;
99 99
 		CallbackOnChannelNonUserModeChanged cbNonUser = null;
100 100
 
101
-        if (!sParam.equals("324")) {
101
+		if (!sParam.equals("324")) {
102 102
 			cbSingle = (CallbackOnChannelSingleModeChanged) getCallbackManager().getCallbackType("OnChannelSingleModeChanged");
103 103
 			cbNonUser = (CallbackOnChannelNonUserModeChanged) getCallbackManager().getCallbackType("OnChannelNonUserModeChanged");
104 104
 		}
@@ -276,11 +276,10 @@ public class ProcessMode extends IRCProcessor {
276 276
 	 * @param cChannelClient Client chaning the modes (null if server)
277 277
 	 * @param sHost Host doing the mode changing (User host or server name)
278 278
 	 * @param sModes Exact String parsed
279
-         * @return true if a method was called, false otherwise
279
+	 * @return true if a method was called, false otherwise
280 280
 	 */
281 281
 	protected boolean callChannelModeChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
282
-		return ((CallbackOnChannelModeChanged) getCallbackManager()
283
-                .getCallbackType("OnChannelModeChanged")).call(cChannel, cChannelClient, sHost, sModes);
282
+		return ((CallbackOnChannelModeChanged) getCallbackManager().getCallbackType("OnChannelModeChanged")).call(cChannel, cChannelClient, sHost, sModes);
284 283
 	}
285 284
 	
286 285
 	/**
@@ -292,11 +291,10 @@ public class ProcessMode extends IRCProcessor {
292 291
 	 * @param cSetByClient Client chaning the modes (null if server)
293 292
 	 * @param sMode String representing mode change (ie +o)
294 293
 	 * @param sHost Host doing the mode changing (User host or server name)
295
-         * @return true if a method was called, false otherwise
294
+	 * @return true if a method was called, false otherwise
296 295
 	 */
297 296
 	protected boolean callChannelUserModeChanged(ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
298
-		return ((CallbackOnChannelUserModeChanged) getCallbackManager()
299
-                .getCallbackType("OnChannelUserModeChanged")).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
297
+		return ((CallbackOnChannelUserModeChanged) getCallbackManager().getCallbackType("OnChannelUserModeChanged")).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
300 298
 	}
301 299
 	
302 300
 	/**
@@ -306,11 +304,10 @@ public class ProcessMode extends IRCProcessor {
306 304
 	 * @param cClient Client that had the mode changed (almost always us)
307 305
 	 * @param sSetby Host that set the mode (us or servername)
308 306
 	 * @param sModes The modes set.
309
-         * @return true if a method was called, false otherwise
307
+	 * @return true if a method was called, false otherwise
310 308
 	 */
311 309
 	protected boolean callUserModeChanged(ClientInfo cClient, String sSetby, String sModes) {
312
-		return ((CallbackOnUserModeChanged) getCallbackManager()
313
-                .getCallbackType("OnUserModeChanged")).call(cClient, sSetby, sModes);
310
+		return ((CallbackOnUserModeChanged) getCallbackManager().getCallbackType("OnUserModeChanged")).call(cClient, sSetby, sModes);
314 311
 	}
315 312
 	
316 313
 	/**
@@ -322,8 +319,7 @@ public class ProcessMode extends IRCProcessor {
322 319
 	 * @return true if a method was called, false otherwise
323 320
 	 */
324 321
 	protected boolean callUserModeDiscovered(ClientInfo cClient, String sModes) {
325
-		return ((CallbackOnUserModeDiscovered)getCallbackManager()
326
-                .getCallbackType("OnUserModeDiscovered")).call(cClient, sModes);
322
+		return ((CallbackOnUserModeDiscovered)getCallbackManager().getCallbackType("OnUserModeDiscovered")).call(cClient, sModes);
327 323
 	}	
328 324
 	
329 325
 	/**
@@ -331,13 +327,9 @@ public class ProcessMode extends IRCProcessor {
331 327
 	 *
332 328
 	 * @return String[] with the names of the tokens we handle.
333 329
 	 */
334
-    @Override
330
+	@Override
335 331
 	public String[] handles() {
336
-		String[] iHandle = new String[3];
337
-		iHandle[0] = "MODE";
338
-		iHandle[1] = "324";
339
-		iHandle[2] = "221";
340
-		return iHandle;
332
+		return new String[]{"MODE", "324", "221"};
341 333
 	} 
342 334
 	
343 335
 	/**

+ 5
- 9
src/com/dmdirc/parser/ProcessNames.java View File

@@ -36,7 +36,7 @@ public class ProcessNames extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("366", "353")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(String sParam, String[] token) {
41 41
 		ChannelInfo iChannel;
42 42
 		if (sParam.equals("366")) {
@@ -107,11 +107,10 @@ public class ProcessNames extends IRCProcessor {
107 107
 	 *
108 108
 	 * @see IChannelGotNames
109 109
 	 * @param cChannel Channel which the names reply is for
110
-         * @return true if a method was called, false otherwise
110
+	 * @return true if a method was called, false otherwise
111 111
 	 */
112 112
 	protected boolean callChannelGotNames(ChannelInfo cChannel) {
113
-		return ((CallbackOnChannelGotNames) getCallbackManager()
114
-                .getCallbackType("OnChannelGotNames")).call(cChannel);
113
+		return ((CallbackOnChannelGotNames) getCallbackManager().getCallbackType("OnChannelGotNames")).call(cChannel);
115 114
 	}
116 115
 	
117 116
 	/**
@@ -119,12 +118,9 @@ public class ProcessNames extends IRCProcessor {
119 118
 	 *
120 119
 	 * @return String[] with the names of the tokens we handle.
121 120
 	 */
122
-    @Override
121
+	@Override
123 122
 	public String[] handles() {
124
-		String[] iHandle = new String[2];
125
-		iHandle[0] = "353";
126
-		iHandle[1] = "366";
127
-		return iHandle;
123
+		return new String[]{"353", "366"};
128 124
 	} 
129 125
 	
130 126
 	/**

+ 9
- 13
src/com/dmdirc/parser/ProcessNick.java View File

@@ -37,7 +37,7 @@ public class ProcessNick extends IRCProcessor {
37 37
 	 * @param sParam Type of line to process ("NICK")
38 38
 	 * @param token IRCTokenised line to process
39 39
 	 */
40
-    @Override
40
+	@Override
41 41
 	public void process(String sParam, String[] token) {
42 42
 		ClientInfo iClient;
43 43
 		ChannelClientInfo iChannelClient;
@@ -45,9 +45,9 @@ public class ProcessNick extends IRCProcessor {
45 45
 		
46 46
 		iClient = getClientInfo(token[0]);
47 47
 		if (iClient != null) {
48
-			oldNickname = myParser.toLowerCase(iClient.getNickname());
48
+			oldNickname = myParser.getIRCStringConverter().toLowerCase(iClient.getNickname());
49 49
 			// Remove the client from the known clients list
50
-			final boolean isSameNick = myParser.equalsIgnoreCase(oldNickname, token[token.length-1]);
50
+			final boolean isSameNick = myParser.getIRCStringConverter().equalsIgnoreCase(oldNickname, token[token.length-1]);
51 51
 			
52 52
 			if (!isSameNick) {
53 53
 				myParser.forceRemoveClient(getClientInfo(oldNickname));
@@ -90,11 +90,10 @@ public class ProcessNick extends IRCProcessor {
90 90
 	 * @param cChannel One of the channels that the user is on
91 91
 	 * @param cChannelClient Client changing nickname
92 92
 	 * @param sOldNick Nickname before change
93
-         * @return true if a method was called, false otherwise
93
+	 * @return true if a method was called, false otherwise
94 94
 	 */
95 95
 	protected boolean callChannelNickChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick) {
96
-		return ((CallbackOnChannelNickChanged) getCallbackManager()
97
-                .getCallbackType("OnChannelNickChanged")).call(cChannel, cChannelClient, sOldNick);
96
+		return ((CallbackOnChannelNickChanged) getCallbackManager().getCallbackType("OnChannelNickChanged")).call(cChannel, cChannelClient, sOldNick);
98 97
 	}
99 98
 	
100 99
 	/**
@@ -103,11 +102,10 @@ public class ProcessNick extends IRCProcessor {
103 102
 	 * @see INickChanged
104 103
 	 * @param cClient Client changing nickname
105 104
 	 * @param sOldNick Nickname before change
106
-         * @return true if a method was called, false otherwise
105
+	 * @return true if a method was called, false otherwise
107 106
 	 */
108 107
 	protected boolean callNickChanged(ClientInfo cClient, String sOldNick) {
109
-		return ((CallbackOnNickChanged) getCallbackManager()
110
-                .getCallbackType("OnNickChanged")).call(cClient, sOldNick);
108
+		return ((CallbackOnNickChanged) getCallbackManager().getCallbackType("OnNickChanged")).call(cClient, sOldNick);
111 109
 	}
112 110
 	
113 111
 	/**
@@ -115,11 +113,9 @@ public class ProcessNick extends IRCProcessor {
115 113
 	 *
116 114
 	 * @return String[] with the names of the tokens we handle.
117 115
 	 */
118
-    @Override
116
+	@Override
119 117
 	public String[] handles() {
120
-		String[] iHandle = new String[1];
121
-		iHandle[0] = "NICK";
122
-		return iHandle;
118
+		return new String[]{"NICK"};
123 119
 	} 
124 120
 	
125 121
 	/**

+ 8
- 11
src/com/dmdirc/parser/ProcessNickInUse.java View File

@@ -48,7 +48,7 @@ public class ProcessNickInUse extends IRCProcessor {
48 48
 	 * @param sParam Type of line to process ("433")
49 49
 	 * @param token IRCTokenised line to process
50 50
 	 */
51
-    @Override
51
+	@Override
52 52
 	public void process(final String sParam, final String[] token) {
53 53
 		if (!callNickInUse(token[3])) {
54 54
 			// Manually handle nick in use.
@@ -57,10 +57,10 @@ public class ProcessNickInUse extends IRCProcessor {
57 57
 				callDebugInfo(IRCParser.DEBUG_INFO,"Using inbuilt handler");
58 58
 				// If this is before 001 we will try and get a nickname, else we will leave the nick as-is
59 59
 				if (myParser.triedAlt) {
60
-					if (myParser.equalsIgnoreCase(myParser.sThinkNickname, myParser.me.getAltNickname())) {
60
+					if (myParser.getIRCStringConverter().equalsIgnoreCase(myParser.sThinkNickname, myParser.me.getAltNickname())) {
61 61
 						myParser.sThinkNickname = myParser.me.getNickname();
62 62
 					}
63
-					myParser.setNickname(myParser.me.getPrependChar()+myParser.sThinkNickname);                                    
63
+					myParser.setNickname(myParser.me.getPrependChar()+myParser.sThinkNickname);
64 64
 				} else {
65 65
 					myParser.setNickname(myParser.me.getAltNickname());
66 66
 					myParser.triedAlt = true; 
@@ -74,11 +74,10 @@ public class ProcessNickInUse extends IRCProcessor {
74 74
 	 *
75 75
 	 * @param nickname Nickname that was wanted.
76 76
 	 * @see INickInUse
77
-         * @return true if a method was called, false otherwise
77
+	 * @return true if a method was called, false otherwise
78 78
 	 */
79 79
 	protected boolean callNickInUse(final String nickname) {
80
-		return ((CallbackOnNickInUse) getCallbackManager()
81
-                .getCallbackType("OnNickInUse")).call(nickname);
80
+		return ((CallbackOnNickInUse) getCallbackManager().getCallbackType("OnNickInUse")).call(nickname);
82 81
 	}
83 82
 	
84 83
 	/**
@@ -86,12 +85,10 @@ public class ProcessNickInUse extends IRCProcessor {
86 85
 	 *
87 86
 	 * @return String[] with the names of the tokens we handle.
88 87
 	 */
89
-    @Override
88
+	@Override
90 89
 	public String[] handles() {
91
-		String[] iHandle = new String[1];
92
-		iHandle[0] = "433";
93
-		return iHandle;
94
-	} 
90
+		return new String[]{"433"};
91
+	}
95 92
 	
96 93
 	/**
97 94
 	 * Create a new instance of the ProcessNickInUse Object.

+ 5
- 8
src/com/dmdirc/parser/ProcessNoticeAuth.java View File

@@ -36,7 +36,7 @@ public class ProcessNoticeAuth extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("Notice Auth")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(final String sParam, final String[] token) {
41 41
 		callNoticeAuth(token[token.length-1]);
42 42
 	}
@@ -46,11 +46,10 @@ public class ProcessNoticeAuth extends IRCProcessor {
46 46
 	 *
47 47
 	 * @see INoticeAuth
48 48
 	 * @param data Incomming Line.
49
-         * @return true if a method was called, false otherwise
49
+	 * @return true if a method was called, false otherwise
50 50
 	 */
51 51
 	protected boolean callNoticeAuth(final String data) {
52
-		return ((CallbackOnNoticeAuth) getCallbackManager()
53
-                .getCallbackType("OnNoticeAuth")).call(data);
52
+		return ((CallbackOnNoticeAuth) getCallbackManager().getCallbackType("OnNoticeAuth")).call(data);
54 53
 	}
55 54
 	
56 55
 	/**
@@ -58,11 +57,9 @@ public class ProcessNoticeAuth extends IRCProcessor {
58 57
 	 *
59 58
 	 * @return String[] with the names of the tokens we handle.
60 59
 	 */
61
-    @Override
60
+	@Override
62 61
 	public String[] handles() {
63
-		String[] iHandle = new String[1];
64
-		iHandle[0] = "Notice Auth";
65
-		return iHandle;
62
+		return new String[]{"Notice Auth"};
66 63
 	} 
67 64
 	
68 65
 	/**

+ 6
- 9
src/com/dmdirc/parser/ProcessPart.java View File

@@ -31,13 +31,13 @@ import com.dmdirc.parser.callbacks.CallbackOnChannelPart;
31 31
  */
32 32
 public class ProcessPart extends IRCProcessor {
33 33
 
34
-    /**
34
+	/**
35 35
 	 * Process a channel part.
36 36
 	 *
37 37
 	 * @param sParam Type of line to process ("PART")
38 38
 	 * @param token IRCTokenised line to process
39 39
 	 */
40
-    @Override
40
+	@Override
41 41
 	public void process(final String sParam, final String[] token) {
42 42
 		// :nick!ident@host PART #Channel
43 43
 		// :nick!ident@host PART #Channel :reason
@@ -85,11 +85,10 @@ public class ProcessPart extends IRCProcessor {
85 85
 	 * @param cChannel Channel that the user parted
86 86
 	 * @param cChannelClient Client that parted
87 87
 	 * @param sReason Reason given for parting (May be "")
88
-         * @return true if a method was called, false otherwise
88
+	 * @return true if a method was called, false otherwise
89 89
 	 */
90 90
 	protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
91
-		return ((CallbackOnChannelPart) getCallbackManager()
92
-                .getCallbackType("OnChannelPart")).call(cChannel, cChannelClient, sReason);
91
+		return ((CallbackOnChannelPart) getCallbackManager().getCallbackType("OnChannelPart")).call(cChannel, cChannelClient, sReason);
93 92
 	}
94 93
 	
95 94
 	/**
@@ -97,11 +96,9 @@ public class ProcessPart extends IRCProcessor {
97 96
 	 *
98 97
 	 * @return String[] with the names of the tokens we handle.
99 98
 	 */
100
-    @Override
99
+	@Override
101 100
 	public String[] handles() {
102
-		String[] iHandle = new String[1];
103
-		iHandle[0] = "PART";
104
-		return iHandle;
101
+		return new String[]{"PART"};
105 102
 	} 
106 103
 	
107 104
 	/**

+ 8
- 12
src/com/dmdirc/parser/ProcessQuit.java View File

@@ -33,13 +33,13 @@ import com.dmdirc.parser.callbacks.CallbackOnQuit;
33 33
  */
34 34
 public class ProcessQuit extends IRCProcessor {
35 35
 
36
-    /**
36
+	/**
37 37
 	 * Process a Quit message.
38 38
 	 *
39 39
 	 * @param sParam Type of line to process ("QUIT")
40 40
 	 * @param token IRCTokenised line to process
41 41
 	 */
42
-    @Override
42
+	@Override
43 43
 	public void process(final String sParam, final String[] token) {
44 44
 		// :nick!ident@host QUIT
45 45
 		// :nick!ident@host QUIT :reason
@@ -88,11 +88,10 @@ public class ProcessQuit extends IRCProcessor {
88 88
 	 * @param cChannel Channel that user was on
89 89
 	 * @param cChannelClient User thats quitting
90 90
 	 * @param sReason Quit reason
91
-         * @return true if a method was called, false otherwise
91
+	 * @return true if a method was called, false otherwise
92 92
 	 */
93 93
 	protected boolean callChannelQuit(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
94
-		return ((CallbackOnChannelQuit) getCallbackManager()
95
-                .getCallbackType("OnChannelQuit")).call(cChannel, cChannelClient, sReason);
94
+		return ((CallbackOnChannelQuit) getCallbackManager().getCallbackType("OnChannelQuit")).call(cChannel, cChannelClient, sReason);
96 95
 	}
97 96
 	
98 97
 	/**
@@ -101,11 +100,10 @@ public class ProcessQuit extends IRCProcessor {
101 100
 	 * @see IQuit
102 101
 	 * @param cClient Client Quitting
103 102
 	 * @param sReason Reason for quitting (may be "")
104
-         * @return true if a method was called, false otherwise
103
+	 * @return true if a method was called, false otherwise
105 104
 	 */
106 105
 	protected boolean callQuit(final ClientInfo cClient, final String sReason) {
107
-		return ((CallbackOnQuit) getCallbackManager()
108
-                .getCallbackType("OnQuit")).call(cClient, sReason);
106
+		return ((CallbackOnQuit) getCallbackManager().getCallbackType("OnQuit")).call(cClient, sReason);
109 107
 	}
110 108
 	
111 109
 	/**
@@ -113,11 +111,9 @@ public class ProcessQuit extends IRCProcessor {
113 111
 	 *
114 112
 	 * @return String[] with the names of the tokens we handle.
115 113
 	 */
116
-    @Override
114
+	@Override
117 115
 	public String[] handles() {
118
-		String[] iHandle = new String[1];
119
-		iHandle[0] = "QUIT";
120
-		return iHandle;
116
+		return new String[]{"QUIT"};
121 117
 	} 
122 118
 	
123 119
 	/**

+ 5
- 10
src/com/dmdirc/parser/ProcessTopic.java View File

@@ -36,7 +36,7 @@ public class ProcessTopic extends IRCProcessor {
36 36
 	 * @param sParam Type of line to process ("TOPIC", "332", "333")
37 37
 	 * @param token IRCTokenised line to process
38 38
 	 */
39
-    @Override
39
+	@Override
40 40
 	public void process(final String sParam, final String[] token) {
41 41
 		ChannelInfo iChannel;
42 42
 		if (sParam.equals("332")) {
@@ -76,11 +76,10 @@ public class ProcessTopic extends IRCProcessor {
76 76
 	 * @see IChannelTopic
77 77
 	 * @param cChannel Channel that topic was set on
78 78
 	 * @param bIsJoinTopic True when getting topic on join, false if set by user/server
79
-         * @return true if a method was called, false otherwise
79
+	 * @return true if a method was called, false otherwise
80 80
 	 */
81 81
 	protected boolean callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
82
-		return ((CallbackOnChannelTopic) getCallbackManager()
83
-                .getCallbackType("OnChannelTopic")).call(cChannel, bIsJoinTopic);
82
+		return ((CallbackOnChannelTopic) getCallbackManager().getCallbackType("OnChannelTopic")).call(cChannel, bIsJoinTopic);
84 83
 	}
85 84
 	
86 85
 	/**
@@ -88,13 +87,9 @@ public class ProcessTopic extends IRCProcessor {
88 87
 	 *
89 88
 	 * @return String[] with the names of the tokens we handle.
90 89
 	 */
91
-    @Override
90
+	@Override
92 91
 	public String[] handles() {
93
-		String[] iHandle = new String[3];
94
-		iHandle[0] = "TOPIC";
95
-		iHandle[1] = "332";
96
-		iHandle[2] = "333";
97
-		return iHandle;
92
+		return new String[]{"TOPIC", "332", "333"};
98 93
 	} 
99 94
 	
100 95
 	/**

+ 9
- 13
src/com/dmdirc/parser/ProcessWallops.java View File

@@ -38,7 +38,7 @@ public class ProcessWallops extends IRCProcessor {
38 38
 	 * @param sParam Type of line to process ("WALLOPS")
39 39
 	 * @param token IRCTokenised line to process
40 40
 	 */
41
-    @Override
41
+	@Override
42 42
 	public void process(final String sParam, final String[] token) {
43 43
 		if (token.length < 3) { return; }
44 44
 		
@@ -65,11 +65,10 @@ public class ProcessWallops extends IRCProcessor {
65 65
 	 * @see IWallop
66 66
 	 * @param host Host of the user who sent the wallop
67 67
 	 * @param message The message
68
-         * @return true if a method was called, false otherwise
68
+	 * @return true if a method was called, false otherwise
69 69
 	 */
70 70
 	protected boolean callWallop(final String message, final String host) {
71
-		return ((CallbackOnWallop) getCallbackManager()
72
-                .getCallbackType("OnWallop")).call(message, host);
71
+		return ((CallbackOnWallop) getCallbackManager().getCallbackType("OnWallop")).call(message, host);
73 72
 	}
74 73
 	
75 74
 	/**
@@ -78,11 +77,10 @@ public class ProcessWallops extends IRCProcessor {
78 77
 	 * @see IWalluser
79 78
 	 * @param host Host of the user who sent the walluser
80 79
 	 * @param message The message
81
-         * @return true if a method was called, false otherwise
80
+	 * @return true if a method was called, false otherwise
82 81
 	 */
83 82
 	protected boolean callWalluser(final String message, final String host) {
84
-		return ((CallbackOnWalluser) getCallbackManager()
85
-                .getCallbackType("OnWalluser")).call(message, host);
83
+		return ((CallbackOnWalluser) getCallbackManager().getCallbackType("OnWalluser")).call(message, host);
86 84
 	}
87 85
 	
88 86
 	/**
@@ -91,11 +89,10 @@ public class ProcessWallops extends IRCProcessor {
91 89
 	 * @see IWallDesync
92 90
 	 * @param host Host of the user who sent the WallDesync
93 91
 	 * @param message The message
94
-         * @return true if a method was called, false otherwise
92
+	 * @return true if a method was called, false otherwise
95 93
 	 */
96 94
 	protected boolean callWallDesync(final String message, final String host) {
97
-		return ((CallbackOnWallDesync) getCallbackManager()
98
-                .getCallbackType("OnWallDesync")).call(message, host);
95
+		return ((CallbackOnWallDesync) getCallbackManager().getCallbackType("OnWallDesync")).call(message, host);
99 96
 	}
100 97
 	
101 98
 	
@@ -104,10 +101,9 @@ public class ProcessWallops extends IRCProcessor {
104 101
 	 *
105 102
 	 * @return String[] with the names of the tokens we handle.
106 103
 	 */
107
-    @Override
104
+	@Override
108 105
 	public String[] handles() {
109
-		String[] iHandle = new String[]{"WALLOPS"};
110
-		return iHandle;
106
+		return new String[]{"WALLOPS"};
111 107
 	} 
112 108
 	
113 109
 	/**

+ 5
- 9
src/com/dmdirc/parser/ProcessWho.java View File

@@ -37,7 +37,7 @@ public class ProcessWho extends IRCProcessor {
37 37
 	 * @param sParam Type of line to process ("352")
38 38
 	 * @param token IRCTokenised line to process
39 39
 	 */
40
-    @Override
40
+	@Override
41 41
 	public void process(final String sParam, final String[] token) {
42 42
 		// :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
43 43
 		//              0               1      2        3     4              5                      6           7     8        9
@@ -88,8 +88,7 @@ public class ProcessWho extends IRCProcessor {
88 88
 	 * @return true if a method was called, false otherwise
89 89
 	 */
90 90
 	protected boolean callAwayStateOther(final ClientInfo client, final boolean state) {
91
-		return ((CallbackOnAwayStateOther) myParser.getCallbackManager()
92
-                .getCallbackType("OnAwayStateOther")).call(client, state);
91
+		return ((CallbackOnAwayStateOther) myParser.getCallbackManager().getCallbackType("OnAwayStateOther")).call(client, state);
93 92
 	}
94 93
 	
95 94
 	/**
@@ -102,8 +101,7 @@ public class ProcessWho extends IRCProcessor {
102 101
 	 * @return true if a method was called, false otherwise
103 102
 	 */
104 103
 	protected boolean callChannelAwayStateOther(final ChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
105
-		return ((CallbackOnChannelAwayStateOther) myParser.getCallbackManager()
106
-                .getCallbackType("OnChannelAwayStateOther")).call(channel, channelClient, state);
104
+		return ((CallbackOnChannelAwayStateOther) myParser.getCallbackManager().getCallbackType("OnChannelAwayStateOther")).call(channel, channelClient, state);
107 105
 	}
108 106
 	
109 107
 	/**
@@ -111,11 +109,9 @@ public class ProcessWho extends IRCProcessor {
111 109
 	 *
112 110
 	 * @return String[] with the names of the tokens we handle.
113 111
 	 */
114
-    @Override
112
+	@Override
115 113
 	public String[] handles() {
116
-		String[] iHandle = new String[1];
117
-		iHandle[0] = "352";
118
-		return iHandle;
114
+		return new String[]{"352"};
119 115
 	} 
120 116
 	
121 117
 	/**

+ 1
- 2
src/com/dmdirc/parser/ProcessingManager.java View File

@@ -218,8 +218,7 @@ public class ProcessingManager {
218 218
 	 * @return true if a method was called, false otherwise
219 219
 	 */
220 220
 	protected boolean callNumeric(final int numeric, final String[] token) {
221
-		return ((CallbackOnNumeric) myParser.getCallbackManager()
222
-                .getCallbackType("OnNumeric")).call(numeric, token);
221
+		return ((CallbackOnNumeric) myParser.getCallbackManager().getCallbackType("OnNumeric")).call(numeric, token);
223 222
 	}
224 223
 
225 224
 }

+ 6
- 6
src/com/dmdirc/parser/callbacks/CallbackManager.java View File

@@ -150,7 +150,7 @@ public final class CallbackManager {
150 150
 		if (!callbackHash.containsKey(callbackName.toLowerCase())) {
151 151
 			throw new CallbackNotFoundException("Callback not found: " + callbackName);
152 152
 		}
153
-        
153
+		
154 154
 		return callbackHash.get(callbackName.toLowerCase());
155 155
 	}
156 156
 	
@@ -187,12 +187,12 @@ public final class CallbackManager {
187 187
 	 */
188 188
 	public void addCallback(final String callbackName, final ICallbackInterface o) throws CallbackNotFoundException {
189 189
 		if (o == null) {
190
-            throw new NullPointerException("CallbackInterface is null");
191
-        }
192
-        
193
-        final CallbackObject cb = getCallbackType(callbackName);
190
+			throw new NullPointerException("CallbackInterface is null");
191
+		}
192
+		
193
+		final CallbackObject cb = getCallbackType(callbackName);
194 194
 		
195
-        if (cb != null) { cb.add(o); }
195
+		if (cb != null) { cb.add(o); }
196 196
 	}
197 197
 	
198 198
 	/**

+ 1
- 2
src/com/dmdirc/parser/callbacks/CallbackObject.java View File

@@ -87,8 +87,7 @@ public abstract class CallbackObject {
87 87
 	 * @return true if error call succeeded, false otherwise
88 88
 	 */
89 89
 	protected final boolean callErrorInfo(final ParserError errorInfo) {
90
-		return ((CallbackOnErrorInfo) myManager
91
-                .getCallbackType("OnErrorInfo")).call(errorInfo);
90
+		return ((CallbackOnErrorInfo) myManager.getCallbackType("OnErrorInfo")).call(errorInfo);
92 91
 	}
93 92
 	
94 93
 	/**

+ 2
- 2
src/com/dmdirc/parser/callbacks/CallbackObjectSpecific.java View File

@@ -60,7 +60,7 @@ public abstract class CallbackObjectSpecific extends CallbackObject {
60 60
 	 */
61 61
 	protected boolean isValidChan(final ICallbackInterface eMethod, final ChannelInfo cChannel) {
62 62
 		if (specificData.containsKey(eMethod)) { 
63
-			if (!myParser.equalsIgnoreCase(cChannel.getName(), specificData.get(eMethod))) { return false; }
63
+			if (!myParser.getIRCStringConverter().equalsIgnoreCase(cChannel.getName(), specificData.get(eMethod))) { return false; }
64 64
 		}
65 65
 		return true;
66 66
 	}
@@ -75,7 +75,7 @@ public abstract class CallbackObjectSpecific extends CallbackObject {
75 75
 	protected boolean isValidUser(final ICallbackInterface eMethod, final String sHost) {
76 76
 		final String nickname = ClientInfo.parseHost(sHost);
77 77
 		if (specificData.containsKey(eMethod)) {
78
-			if (!myParser.equalsIgnoreCase(nickname, specificData.get(eMethod))) { return false; }
78
+			if (!myParser.getIRCStringConverter().equalsIgnoreCase(nickname, specificData.get(eMethod))) { return false; }
79 79
 		}
80 80
 		return true;
81 81
 	}

Loading…
Cancel
Save