//# 8 errors, 374 messages
//#
/*
    //#CallbackObject.java:1:1: class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#CallbackObject.java:1:1: method: com.dmdirc.parser.irc.callbacks.CallbackObject.com.dmdirc.parser.irc.callbacks.CallbackObject__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.parser.irc.callbacks;

import com.dmdirc.parser.irc.IRCParser;
import com.dmdirc.parser.irc.ParserError;
import com.dmdirc.parser.irc.callbacks.interfaces.ICallbackInterface;

import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * CallbackObject.
 * Superclass for all callback types.
 *
 * @author            Shane Mc Cormack
 */
public class CallbackObject {

    /** The type of callback that this object is operating with. */
    protected final Class<? extends ICallbackInterface> type;

	/** Arraylist for storing callback information related to the callback. */
	protected final List<ICallbackInterface> callbackInfo = new ArrayList<ICallbackInterface>();
	
	/** Reference to the IRCParser that owns this callback. */
	protected IRCParser myParser;
	/** Reference to the CallbackManager in charge of this callback. */
	protected CallbackManager myManager;
	
	/**
	 * Create a new instance of the Callback Object.
	 *
	 * @param parser IRCParser That owns this callback
	 * @param manager CallbackManager that is in charge of this callback
     * @param type The type of callback to use
     * @since 0.6.3m1
	 */
	protected CallbackObject(final IRCParser parser, final CallbackManager manager,
            final Class<? extends ICallbackInterface> type) {
    //#CallbackObject.java:66: method: void com.dmdirc.parser.irc.callbacks.CallbackObject.com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)
    //#input(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): manager
    //#input(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): parser
    //#input(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this
    //#input(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): type
    //#output(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): new ArrayList(CallbackObject#1) num objects
    //#output(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.callbackInfo
    //#output(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.myManager
    //#output(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.myParser
    //#output(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.type
    //#new obj(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): new ArrayList(CallbackObject#1)
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.callbackInfo == &new ArrayList(CallbackObject#1)
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.myManager == manager
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): init'ed(this.myManager)
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.myParser == parser
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): init'ed(this.myParser)
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): this.type == type
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): init'ed(this.type)
    //#post(void com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)): new ArrayList(CallbackObject#1) num objects == 1
		this.myParser = parser;
		this.myManager = manager;
        this.type = type;
	}
    //#CallbackObject.java:70: end of method: void com.dmdirc.parser.irc.callbacks.CallbackObject.com.dmdirc.parser.irc.callbacks.CallbackObject(IRCParser, CallbackManager, Class)
	
	/**
	 * Add a callback pointer to the appropriate ArrayList.
	 *
	 * @param eMethod OBject to callback to.
	 */
	protected final void addCallback(final ICallbackInterface eMethod) {
		if (!callbackInfo.contains(eMethod)) {
    //#CallbackObject.java:78: method: void com.dmdirc.parser.irc.callbacks.CallbackObject.addCallback(ICallbackInterface)
    //#input(void addCallback(ICallbackInterface)): eMethod
    //#input(void addCallback(ICallbackInterface)): this
    //#input(void addCallback(ICallbackInterface)): this.callbackInfo
    //#pre[3] (void addCallback(ICallbackInterface)): this.callbackInfo != null
    //#test_vector(void addCallback(ICallbackInterface)): java.util.List:contains(...)@78: {1}, {0}
            callbackInfo.add(eMethod);
        }
	}
    //#CallbackObject.java:81: end of method: void com.dmdirc.parser.irc.callbacks.CallbackObject.addCallback(ICallbackInterface)
	
	/**
	 * Delete a callback pointer from the appropriate ArrayList.
	 *
	 * @param eMethod Object that was being called back to.
	 */
	protected final void delCallback(final ICallbackInterface eMethod) {
        callbackInfo.remove(eMethod);
    //#CallbackObject.java:89: method: void com.dmdirc.parser.irc.callbacks.CallbackObject.delCallback(ICallbackInterface)
    //#input(void delCallback(ICallbackInterface)): eMethod
    //#input(void delCallback(ICallbackInterface)): this
    //#input(void delCallback(ICallbackInterface)): this.callbackInfo
    //#pre[3] (void delCallback(ICallbackInterface)): this.callbackInfo != null
	}
    //#CallbackObject.java:90: end of method: void com.dmdirc.parser.irc.callbacks.CallbackObject.delCallback(ICallbackInterface)
	
	/**
	 * Call the OnErrorInfo callback.
	 *
	 * @param errorInfo ParserError object to pass as error.
	 * @return true if error call succeeded, false otherwise
	 */
	protected final boolean callErrorInfo(final ParserError errorInfo) {
		return myManager.getCallbackType("OnErrorInfo").call(errorInfo);
    //#CallbackObject.java:99: method: bool com.dmdirc.parser.irc.callbacks.CallbackObject.callErrorInfo(ParserError)
    //#CallbackObject.java:99: ?null dereference
    //#    getCallbackType(...) != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool callErrorInfo(ParserError)
    //#    basic block: Entry_BB_1
    //#    assertion: getCallbackType(...) != null
    //#    VN: getCallbackType(...)
    //#    Expected: Inverse{null}
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
    //#CallbackObject.java:99: ?use of default init
    //#    init'ed(getCallbackType(...).__Tag)
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool callErrorInfo(ParserError)
    //#    basic block: Entry_BB_1
    //#    assertion: init'ed(getCallbackType(...).__Tag)
    //#    VN: getCallbackType(...).__Tag
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#CallbackObject.java:99: ?null dereference
    //#    __Descendant_Table[getCallbackType(...).__Tag] != null
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool callErrorInfo(ParserError)
    //#    basic block: Entry_BB_1
    //#    assertion: __Descendant_Table[getCallbackType(...).__Tag] != null
    //#    VN: __Descendant_Table[getCallbackType(...).__Tag]
    //#    Expected: Inverse{null}
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
    //#CallbackObject.java:99: Warning: call too complex - analysis skipped
    //#    call on bool call(Object[])
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool callErrorInfo(ParserError)
    //#    unanalyzed callee: bool call(Object[])
    //#input(bool callErrorInfo(ParserError)): "Callback not found: "._tainted
    //#input(bool callErrorInfo(ParserError)): "OnErrorInfo"._tainted
    //#input(bool callErrorInfo(ParserError)): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific]
    //#input(bool callErrorInfo(ParserError)): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject]
    //#input(bool callErrorInfo(ParserError)): __Descendant_Table[others]
    //#input(bool callErrorInfo(ParserError)): __Dispatch_Table.call([Ljava/lang/Object;)Z
    //#input(bool callErrorInfo(ParserError)): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.call([Ljava/lang/Object;)Z
    //#input(bool callErrorInfo(ParserError)): errorInfo
    //#input(bool callErrorInfo(ParserError)): this
    //#input(bool callErrorInfo(ParserError)): this.myManager
    //#input(bool callErrorInfo(ParserError)): this.myManager.callbackHash
    //#output(bool callErrorInfo(ParserError)): return_value
    //#pre[3] (bool callErrorInfo(ParserError)): this.myManager != null
    //#pre[4] (bool callErrorInfo(ParserError)): this.myManager.callbackHash != null
    //#presumption(bool callErrorInfo(ParserError)): getCallbackType(...)@99 init'ed
    //#post(bool callErrorInfo(ParserError)): init'ed(return_value)
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.lang.RuntimeException
    //#unanalyzed(bool callErrorInfo(ParserError)): Effects-of-calling:java.util.Map:get
    //#CallbackObject.java:99: end of method: bool com.dmdirc.parser.irc.callbacks.CallbackObject.callErrorInfo(ParserError)
	}
	
	/**
	 * Add a new callback.
	 *
	 * @param eMethod Object to callback to.
	 */
	public void add(final ICallbackInterface eMethod) { addCallback(eMethod); }
    //#CallbackObject.java:107: method: void com.dmdirc.parser.irc.callbacks.CallbackObject.add(ICallbackInterface)
    //#input(void add(ICallbackInterface)): eMethod
    //#input(void add(ICallbackInterface)): this
    //#input(void add(ICallbackInterface)): this.callbackInfo
    //#pre[3] (void add(ICallbackInterface)): this.callbackInfo != null
    //#unanalyzed(void add(ICallbackInterface)): Effects-of-calling:java.util.List:contains
    //#unanalyzed(void add(ICallbackInterface)): Effects-of-calling:java.util.List:add
    //#CallbackObject.java:107: end of method: void com.dmdirc.parser.irc.callbacks.CallbackObject.add(ICallbackInterface)
	
	/**
	 * Remove a callback.
	 *
	 * @param eMethod Object to remove callback to.
	 */
	public void del(final ICallbackInterface eMethod) { delCallback(eMethod); }
    //#CallbackObject.java:114: method: void com.dmdirc.parser.irc.callbacks.CallbackObject.del(ICallbackInterface)
    //#input(void del(ICallbackInterface)): eMethod
    //#input(void del(ICallbackInterface)): this
    //#input(void del(ICallbackInterface)): this.callbackInfo
    //#pre[3] (void del(ICallbackInterface)): this.callbackInfo != null
    //#unanalyzed(void del(ICallbackInterface)): Effects-of-calling:java.util.List:remove
    //#CallbackObject.java:114: end of method: void com.dmdirc.parser.irc.callbacks.CallbackObject.del(ICallbackInterface)
	
	/**
	 * Get the name for this callback.
	 *
	 * @return Name of callback
	 */
	public String getName() {
		return "On" + type.getSimpleName().substring(1); // Trim the 'I'
    //#CallbackObject.java:122: method: String com.dmdirc.parser.irc.callbacks.CallbackObject.getName()
    //#input(String getName()): "On"._tainted
    //#input(String getName()): this
    //#input(String getName()): this.type
    //#output(String getName()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getName()): return_value
    //#new obj(String getName()): java.lang.StringBuilder:toString(...)
    //#pre[2] (String getName()): this.type != null
    //#presumption(String getName()): java.lang.Class:getSimpleName(...)@122 != null
    //#post(String getName()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getName()): return_value == &java.lang.StringBuilder:toString(...)
    //#CallbackObject.java:122: end of method: String com.dmdirc.parser.irc.callbacks.CallbackObject.getName()
	}
	
	/**
	 * Get the name for this callback in lowercase.
	 *
	 * @return Name of callback, in lowercase
	 */
	public final String getLowerName() { return this.getName().toLowerCase(); }
    //#CallbackObject.java:130: method: String com.dmdirc.parser.irc.callbacks.CallbackObject.getLowerName()
    //#CallbackObject.java:130: Warning: unused assignment in callee
    //#    Unused assignment to (java.lang.StringBuilder:toString(...)._tainted) in getName
    //#    severity: LOW
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: String getLowerName()
    //#CallbackObject.java:130: Warning: suspicious precondition
    //#    The precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: String getLowerName()
    //#    suspicious precondition index: [2]
    //#input(String getLowerName()): "On"._tainted
    //#input(String getLowerName()): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific]
    //#input(String getLowerName()): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject]
    //#input(String getLowerName()): __Descendant_Table[others]
    //#input(String getLowerName()): __Dispatch_Table.getName()Ljava/lang/String;
    //#input(String getLowerName()): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(String getLowerName()): this
    //#input(String getLowerName()): this.__Tag
    //#input(String getLowerName()): this.type
    //#output(String getLowerName()): return_value
    //#pre[2] (String getLowerName()): this.__Tag in {com/dmdirc/parser/irc/callbacks/CallbackObject, com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific}
    //#pre[3] (String getLowerName()): this.type != null
    //#post(String getLowerName()): return_value != null
    //#unanalyzed(String getLowerName()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getLowerName()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getLowerName()): Effects-of-calling:java.lang.Class:getSimpleName
    //#unanalyzed(String getLowerName()): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(String getLowerName()): Effects-of-calling:java.lang.StringBuilder:toString
    //#CallbackObject.java:130: end of method: String com.dmdirc.parser.irc.callbacks.CallbackObject.getLowerName()

    /**
     * Actually calls this callback. The specified arguments must match those
     * specified in the callback's interface, or an error will be raised.
     *
     * @param args The arguments to pass to the callback implementation
     * @return True if a method was called, false otherwise
     */
    public boolean call(final Object ... args) {
		boolean bResult = false;
    //#CallbackObject.java:140: method: bool com.dmdirc.parser.irc.callbacks.CallbackObject.call(Object[])
    //#CallbackObject.java:140: Warning: suspicious precondition
    //#    The precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool call(Object[])
    //#    suspicious precondition index: [5]
    //#    Attribs:  Soft
    //#input(bool call(Object[])): ")"._tainted
    //#input(bool call(Object[])): "Callback not found: "._tainted
    //#input(bool call(Object[])): "Exception in callback ("._tainted
    //#input(bool call(Object[])): "OnErrorInfo"._tainted
    //#input(bool call(Object[])): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific]
    //#input(bool call(Object[])): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject]
    //#input(bool call(Object[])): __Descendant_Table[others]
    //#input(bool call(Object[])): __Dispatch_Table.call([Ljava/lang/Object;)Z
    //#input(bool call(Object[])): __Dispatch_Table.createFakeArgs([Ljava/lang/Object;)V
    //#input(bool call(Object[])): __Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#input(bool call(Object[])): args
    //#input(bool call(Object[])): args.length
    //#input(bool call(Object[])): args[0..+Inf]
    //#input(bool call(Object[])): com/dmdirc/parser/irc/IRCParser.__Descendant_Table[com/dmdirc/parser/irc/IRCParser]
    //#input(bool call(Object[])): com/dmdirc/parser/irc/IRCParser.__Descendant_Table[others]
    //#input(bool call(Object[])): com/dmdirc/parser/irc/IRCParser.__Dispatch_Table.getCreateFake()Z
    //#input(bool call(Object[])): com/dmdirc/parser/irc/IRCParser.__Dispatch_Table.getLastLine()Ljava/lang/String;
    //#input(bool call(Object[])): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.call([Ljava/lang/Object;)Z
    //#input(bool call(Object[])): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.createFakeArgs([Ljava/lang/Object;)V
    //#input(bool call(Object[])): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#input(bool call(Object[])): com/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface.__Descendant_Table[others]
    //#input(bool call(Object[])): java.lang.Boolean.TYPE
    //#input(bool call(Object[])): this
    //#input(bool call(Object[])): this.__Tag
    //#input(bool call(Object[])): this.callbackInfo
    //#input(bool call(Object[])): this.myManager
    //#input(bool call(Object[])): this.myManager.callbackHash
    //#input(bool call(Object[])): this.myParser
    //#input(bool call(Object[])): this.myParser.__Tag
    //#input(bool call(Object[])): this.myParser.createFake
    //#input(bool call(Object[])): this.myParser.lastLine
    //#input(bool call(Object[])): this.type
    //#output(bool call(Object[])): return_value
    //#pre[1] (bool call(Object[])): args != null
    //#pre[9] (bool call(Object[])): this.myParser != null
    //#pre[10] (bool call(Object[])): this.myParser.__Tag == com/dmdirc/parser/irc/IRCParser
    //#pre[11] (bool call(Object[])): init'ed(this.myParser.createFake)
    //#pre[3] (bool call(Object[])): (soft) init'ed(args[0..+Inf])
    //#pre[5] (bool call(Object[])): (soft) this.__Tag in {com/dmdirc/parser/irc/callbacks/CallbackObject, com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific}
    //#pre[7] (bool call(Object[])): (soft) this.myManager != null
    //#pre[8] (bool call(Object[])): (soft) this.myManager.callbackHash != null
    //#pre[12] (bool call(Object[])): (soft) init'ed(this.myParser.lastLine)
    //#pre[13] (bool call(Object[])): (soft) this.type != null
    //#presumption(bool call(Object[])): java.lang.Class:getMethods(...).length@152 >= 1
    //#presumption(bool call(Object[])): java.lang.Class:getMethods(...)@152 != null
    //#presumption(bool call(Object[])): java.lang.Class:getMethods(...)[0]@152 != null
    //#presumption(bool call(Object[])): java.util.ArrayList:iterator(...)@150 != null
    //#post(bool call(Object[])): init'ed(return_value)
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.Class:getMethods
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.reflect.Method:getParameterAnnotations
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.annotation.Annotation:annotationType
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.Object:equals
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.reflect.Method:getParameterTypes
    //#unanalyzed(bool call(Object[])): Effects-of-calling:getFakeArg
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.HashMap
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.Map:put
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.Class:getConstructors
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.reflect.Constructor:getParameterTypes
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.Map:get
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.reflect.Constructor:newInstance
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.reflect.Method:getName
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.reflect.Method:invoke
    //#unanalyzed(bool call(Object[])): Effects-of-calling:getCreateFake
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.ArrayList:iterator
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.Exception:getMessage
    //#unanalyzed(bool call(Object[])): Effects-of-calling:getLastLine
    //#unanalyzed(bool call(Object[])): Effects-of-calling:callErrorInfo
    //#unanalyzed(bool call(Object[])): Effects-of-calling:getCallbackType
    //#unanalyzed(bool call(Object[])): Effects-of-calling:call
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(bool call(Object[])): Effects-of-calling:java.lang.RuntimeException
    //#test_vector(bool call(Object[])): this.myParser.createFake: {0}, {1}
    //#test_vector(bool call(Object[])): java.util.Iterator:hasNext(...)@150: {0}, {1}

        final Object[] newArgs = new Object[args.length + 1];
        System.arraycopy(args, 0, newArgs, 1, args.length);
        newArgs[0] = myParser;

        if (myParser.getCreateFake()) {
            createFakeArgs(newArgs);
    //#CallbackObject.java:147: ?precondition failure
    //#    com/dmdirc/parser/irc/callbacks/CallbackObject.createFakeArgs: (soft) init'ed(args[0..4_294_967_295])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool call(Object[])
    //#    basic block: bb_2
    //#    assertion: (soft) init'ed(newArgs[0..+Inf])
    //#    callee: void com/dmdirc/parser/irc/callbacks/CallbackObject.createFakeArgs(Object[])
    //#    callee assertion: (soft) init'ed(args[0..4_294_967_295])
    //#    callee file: CallbackObject.java
    //#    callee precondition index: [3]
    //#    callee srcpos: 173
    //#    VN: newArgs[0..+Inf]
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Soft  Bad only invalid
        }

		for (ICallbackInterface iface : new ArrayList<ICallbackInterface>(callbackInfo)) {
    //#CallbackObject.java:150: ?ClassCastException check
    //#    com/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface.__Descendant_Table[java/util/Iterator:next(...).__Tag] != null
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: bool call(Object[])
    //#    basic block: bb_11
    //#    assertion: com/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface.__Descendant_Table[java/util/Iterator:next(...).__Tag] != null
    //#    VN: !(com/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface.__Descendant_Table[java.util.Iterator:next(...).__Tag] == null)
    //#    Expected: {-Inf..-1, 1..+Inf}
    //#    Bad: {0}
    //#    Attribs:  Int  Bad singleton  Bad overlaps +/-1000  Bad > Exp
			try {
                type.getMethods()[0].invoke(iface, newArgs);
			} catch (Exception e) {
				final ParserError ei = new ParserError(ParserError.ERROR_ERROR,
                        "Exception in callback ("+e.getMessage()+")", myParser.getLastLine());
				ei.setException(e);
				callErrorInfo(ei);
			}
			bResult = true;
		}
		return bResult;
    //#CallbackObject.java:161: end of method: bool com.dmdirc.parser.irc.callbacks.CallbackObject.call(Object[])
    }

    /**
     * Replaces all null entries in the specified array with fake values,
     * if the corresponding parameter of this callback's type is marked with
     * the {@link FakableArgument} annotation. The fake classes are constructed
     * by using parameters designated {@link FakableSource}.
     *
     * @param args The arguments to be faked
     */
    protected void createFakeArgs(final Object[] args) {
        int i = 0;
    //#CallbackObject.java:173: method: void com.dmdirc.parser.irc.callbacks.CallbackObject.createFakeArgs(Object[])
    //#CallbackObject.java:173: Warning: suspicious precondition
    //#    The precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: void createFakeArgs(Object[])
    //#    suspicious precondition index: [5]
    //#    Attribs:  Soft
    //#input(void createFakeArgs(Object[])): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific]
    //#input(void createFakeArgs(Object[])): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject]
    //#input(void createFakeArgs(Object[])): __Descendant_Table[others]
    //#input(void createFakeArgs(Object[])): __Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#input(void createFakeArgs(Object[])): args
    //#input(void createFakeArgs(Object[])): args.length
    //#input(void createFakeArgs(Object[])): args[0..4_294_967_295]
    //#input(void createFakeArgs(Object[])): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#input(void createFakeArgs(Object[])): java.lang.Boolean.TYPE
    //#input(void createFakeArgs(Object[])): this
    //#input(void createFakeArgs(Object[])): this.__Tag
    //#input(void createFakeArgs(Object[])): this.type
    //#output(void createFakeArgs(Object[])): args[0..4_294_967_295]
    //#pre[6] (void createFakeArgs(Object[])): this.type != null
    //#pre[1] (void createFakeArgs(Object[])): (soft) args != null
    //#pre[2] (void createFakeArgs(Object[])): (soft) args.length >= 1
    //#pre[3] (void createFakeArgs(Object[])): (soft) init'ed(args[0..4_294_967_295])
    //#pre[5] (void createFakeArgs(Object[])): (soft) this.__Tag in {com/dmdirc/parser/irc/callbacks/CallbackObject, com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific}
    //#presumption(void createFakeArgs(Object[])): arr$.length@175 <= args.length
    //#presumption(void createFakeArgs(Object[])): arr$.length@175 <= 4_294_967_295
    //#presumption(void createFakeArgs(Object[])): arr$.length@175 in {1..4_294_967_295}
    //#presumption(void createFakeArgs(Object[])): arr$.length@175 >= 1
    //#presumption(void createFakeArgs(Object[])): arr$[i$]@175 != null
    //#presumption(void createFakeArgs(Object[])): arr$[i$]@175 != null
    //#presumption(void createFakeArgs(Object[])): arr$[i$]@175 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.Class:getMethods(...).length@175 >= 1
    //#presumption(void createFakeArgs(Object[])): java.lang.Class:getMethods(...).length@179 >= 1
    //#presumption(void createFakeArgs(Object[])): java.lang.Class:getMethods(...)@175 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.Class:getMethods(...)@179 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.Class:getMethods(...)[0]@175 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.Class:getMethods(...)[0]@179 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.annotation.Annotation:annotationType(...)@177 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.reflect.Method:getParameterAnnotations(...)@175 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.reflect.Method:getParameterTypes(...).length@179 >= 1
    //#presumption(void createFakeArgs(Object[])): arr$.length@175 <= java.lang.reflect.Method:getParameterTypes(...).length@179
    //#presumption(void createFakeArgs(Object[])): java.lang.reflect.Method:getParameterTypes(...)@179 != null
    //#presumption(void createFakeArgs(Object[])): java.lang.reflect.Method:getParameterTypes(...)[i]@179 != null
    //#post(void createFakeArgs(Object[])): init'ed(args[0..4_294_967_295])
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.Class:getMethods
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.reflect.Method:getParameterAnnotations
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.annotation.Annotation:annotationType
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.Object:equals
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.reflect.Method:getParameterTypes
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:getFakeArg
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.util.HashMap
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.util.Map:put
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.Class:getConstructors
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.reflect.Constructor:getParameterTypes
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.reflect.Constructor:newInstance
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.reflect.Method:getName
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(void createFakeArgs(Object[])): Effects-of-calling:java.lang.reflect.Method:invoke
    //#test_vector(void createFakeArgs(Object[])): java.lang.Object:equals(...)@177: {0}, {1}

        for (Annotation[] anns : type.getMethods()[0].getParameterAnnotations()) {
            for (Annotation ann : anns) {
    //#CallbackObject.java:176: ?null dereference
    //#    arr$ != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: void createFakeArgs(Object[])
    //#    basic block: bb_3
    //#    assertion: arr$ != null
    //#    VN: arr$[i$]
    //#    Expected: Inverse{null}
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
    //#CallbackObject.java:176: ?array index out of bounds
    //#    i$ < arr$.length
    //#    severity: MEDIUM
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: void createFakeArgs(Object[])
    //#    basic block: bb_5
    //#    assertion: i$ < arr$.length
    //#    VN: arr$.length - i$
    //#    Expected: {1..+Inf}
    //#    Bad: {-4_294_967_293..0}
    //#    Attribs:  Int  Bad overlaps +/-1000  Bad < Exp
                if (ann.annotationType().equals(FakableArgument.class)
    //#CallbackObject.java:177: ?null dereference
    //#    ann != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: void createFakeArgs(Object[])
    //#    basic block: bb_5
    //#    assertion: ann != null
    //#    VN: arr$[i$]
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
                        && args[i] == null) {
                    args[i] = getFakeArg(args, type.getMethods()[0].getParameterTypes()[i]);
                }
            }

            i++;
        }
    }
    //#CallbackObject.java:185: end of method: void com.dmdirc.parser.irc.callbacks.CallbackObject.createFakeArgs(Object[])

    /**
     * Tries to create fake argument of the specified target class, by using
     * {@link FakableSource} denoted parameters from the specified arg array.
     *
     * If an argument is missing, the method attempts to create a fake instance
     * by recursing into this method again. Note that this could cause an
     * infinite recursion in cases of cyclic dependencies. If recursion fails,
     * the constructor is skipped.
     *
     * If the created object has a <code>setFake(boolean)</code> method, it
     * is automatically invoked with an argument of <code>true</code>.
     *
     * @param args The arguments array to use for sources
     * @param target The class that should be constructed
     * @return An instance of the target class, or null on failure
     */
    protected Object getFakeArg(final Object[] args, final Class<?> target) {
        final Map<Class, Object> sources = new HashMap<Class, Object>();
    //#CallbackObject.java:204: method: Object com.dmdirc.parser.irc.callbacks.CallbackObject.getFakeArg(Object[], Class)
    //#CallbackObject.java:204: Warning: suspicious precondition
    //#    The precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.parser.irc.callbacks.CallbackObject
    //#    method: Object getFakeArg(Object[], Class)
    //#    suspicious precondition index: [6]
    //#    Attribs:  Soft
    //#input(Object getFakeArg(Object[], Class)): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific]
    //#input(Object getFakeArg(Object[], Class)): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject]
    //#input(Object getFakeArg(Object[], Class)): __Descendant_Table[others]
    //#input(Object getFakeArg(Object[], Class)): __Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#input(Object getFakeArg(Object[], Class)): args
    //#input(Object getFakeArg(Object[], Class)): args.length
    //#input(Object getFakeArg(Object[], Class)): args[0..4_294_967_295]
    //#input(Object getFakeArg(Object[], Class)): com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.__Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#input(Object getFakeArg(Object[], Class)): java.lang.Boolean.TYPE
    //#input(Object getFakeArg(Object[], Class)): target
    //#input(Object getFakeArg(Object[], Class)): this
    //#input(Object getFakeArg(Object[], Class)): this.__Tag
    //#input(Object getFakeArg(Object[], Class)): this.type
    //#output(Object getFakeArg(Object[], Class)): return_value
    //#pre[4] (Object getFakeArg(Object[], Class)): target != null
    //#pre[7] (Object getFakeArg(Object[], Class)): this.type != null
    //#pre[1] (Object getFakeArg(Object[], Class)): (soft) args != null
    //#pre[2] (Object getFakeArg(Object[], Class)): (soft) args.length >= 1
    //#pre[3] (Object getFakeArg(Object[], Class)): (soft) init'ed(args[0..4_294_967_295])
    //#pre[6] (Object getFakeArg(Object[], Class)): (soft) this.__Tag in {com/dmdirc/parser/irc/callbacks/CallbackObject, com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific}
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 <= 4_294_967_295
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 <= 4_294_967_295
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 in {1..4_294_967_295}
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 <= 4_294_967_295
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 <= args.length
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 - arr$.length@207 in {0..4_294_967_295}
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@217 <= 4_294_967_295
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@224 <= 4_294_967_295
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@224 <= java.lang.reflect.Constructor:getParameterTypes(...).length@218
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@240 <= 4_294_967_295
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@207 != null
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@207 != null
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@217 != null
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@217 != null
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@224 != null
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@224 != null
    //#presumption(Object getFakeArg(Object[], Class)): arr$[i$]@240 != null
    //#presumption(Object getFakeArg(Object[], Class)): init'ed(java.lang.Boolean.TYPE)
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getConstructors(...)@217 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...).length@207 >= 1
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...).length@210 >= 1
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...)@207 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...)@210 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...)@240 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...)[0]@207 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.Class:getMethods(...)[0]@210 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.annotation.Annotation:annotationType(...)@209 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Constructor:getParameterTypes(...).length@218 >= 1
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Constructor:getParameterTypes(...)@218 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Constructor:getParameterTypes(...)@224 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getName(...)@241 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterAnnotations(...)@207 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...).length@210 >= 1
    //#presumption(Object getFakeArg(Object[], Class)): arr$.length@207 <= java.lang.reflect.Method:getParameterTypes(...).length@210
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...).length@241 >= 1
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...)@210 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...)@241 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...)@241 != null
    //#presumption(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...)[0]@241 != null
    //#post(Object getFakeArg(Object[], Class)): init'ed(return_value)
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.Class:getMethods
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.reflect.Method:getParameterAnnotations
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.annotation.Annotation:annotationType
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.Object:equals
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.reflect.Method:getParameterTypes
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:getFakeArg
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.util.HashMap
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.Class:getConstructors
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.reflect.Constructor:getParameterTypes
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.reflect.Constructor:newInstance
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.reflect.Method:getName
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(Object getFakeArg(Object[], Class)): Effects-of-calling:java.lang.reflect.Method:invoke
    //#test_vector(Object getFakeArg(Object[], Class)): java.lang.Object:equals(...)@209: {0}, {1}
    //#test_vector(Object getFakeArg(Object[], Class)): java.lang.Object:equals(...)@241: {0}, {1}
    //#test_vector(Object getFakeArg(Object[], Class)): java.lang.String:equals(...)@241: {0}, {1}
    //#test_vector(Object getFakeArg(Object[], Class)): java.lang.reflect.Method:getParameterTypes(...).length@241: {0, 2..+Inf}, {1}
    //#test_vector(Object getFakeArg(Object[], Class)): java.util.Map:containsKey(...)@225: {0}, {1}
        int i = 0;

        for (Annotation[] anns : type.getMethods()[0].getParameterAnnotations()) {
            for (Annotation ann : anns) {
                if (ann.annotationType().equals(FakableSource.class)) {
                    sources.put(type.getMethods()[0].getParameterTypes()[i], args[i]);
                }
            }

            i++;
        }

        for (Constructor<?> ctor : target.getConstructors()) {
            Object[] params = new Object[ctor.getParameterTypes().length];

            i = 0;
            Object param;
            boolean failed = false;

            for (Class<?> needed : ctor.getParameterTypes()) {
                if (sources.containsKey(needed)) {
                    params[i] = sources.get(needed);
                } else if ((param = getFakeArg(args, needed)) != null) {
                    params[i] = param;
                } else {
                    failed = true;
                }

                i++;
            }

            if (!failed) {
                try {
                    final Object instance = ctor.newInstance(params);

                    for (Method method : target.getMethods()) {
                        if (method.getName().equals("setFake")
                                && method.getParameterTypes().length == 1
                                && method.getParameterTypes()[0].equals(Boolean.TYPE)) {

                            method.invoke(instance, true);
                        }
                    }

                    return instance;
                } catch (InstantiationException ex) {
                    // Do nothing
                } catch (IllegalAccessException ex) {
                    // Do nothing
                } catch (IllegalArgumentException ex) {
                    // Do nothing
                } catch (InvocationTargetException ex) {
                    // Do nothing
                }
            }
        }

        return null;
    //#CallbackObject.java:262: end of method: Object com.dmdirc.parser.irc.callbacks.CallbackObject.getFakeArg(Object[], Class)
    }

}
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject]
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.add(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.addCallback(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.call([Ljava/lang/Object;)Z
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.callErrorInfo(Lcom/dmdirc/parser/irc/ParserError;)Z
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.createFakeArgs([Ljava/lang/Object;)V
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.del(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.delCallback(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.getLowerName()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.getName()Ljava/lang/String;
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Descendant_Table[com/dmdirc/parser/irc/callbacks/CallbackObject] == &__Dispatch_Table
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.add(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V == &add
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.addCallback(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V == &addCallback
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.call([Ljava/lang/Object;)Z == &call
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.callErrorInfo(Lcom/dmdirc/parser/irc/ParserError;)Z == &callErrorInfo
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.createFakeArgs([Ljava/lang/Object;)V == &createFakeArgs
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.del(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V == &del
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.delCallback(Lcom/dmdirc/parser/irc/callbacks/interfaces/ICallbackInterface;)V == &delCallback
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.getFakeArg([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; == &getFakeArg
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.getLowerName()Ljava/lang/String; == &getLowerName
    //#post(com.dmdirc.parser.irc.callbacks.CallbackObject__static_init): __Dispatch_Table.getName()Ljava/lang/String; == &getName
    //#CallbackObject.java:: end of method: com.dmdirc.parser.irc.callbacks.CallbackObject.com.dmdirc.parser.irc.callbacks.CallbackObject__static_init
    //#CallbackObject.java:: end of class: com.dmdirc.parser.irc.callbacks.CallbackObject
