Browse Source

Automagical fake client creation, using uber overly-complicated hacks

Fixes issue 2322
tags/0.6.3m1rc1
Chris Smith 15 years ago
parent
commit
40de2a2967

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

@@ -22,12 +22,19 @@
22 22
 
23 23
 package com.dmdirc.parser.irc.callbacks;
24 24
 
25
-import java.util.ArrayList;
26
-
27 25
 import com.dmdirc.parser.irc.IRCParser;
28 26
 import com.dmdirc.parser.irc.ParserError;
29 27
 import com.dmdirc.parser.irc.callbacks.interfaces.ICallbackInterface;
28
+
29
+import java.lang.annotation.Annotation;
30
+import java.lang.reflect.Constructor;
31
+import java.lang.reflect.InvocationTargetException;
32
+import java.lang.reflect.Method;
33
+import java.util.ArrayList;
34
+import java.util.Arrays;
35
+import java.util.HashMap;
30 36
 import java.util.List;
37
+import java.util.Map;
31 38
 
32 39
 /**
33 40
  * CallbackObject.
@@ -140,6 +147,10 @@ public class CallbackObject {
140 147
         System.arraycopy(args, 0, newArgs, 1, args.length);
141 148
         newArgs[0] = myParser;
142 149
 
150
+        if (myParser.getCreateFake()) {
151
+            createFakeArgs(newArgs);
152
+        }
153
+
143 154
 		for (ICallbackInterface iface : new ArrayList<ICallbackInterface>(callbackInfo)) {
144 155
 			try {
145 156
                 type.getMethods()[0].invoke(iface, newArgs);
@@ -154,4 +165,111 @@ public class CallbackObject {
154 165
 		return bResult;
155 166
     }
156 167
 
168
+    /**
169
+     * Replaces all null entries in the specified array with fake values,
170
+     * if the corresponding parameter of this callback's type is marked with
171
+     * the {@link FakableArgument} annotation. The fake classes are constructed
172
+     * by using parameters designated {@link FakableSource}.
173
+     *
174
+     * @param args The arguments to be faked
175
+     */
176
+    protected void createFakeArgs(final Object[] args) {
177
+        int i = 0;
178
+
179
+        for (Annotation[] anns : type.getMethods()[0].getParameterAnnotations()) {
180
+            for (Annotation ann : anns) {
181
+                if (ann.annotationType().equals(FakableArgument.class)
182
+                        && args[i] == null) {
183
+                    args[i] = getFakeArg(args,
184
+                            type.getMethods()[0].getParameterTypes()[i],
185
+                            ((FakableArgument) ann).group());
186
+                }
187
+            }
188
+
189
+            i++;
190
+        }
191
+    }
192
+
193
+    /**
194
+     * Tries to create fake argument of the specified target class, by using
195
+     * {@link FakableSource} denoted parameters from the specified arg array.
196
+     * Parameters are only used if their groups value contains the specified
197
+     * group.
198
+     *
199
+     * If an argument is missing, the method attempts to create a fake instance
200
+     * by recursing into this method again. Note that this could cause an
201
+     * infinite recursion in cases of cyclic dependencies. If recursion fails,
202
+     * the constructor is skipped.
203
+     *
204
+     * If the created object has a <code>setFake(boolean)</code> method, it
205
+     * is automatically invoked with an argument of <code>true</code>.
206
+     *
207
+     * @param args The arguments array to use for sources
208
+     * @param target The class that should be constructed
209
+     * @param group The group of arguments to use
210
+     * @return An instance of the target class, or null on failure
211
+     */
212
+    protected Object getFakeArg(final Object[] args, final Class<?> target, final String group) {
213
+        final Map<Class, Object> sources = new HashMap<Class, Object>();
214
+        int i = 0;
215
+
216
+        for (Annotation[] anns : type.getMethods()[0].getParameterAnnotations()) {
217
+            for (Annotation ann : anns) {
218
+                if (ann.annotationType().equals(FakableSource.class)
219
+                        && Arrays.asList(((FakableSource) ann).group()).contains(group)) {
220
+                    sources.put(type.getMethods()[0].getParameterTypes()[i], args[i]);
221
+                }
222
+            }
223
+
224
+            i++;
225
+        }
226
+
227
+        for (Constructor<?> ctor : target.getConstructors()) {
228
+            Object[] params = new Object[ctor.getParameterTypes().length];
229
+
230
+            i = 0;
231
+            Object param;
232
+            boolean failed = false;
233
+
234
+            for (Class<?> needed : ctor.getParameterTypes()) {
235
+                if (sources.containsKey(needed)) {
236
+                    params[i] = sources.get(needed);
237
+                } else if ((param = getFakeArg(args, needed, group)) != null) {
238
+                    params[i] = param;
239
+                } else {
240
+                    failed = true;
241
+                }
242
+
243
+                i++;
244
+            }
245
+
246
+            if (!failed) {
247
+                try {
248
+                    final Object instance = ctor.newInstance(params);
249
+
250
+                    for (Method method : target.getMethods()) {
251
+                        if (method.getName().equals("setFake")
252
+                                && method.getParameterTypes().length == 1
253
+                                && method.getParameterTypes()[0].equals(Boolean.TYPE)) {
254
+
255
+                            method.invoke(instance, true);
256
+                        }
257
+                    }
258
+
259
+                    return instance;
260
+                } catch (InstantiationException ex) {
261
+                    // Do nothing
262
+                } catch (IllegalAccessException ex) {
263
+                    // Do nothing
264
+                } catch (IllegalArgumentException ex) {
265
+                    // Do nothing
266
+                } catch (InvocationTargetException ex) {
267
+                    // Do nothing
268
+                }
269
+            }
270
+        }
271
+
272
+        return null;
273
+    }
274
+
157 275
 }

+ 4
- 0
src/com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.java View File

@@ -136,6 +136,10 @@ public class CallbackObjectSpecific extends CallbackObject {
136 136
         System.arraycopy(args, 0, newArgs, 1, args.length);
137 137
         newArgs[0] = myParser;
138 138
 
139
+        if (myParser.getCreateFake()) {
140
+            createFakeArgs(newArgs);
141
+        }
142
+
139 143
 		for (ICallbackInterface iface :new ArrayList<ICallbackInterface>(callbackInfo)) {
140 144
             if (type.isAnnotationPresent(SpecificCallback.class) &&
141 145
                     ((args[0] instanceof ClientInfo

+ 48
- 0
src/com/dmdirc/parser/irc/callbacks/FakableArgument.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.parser.irc.callbacks;
24
+
25
+import java.lang.annotation.ElementType;
26
+import java.lang.annotation.Retention;
27
+import java.lang.annotation.RetentionPolicy;
28
+import java.lang.annotation.Target;
29
+
30
+/**
31
+ * Indicates a specific argument may be faked.
32
+ *
33
+ * @since 0.6.3
34
+ * @author chris
35
+ */
36
+@Retention(RetentionPolicy.RUNTIME)
37
+@Target(ElementType.PARAMETER)
38
+public @interface FakableArgument {
39
+
40
+    /**
41
+     * A group name used to differentiate between multiple fakable arguments
42
+     * in the same method.
43
+     *
44
+     * @return The name of the group for multiple fakable arguments
45
+     */
46
+    String group() default "default";
47
+
48
+}

+ 49
- 0
src/com/dmdirc/parser/irc/callbacks/FakableSource.java View File

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.parser.irc.callbacks;
24
+
25
+import java.lang.annotation.ElementType;
26
+import java.lang.annotation.Retention;
27
+import java.lang.annotation.RetentionPolicy;
28
+import java.lang.annotation.Target;
29
+
30
+/**
31
+ * Indicates that the specified argument is a source of data for fakable
32
+ * arguments.
33
+ *
34
+ * @since 0.6.3
35
+ * @author chris
36
+ */
37
+@Retention(RetentionPolicy.RUNTIME)
38
+@Target(ElementType.PARAMETER)
39
+public @interface FakableSource {
40
+
41
+    /**
42
+     * A group name used to differentiate between multiple fakable arguments
43
+     * in the same method.
44
+     *
45
+     * @return The name of the groups for multiple fakable arguments
46
+     */
47
+    String[] group() default {"default"};
48
+
49
+}

+ 8
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelAction.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /**
@@ -46,5 +48,10 @@ public interface IChannelAction extends ICallbackInterface {
46 48
 	 * @param sHost Hostname of sender (or servername)
47 49
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelAction
48 50
 	 */
49
-	void onChannelAction(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost);
51
+	void onChannelAction(
52
+            @FakableSource IRCParser tParser,
53
+            @FakableSource ChannelInfo cChannel,
54
+            @FakableArgument ChannelClientInfo cChannelClient,
55
+            String sMessage,
56
+            @FakableSource String sHost);
50 57
 }

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelCTCP.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /**
@@ -47,5 +49,9 @@ public interface IChannelCTCP extends ICallbackInterface {
47 49
 	 * @param sHost Hostname of sender (or servername)
48 50
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelCTCP
49 51
 	 */
50
-	void onChannelCTCP(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sType, String sMessage, String sHost);
52
+	void onChannelCTCP(@FakableSource IRCParser tParser,
53
+            @FakableSource ChannelInfo cChannel,
54
+            @FakableArgument ChannelClientInfo cChannelClient,
55
+            String sType, String sMessage,
56
+            @FakableSource String sHost);
51 57
 }

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelCTCPReply.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /**
@@ -47,5 +49,9 @@ public interface IChannelCTCPReply extends ICallbackInterface {
47 49
 	 * @param sHost Hostname of sender (or servername)
48 50
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelCTCPReply
49 51
 	 */
50
-	void onChannelCTCPReply(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sType, String sMessage, String sHost);
52
+	void onChannelCTCPReply(@FakableSource IRCParser tParser,
53
+            @FakableSource ChannelInfo cChannel,
54
+            @FakableArgument ChannelClientInfo cChannelClient,
55
+            String sType, String sMessage,
56
+            @FakableSource String sHost);
51 57
 }

+ 8
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelKick.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /**
@@ -45,5 +47,10 @@ public interface IChannelKick extends ICallbackInterface {
45 47
 	 * @param sKickedByHost Hostname of Kicker (or servername)
46 48
 	 * @see com.dmdirc.parser.irc.ProcessKick#callChannelKick
47 49
 	 */
48
-	void onChannelKick(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost);
50
+	void onChannelKick(@FakableSource IRCParser tParser,
51
+            @FakableSource ChannelInfo cChannel,
52
+            ChannelClientInfo cKickedClient,
53
+            @FakableArgument ChannelClientInfo cKickedByClient,
54
+            String sReason,
55
+            @FakableSource String sKickedByHost);
49 56
 }

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelMessage.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /**
@@ -46,5 +48,9 @@ public interface IChannelMessage extends ICallbackInterface {
46 48
 	 * @param sHost Hostname of sender (or servername)
47 49
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelMessage
48 50
 	 */
49
-	void onChannelMessage(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost);
51
+	void onChannelMessage(@FakableSource IRCParser tParser,
52
+            @FakableSource ChannelInfo cChannel,
53
+            @FakableArgument ChannelClientInfo cChannelClient,
54
+            String sMessage,
55
+            @FakableSource String sHost);
50 56
 }

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelModeChanged.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /** 
@@ -46,5 +48,9 @@ public interface IChannelModeChanged extends ICallbackInterface {
46 48
 	 * @param sModes String showing the exact mode change parsed.
47 49
 	 * @see com.dmdirc.parser.irc.ProcessMode#callChannelModeChanged
48 50
 	 */
49
-	void onChannelModeChanged(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes);
51
+	void onChannelModeChanged(@FakableSource IRCParser tParser,
52
+            @FakableSource ChannelInfo cChannel,
53
+            @FakableArgument ChannelClientInfo cChannelClient,
54
+            @FakableSource String sHost,
55
+            String sModes);
50 56
 }

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelNonUserModeChanged.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /** 
@@ -45,6 +47,10 @@ public interface IChannelNonUserModeChanged extends ICallbackInterface {
45 47
 	 * @param sHost Host doing the mode changing (User host or server name)
46 48
 	 * @param sModes String showing the exact mode change parsed. (Not including user modes)
47 49
 	 */
48
-	void onChannelNonUserModeChanged(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes);
50
+	void onChannelNonUserModeChanged(@FakableSource IRCParser tParser,
51
+            @FakableSource ChannelInfo cChannel,
52
+            @FakableArgument ChannelClientInfo cChannelClient,
53
+            @FakableSource String sHost,
54
+            String sModes);
49 55
 }
50 56
 

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelNotice.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /**
@@ -46,5 +48,9 @@ public interface IChannelNotice extends ICallbackInterface {
46 48
 	 * @param sHost Hostname of sender (or servername)
47 49
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelNotice
48 50
 	 */
49
-	void onChannelNotice(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost);
51
+	void onChannelNotice(@FakableSource IRCParser tParser,
52
+            @FakableSource ChannelInfo cChannel,
53
+            @FakableArgument ChannelClientInfo cChannelClient,
54
+            String sMessage,
55
+            @FakableSource String sHost);
50 56
 }

+ 7
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelSingleModeChanged.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /** 
@@ -45,6 +47,10 @@ public interface IChannelSingleModeChanged extends ICallbackInterface {
45 47
 	 * @param sHost Host doing the mode changing (User host or server name)
46 48
 	 * @param sModes String parsed (ie "+m" or "+k moo"
47 49
 	 */
48
-	void onChannelSingleModeChanged(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes);
50
+	void onChannelSingleModeChanged(@FakableSource IRCParser tParser,
51
+            @FakableSource ChannelInfo cChannel,
52
+            @FakableArgument ChannelClientInfo cChannelClient,
53
+            @FakableSource String sHost,
54
+            String sModes);
49 55
 }
50 56
 

+ 8
- 1
src/com/dmdirc/parser/irc/callbacks/interfaces/IChannelUserModeChanged.java View File

@@ -25,6 +25,8 @@ package com.dmdirc.parser.irc.callbacks.interfaces;
25 25
 import com.dmdirc.parser.irc.ChannelClientInfo;
26 26
 import com.dmdirc.parser.irc.ChannelInfo;
27 27
 import com.dmdirc.parser.irc.IRCParser;
28
+import com.dmdirc.parser.irc.callbacks.FakableArgument;
29
+import com.dmdirc.parser.irc.callbacks.FakableSource;
28 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 31
 
30 32
 /** 
@@ -45,5 +47,10 @@ public interface IChannelUserModeChanged extends ICallbackInterface {
45 47
 	 * @param sMode String representing mode change (ie +o)
46 48
 	 * @see com.dmdirc.parser.irc.ProcessMode#callChannelUserModeChanged
47 49
 	 */
48
-	void onChannelUserModeChanged(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode);
50
+	void onChannelUserModeChanged(@FakableSource IRCParser tParser,
51
+            @FakableSource ChannelInfo cChannel,
52
+            ChannelClientInfo cChangedClient,
53
+            @FakableArgument ChannelClientInfo cSetByClient,
54
+            @FakableSource String sHost,
55
+            String sMode);
49 56
 }

Loading…
Cancel
Save