//# 3 errors, 353 messages
//#
/*
    //#PerformWrapper.java:1:1: class: com.dmdirc.actions.wrappers.PerformWrapper
 * 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.actions.wrappers;

import com.dmdirc.actions.Action;
import com.dmdirc.actions.interfaces.ActionComponent;
import com.dmdirc.actions.ActionCondition;
import com.dmdirc.actions.ActionGroup;
import com.dmdirc.actions.interfaces.ActionType;
import com.dmdirc.actions.CoreActionComparison;
import com.dmdirc.actions.CoreActionComponent;
import com.dmdirc.actions.CoreActionType;
import com.dmdirc.logger.ErrorLevel;
import com.dmdirc.logger.Logger;

import java.util.ArrayList;
import java.util.List;

/**
 * An action wrapper for performs.
 *
 * @author Chris
 */
public class PerformWrapper extends ActionGroup {
    
    /** A singleton instance of the Perform Wrapper. */
    private static PerformWrapper me = new PerformWrapper();
    //#PerformWrapper.java:47: method: com.dmdirc.actions.wrappers.PerformWrapper.com.dmdirc.actions.wrappers.PerformWrapper__static_init
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.add(Lcom/dmdirc/actions/Action;)V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.clear()V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.contains(Lcom/dmdirc/actions/Action;)Z
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.createAction(Ljava/lang/String;Ljava/lang/String;)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.createActionForNetwork(Ljava/lang/String;)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.createActionForServer(Ljava/lang/String;)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.get(I)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getAction(Lcom/dmdirc/actions/interfaces/ActionComponent;Ljava/lang/String;)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getActionForNetwork(Ljava/lang/String;)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getActionForServer(Ljava/lang/String;)Lcom/dmdirc/actions/Action;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getActions()Ljava/util/List;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getAuthor()Ljava/lang/String;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getComponent()I
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getDescription()Ljava/lang/String;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getName()Ljava/lang/String;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getSettings()Ljava/util/Map;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getVersion()I
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.isDelible()Z
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.iterator()Ljava/util/Iterator;
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.remove(Lcom/dmdirc/actions/Action;)V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setAuthor(Ljava/lang/String;)V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setComponent(I)V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setDescription(Ljava/lang/String;)V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setVersion(I)V
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.size()I
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): com/dmdirc/actions/ActionGroup.__Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new ArrayList(ActionGroup#1) num objects
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new HashMap(ActionGroup#2) num objects
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new PerformWrapper(PerformWrapper__static_init#1) num objects
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.__Tag
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.actions
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.author
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.component
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.description
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.name
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.settings
    //#output(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.version
    //#new obj(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new ArrayList(ActionGroup#1)
    //#new obj(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new HashMap(ActionGroup#2)
    //#new obj(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new PerformWrapper(PerformWrapper__static_init#1)
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper] == &__Dispatch_Table
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): com/dmdirc/actions/ActionGroup.__Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper] == &__Dispatch_Table
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.add(Lcom/dmdirc/actions/Action;)V == &add
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.clear()V == &com/dmdirc/actions/ActionGroup.clear
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.contains(Lcom/dmdirc/actions/Action;)Z == &com/dmdirc/actions/ActionGroup.contains
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.createAction(Ljava/lang/String;Ljava/lang/String;)Lcom/dmdirc/actions/Action; == &createAction
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.createActionForNetwork(Ljava/lang/String;)Lcom/dmdirc/actions/Action; == &createActionForNetwork
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.createActionForServer(Ljava/lang/String;)Lcom/dmdirc/actions/Action; == &createActionForServer
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.get(I)Lcom/dmdirc/actions/Action; == &com/dmdirc/actions/ActionGroup.get
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getAction(Lcom/dmdirc/actions/interfaces/ActionComponent;Ljava/lang/String;)Lcom/dmdirc/actions/Action; == &getAction
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getActionForNetwork(Ljava/lang/String;)Lcom/dmdirc/actions/Action; == &getActionForNetwork
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getActionForServer(Ljava/lang/String;)Lcom/dmdirc/actions/Action; == &getActionForServer
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getActions()Ljava/util/List; == &com/dmdirc/actions/ActionGroup.getActions
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getAuthor()Ljava/lang/String; == &com/dmdirc/actions/ActionGroup.getAuthor
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getComponent()I == &com/dmdirc/actions/ActionGroup.getComponent
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getDescription()Ljava/lang/String; == &getDescription
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getName()Ljava/lang/String; == &com/dmdirc/actions/ActionGroup.getName
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getSettings()Ljava/util/Map; == &com/dmdirc/actions/ActionGroup.getSettings
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.getVersion()I == &com/dmdirc/actions/ActionGroup.getVersion
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.isDelible()Z == &isDelible
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.iterator()Ljava/util/Iterator; == &com/dmdirc/actions/ActionGroup.iterator
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.remove(Lcom/dmdirc/actions/Action;)V == &com/dmdirc/actions/ActionGroup.remove
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setAuthor(Ljava/lang/String;)V == &com/dmdirc/actions/ActionGroup.setAuthor
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setComponent(I)V == &com/dmdirc/actions/ActionGroup.setComponent
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setDescription(Ljava/lang/String;)V == &com/dmdirc/actions/ActionGroup.setDescription
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.setVersion(I)V == &com/dmdirc/actions/ActionGroup.setVersion
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): __Dispatch_Table.size()I == &com/dmdirc/actions/ActionGroup.size
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me == &new PerformWrapper(PerformWrapper__static_init#1)
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new ArrayList(ActionGroup#1) num objects == 1
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new HashMap(ActionGroup#2) num objects == 1
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): new PerformWrapper(PerformWrapper__static_init#1) num objects == 1
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.actions == &new ArrayList(ActionGroup#1)
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.author == null
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.description == null
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.component == -1
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.version == -1
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.name == &"performs"
    //#post(com.dmdirc.actions.wrappers.PerformWrapper__static_init): me.settings == &new HashMap(ActionGroup#2)
    //#unanalyzed(com.dmdirc.actions.wrappers.PerformWrapper__static_init): Effects-of-calling:com.dmdirc.actions.ActionGroup
    //#unanalyzed(com.dmdirc.actions.wrappers.PerformWrapper__static_init): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(com.dmdirc.actions.wrappers.PerformWrapper__static_init): Effects-of-calling:java.util.HashMap
    //#PerformWrapper.java:47: end of method: com.dmdirc.actions.wrappers.PerformWrapper.com.dmdirc.actions.wrappers.PerformWrapper__static_init
    
    /**
     * Creates a new instance of PerformWrapper.
     */
    private PerformWrapper() {
        super("performs");
    //#PerformWrapper.java:53: method: void com.dmdirc.actions.wrappers.PerformWrapper.com.dmdirc.actions.wrappers.PerformWrapper()
    //#input(void com.dmdirc.actions.wrappers.PerformWrapper()): this
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): new ArrayList(ActionGroup#1) num objects
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): new HashMap(ActionGroup#2) num objects
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.actions
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.author
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.component
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.description
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.name
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.settings
    //#output(void com.dmdirc.actions.wrappers.PerformWrapper()): this.version
    //#new obj(void com.dmdirc.actions.wrappers.PerformWrapper()): new ArrayList(ActionGroup#1)
    //#new obj(void com.dmdirc.actions.wrappers.PerformWrapper()): new HashMap(ActionGroup#2)
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.actions == &new ArrayList(ActionGroup#1)
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.author == null
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.description == null
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.component == -1
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.version == -1
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.name == &"performs"
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): this.settings == &new HashMap(ActionGroup#2)
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): new ArrayList(ActionGroup#1) num objects == 1
    //#post(void com.dmdirc.actions.wrappers.PerformWrapper()): new HashMap(ActionGroup#2) num objects == 1
    //#unanalyzed(void com.dmdirc.actions.wrappers.PerformWrapper()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void com.dmdirc.actions.wrappers.PerformWrapper()): Effects-of-calling:java.util.HashMap
    }
    //#PerformWrapper.java:54: end of method: void com.dmdirc.actions.wrappers.PerformWrapper.com.dmdirc.actions.wrappers.PerformWrapper()
    
    /**
     * Retrieves a singleton instance of this perform wrapper.
     *
     * @return A singleton instance of PerformWrapper
     */
    public static PerformWrapper getPerformWrapper() {
        return me;
    //#PerformWrapper.java:62: method: PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper.getPerformWrapper()
    //#input(PerformWrapper getPerformWrapper()): me
    //#output(PerformWrapper getPerformWrapper()): return_value
    //#pre[1] (PerformWrapper getPerformWrapper()): init'ed(me)
    //#post(PerformWrapper getPerformWrapper()): return_value == me
    //#post(PerformWrapper getPerformWrapper()): init'ed(return_value)
    //#PerformWrapper.java:62: end of method: PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper.getPerformWrapper()
    }
    
    /** {@inheritDoc} */
    @Override
    public void add(final Action action) {
        if (action.getTriggers().length == 1
    //#PerformWrapper.java:68: method: void com.dmdirc.actions.wrappers.PerformWrapper.add(Action)
    //#PerformWrapper.java:68: ?use of default init
    //#    init'ed(getTriggers(...).length)
    //#    severity: LOW
    //#    class: com.dmdirc.actions.wrappers.PerformWrapper
    //#    method: void add(Action)
    //#    basic block: Entry_BB_1
    //#    assertion: init'ed(getTriggers(...).length)
    //#    VN: getTriggers(...).length
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#PerformWrapper.java:68: ?use of default init
    //#    init'ed(getTriggers(...).length)
    //#    severity: LOW
    //#    class: com.dmdirc.actions.wrappers.PerformWrapper
    //#    method: void add(Action)
    //#    basic block: bb_2
    //#    assertion: init'ed(getTriggers(...).length)
    //#    VN: getTriggers(...).length
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#PerformWrapper.java:68: ?use of default init
    //#    init'ed(getTriggers(...)[0])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.actions.wrappers.PerformWrapper
    //#    method: void add(Action)
    //#    basic block: bb_2
    //#    assertion: init'ed(getTriggers(...)[0])
    //#    VN: getTriggers(...)[0]
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
    //#input(void add(Action)): "Invalid perform action: "._tainted
    //#input(void add(Action)): action
    //#input(void add(Action)): action.__Tag
    //#input(void add(Action)): action.conditions
    //#input(void add(Action)): action.name
    //#input(void add(Action)): action.name._tainted
    //#input(void add(Action)): action.triggers
    //#input(void add(Action)): action.triggers.length
    //#input(void add(Action)): action.triggers[0]
    //#input(void add(Action)): action.triggers[1..+Inf]
    //#input(void add(Action)): com.dmdirc.logger.ErrorLevel.MEDIUM
    //#input(void add(Action)): com/dmdirc/actions/Action.__Descendant_Table[com/dmdirc/actions/Action]
    //#input(void add(Action)): com/dmdirc/actions/Action.__Descendant_Table[others]
    //#input(void add(Action)): com/dmdirc/actions/Action.__Dispatch_Table.getConditions()Ljava/util/List;
    //#input(void add(Action)): com/dmdirc/actions/Action.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void add(Action)): com/dmdirc/actions/Action.__Dispatch_Table.getTriggers()[Lcom/dmdirc/actions/interfaces/ActionType;
    //#input(void add(Action)): com/dmdirc/actions/ActionCondition.__Descendant_Table[com/dmdirc/actions/ActionCondition]
    //#input(void add(Action)): com/dmdirc/actions/ActionCondition.__Descendant_Table[others]
    //#input(void add(Action)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getComponent()Lcom/dmdirc/actions/interfaces/ActionComponent;
    //#input(void add(Action)): com/dmdirc/actions/CoreActionComponent.SERVER_NAME
    //#input(void add(Action)): com/dmdirc/actions/CoreActionComponent.SERVER_NETWORK
    //#input(void add(Action)): com/dmdirc/actions/CoreActionType.SERVER_CONNECTED
    //#input(void add(Action)): this
    //#input(void add(Action)): this.actions
    //#pre[1] (void add(Action)): action != null
    //#pre[2] (void add(Action)): action.__Tag == com/dmdirc/actions/Action
    //#pre[6] (void add(Action)): action.triggers != null
    //#pre[3] (void add(Action)): (soft) action.conditions != null
    //#pre[4] (void add(Action)): (soft) init'ed(action.name)
    //#pre[8] (void add(Action)): (soft) init'ed(action.triggers[0])
    //#pre[9] (void add(Action)): (soft) init'ed(action.triggers[1..+Inf])
    //#pre[11] (void add(Action)): (soft) this.actions != null
    //#presumption(void add(Action)): init'ed(com.dmdirc.logger.ErrorLevel.MEDIUM)
    //#presumption(void add(Action)): java.util.List:get(...).__Tag@68 == com/dmdirc/actions/ActionCondition
    //#presumption(void add(Action)): java.util.List:get(...).__Tag@68 == com/dmdirc/actions/ActionCondition
    //#presumption(void add(Action)): java.util.List:get(...)@68 != null
    //#presumption(void add(Action)): java.util.List:get(...)@68 != null
    //#unanalyzed(void add(Action)): Effects-of-calling:java.util.List:add
    //#test_vector(void add(Action)): action.triggers.length: {0, 2..+Inf}, {1}
    //#test_vector(void add(Action)): java.util.List:get(...).component@68: Addr_Set{&com.dmdirc.actions.CoreActionComponent__static_init.new CoreActionComponent$2(CoreActionComponent__static_init#2)}, Inverse{&com.dmdirc.actions.CoreActionComponent__static_init.new CoreActionComponent$2(CoreActionComponent__static_init#2)}
    //#test_vector(void add(Action)): java.util.List:get(...).component@68: Inverse{&com.dmdirc.actions.CoreActionComponent__static_init.new CoreActionComponent$1(CoreActionComponent__static_init#1)}, Addr_Set{&com.dmdirc.actions.CoreActionComponent__static_init.new CoreActionComponent$1(CoreActionComponent__static_init#1)}
    //#test_vector(void add(Action)): java.util.List:size(...)@68: {-2_147_483_648..0, 2..4_294_967_295}, {1}
                && action.getTriggers()[0] == CoreActionType.SERVER_CONNECTED
                && action.getConditions().size() == 1
                && (action.getConditions().get(0).getComponent() == CoreActionComponent.SERVER_NETWORK
                || action.getConditions().get(0).getComponent() == CoreActionComponent.SERVER_NAME)) {
            super.add(action);
        } else {
            Logger.userError(ErrorLevel.MEDIUM, "Invalid perform action: " + action.getName());
    //#PerformWrapper.java:75: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.logger.Logger:userError(ErrorLevel, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.actions.wrappers.PerformWrapper
    //#    method: void add(Action)
    //#    unanalyzed callee: void com.dmdirc.logger.Logger:userError(ErrorLevel, String)
        }
    }
    //#PerformWrapper.java:77: end of method: void com.dmdirc.actions.wrappers.PerformWrapper.add(Action)
    
    /**
     * Retrieve the action that handles the perform for the specified server,
     * or null if no such action exists.
     *
     * @param server The server to look for
     * @return The action that handles the server's perform, or null
     */
    public Action getActionForServer(final String server) {
        return getAction(CoreActionComponent.SERVER_NAME, server);
    //#PerformWrapper.java:87: method: Action com.dmdirc.actions.wrappers.PerformWrapper.getActionForServer(String)
    //#input(Action getActionForServer(String)): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#input(Action getActionForServer(String)): __Descendant_Table[others]
    //#input(Action getActionForServer(String)): __Dispatch_Table.iterator()Ljava/util/Iterator;
    //#input(Action getActionForServer(String)): com/dmdirc/actions/Action.__Descendant_Table[com/dmdirc/actions/Action]
    //#input(Action getActionForServer(String)): com/dmdirc/actions/Action.__Descendant_Table[others]
    //#input(Action getActionForServer(String)): com/dmdirc/actions/Action.__Dispatch_Table.getConditions()Ljava/util/List;
    //#input(Action getActionForServer(String)): com/dmdirc/actions/ActionCondition.__Descendant_Table[com/dmdirc/actions/ActionCondition]
    //#input(Action getActionForServer(String)): com/dmdirc/actions/ActionCondition.__Descendant_Table[others]
    //#input(Action getActionForServer(String)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getComponent()Lcom/dmdirc/actions/interfaces/ActionComponent;
    //#input(Action getActionForServer(String)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getTarget()Ljava/lang/String;
    //#input(Action getActionForServer(String)): com/dmdirc/actions/CoreActionComponent.SERVER_NAME
    //#input(Action getActionForServer(String)): server
    //#input(Action getActionForServer(String)): this
    //#input(Action getActionForServer(String)): this.__Tag
    //#input(Action getActionForServer(String)): this.actions
    //#output(Action getActionForServer(String)): return_value
    //#pre[3] (Action getActionForServer(String)): this.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#pre[4] (Action getActionForServer(String)): this.actions != null
    //#post(Action getActionForServer(String)): init'ed(return_value)
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:iterator
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:getConditions
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:java.util.List:get
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:java.lang.String:equalsIgnoreCase
    //#unanalyzed(Action getActionForServer(String)): Effects-of-calling:java.util.List:iterator
    //#PerformWrapper.java:87: end of method: Action com.dmdirc.actions.wrappers.PerformWrapper.getActionForServer(String)
    }

    /**
     * Retrieve the action that handles the perform for the specified network,
     * or null if no such action exists.
     *
     * @param network The network to look for
     * @return The action that handles the network's perform, or null
     */    
    public Action getActionForNetwork(final String network) {
        return getAction(CoreActionComponent.SERVER_NETWORK, network);
    //#PerformWrapper.java:98: method: Action com.dmdirc.actions.wrappers.PerformWrapper.getActionForNetwork(String)
    //#input(Action getActionForNetwork(String)): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#input(Action getActionForNetwork(String)): __Descendant_Table[others]
    //#input(Action getActionForNetwork(String)): __Dispatch_Table.iterator()Ljava/util/Iterator;
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/Action.__Descendant_Table[com/dmdirc/actions/Action]
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/Action.__Descendant_Table[others]
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/Action.__Dispatch_Table.getConditions()Ljava/util/List;
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/ActionCondition.__Descendant_Table[com/dmdirc/actions/ActionCondition]
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/ActionCondition.__Descendant_Table[others]
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getComponent()Lcom/dmdirc/actions/interfaces/ActionComponent;
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getTarget()Ljava/lang/String;
    //#input(Action getActionForNetwork(String)): com/dmdirc/actions/CoreActionComponent.SERVER_NETWORK
    //#input(Action getActionForNetwork(String)): network
    //#input(Action getActionForNetwork(String)): this
    //#input(Action getActionForNetwork(String)): this.__Tag
    //#input(Action getActionForNetwork(String)): this.actions
    //#output(Action getActionForNetwork(String)): return_value
    //#pre[3] (Action getActionForNetwork(String)): this.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#pre[4] (Action getActionForNetwork(String)): this.actions != null
    //#post(Action getActionForNetwork(String)): init'ed(return_value)
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:iterator
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:getConditions
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:java.util.List:get
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:java.lang.String:equalsIgnoreCase
    //#unanalyzed(Action getActionForNetwork(String)): Effects-of-calling:java.util.List:iterator
    //#PerformWrapper.java:98: end of method: Action com.dmdirc.actions.wrappers.PerformWrapper.getActionForNetwork(String)
    }
    
    /**
     * Creates a new, empty, perform wrapper for the specified server.
     * 
     * @param server The server to create the action for
     * @return The new perform wrapper action
     */
    public Action createActionForServer(final String server) {
        return createAction(server, "");
    //#PerformWrapper.java:108: method: Action com.dmdirc.actions.wrappers.PerformWrapper.createActionForServer(String)
    //#input(Action createActionForServer(String)): ""._tainted
    //#input(Action createActionForServer(String)): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#input(Action createActionForServer(String)): __Descendant_Table[others]
    //#input(Action createActionForServer(String)): __Dispatch_Table.getName()Ljava/lang/String;
    //#input(Action createActionForServer(String)): com/dmdirc/actions/CoreActionComparison.STRING_EQUALS
    //#input(Action createActionForServer(String)): com/dmdirc/actions/CoreActionComponent.SERVER_NAME
    //#input(Action createActionForServer(String)): com/dmdirc/actions/CoreActionComponent.SERVER_NETWORK
    //#input(Action createActionForServer(String)): com/dmdirc/actions/CoreActionType.SERVER_CONNECTED
    //#input(Action createActionForServer(String)): server
    //#input(Action createActionForServer(String)): server._tainted
    //#input(Action createActionForServer(String)): this
    //#input(Action createActionForServer(String)): this.__Tag
    //#input(Action createActionForServer(String)): this.name
    //#output(Action createActionForServer(String)): new Action(createAction#4) num objects
    //#output(Action createActionForServer(String)): new Action(createAction#4).__Tag
    //#output(Action createActionForServer(String)): return_value
    //#new obj(Action createActionForServer(String)): new Action(createAction#4)
    //#pre[1] (Action createActionForServer(String)): server != null
    //#pre[4] (Action createActionForServer(String)): this.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#post(Action createActionForServer(String)): return_value == &new Action(createAction#4)
    //#post(Action createActionForServer(String)): new Action(createAction#4) num objects == 1
    //#post(Action createActionForServer(String)): new Action(createAction#4).__Tag == com/dmdirc/actions/Action
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:java.util.List:add
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:getName
    //#unanalyzed(Action createActionForServer(String)): Effects-of-calling:com.dmdirc.actions.Action
    //#PerformWrapper.java:108: end of method: Action com.dmdirc.actions.wrappers.PerformWrapper.createActionForServer(String)
    }

    /**
     * Creates a new, empty, perform wrapper for the specified network.
     * 
     * @param network The network to create the action for
     * @return The new perform wrapper action
     */    
    public Action createActionForNetwork(final String network) {
        return createAction("", network);
    //#PerformWrapper.java:118: method: Action com.dmdirc.actions.wrappers.PerformWrapper.createActionForNetwork(String)
    //#input(Action createActionForNetwork(String)): ""._tainted
    //#input(Action createActionForNetwork(String)): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#input(Action createActionForNetwork(String)): __Descendant_Table[others]
    //#input(Action createActionForNetwork(String)): __Dispatch_Table.getName()Ljava/lang/String;
    //#input(Action createActionForNetwork(String)): com/dmdirc/actions/CoreActionComparison.STRING_EQUALS
    //#input(Action createActionForNetwork(String)): com/dmdirc/actions/CoreActionComponent.SERVER_NAME
    //#input(Action createActionForNetwork(String)): com/dmdirc/actions/CoreActionComponent.SERVER_NETWORK
    //#input(Action createActionForNetwork(String)): com/dmdirc/actions/CoreActionType.SERVER_CONNECTED
    //#input(Action createActionForNetwork(String)): network
    //#input(Action createActionForNetwork(String)): network._tainted
    //#input(Action createActionForNetwork(String)): this
    //#input(Action createActionForNetwork(String)): this.__Tag
    //#input(Action createActionForNetwork(String)): this.name
    //#output(Action createActionForNetwork(String)): new Action(createAction#4) num objects
    //#output(Action createActionForNetwork(String)): new Action(createAction#4).__Tag
    //#output(Action createActionForNetwork(String)): return_value
    //#new obj(Action createActionForNetwork(String)): new Action(createAction#4)
    //#pre[4] (Action createActionForNetwork(String)): this.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#post(Action createActionForNetwork(String)): return_value == &new Action(createAction#4)
    //#post(Action createActionForNetwork(String)): new Action(createAction#4) num objects == 1
    //#post(Action createActionForNetwork(String)): new Action(createAction#4).__Tag == com/dmdirc/actions/Action
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:java.util.List:add
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:getName
    //#unanalyzed(Action createActionForNetwork(String)): Effects-of-calling:com.dmdirc.actions.Action
    //#PerformWrapper.java:118: end of method: Action com.dmdirc.actions.wrappers.PerformWrapper.createActionForNetwork(String)
    }
    
    /**
     * Creates a new, empty, perform wrapper for the specified server or
     * network. Note that both server and network must be specified, and
     * exactly one of them must be empty.
     * 
     * @param server The server to create the action for
     * @param network The network to create the action for
     * @return The new perform wrapper action
     */    
    private Action createAction(final String server, final String network) {
        final List<ActionCondition> conditions = new ArrayList<ActionCondition>();
    //#PerformWrapper.java:131: method: Action com.dmdirc.actions.wrappers.PerformWrapper.createAction(String, String)
    //#input(Action createAction(String, String)): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#input(Action createAction(String, String)): __Descendant_Table[others]
    //#input(Action createAction(String, String)): __Dispatch_Table.getName()Ljava/lang/String;
    //#input(Action createAction(String, String)): com/dmdirc/actions/CoreActionComparison.STRING_EQUALS
    //#input(Action createAction(String, String)): com/dmdirc/actions/CoreActionComponent.SERVER_NAME
    //#input(Action createAction(String, String)): com/dmdirc/actions/CoreActionComponent.SERVER_NETWORK
    //#input(Action createAction(String, String)): com/dmdirc/actions/CoreActionType.SERVER_CONNECTED
    //#input(Action createAction(String, String)): network
    //#input(Action createAction(String, String)): network._tainted
    //#input(Action createAction(String, String)): server
    //#input(Action createAction(String, String)): server._tainted
    //#input(Action createAction(String, String)): this
    //#input(Action createAction(String, String)): this.__Tag
    //#input(Action createAction(String, String)): this.name
    //#output(Action createAction(String, String)): new Action(createAction#4) num objects
    //#output(Action createAction(String, String)): return_value.__Tag
    //#output(Action createAction(String, String)): return_value
    //#new obj(Action createAction(String, String)): new Action(createAction#4)
    //#pre[3] (Action createAction(String, String)): server != null
    //#pre[7] (Action createAction(String, String)): this.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#post(Action createAction(String, String)): return_value == &new Action(createAction#4)
    //#post(Action createAction(String, String)): new Action(createAction#4) num objects == 1
    //#post(Action createAction(String, String)): return_value.__Tag == com/dmdirc/actions/Action
        final CoreActionComponent component =
                server.isEmpty() ? CoreActionComponent.SERVER_NETWORK
                : CoreActionComponent.SERVER_NAME;
        
        conditions.add(new ActionCondition(0, component, 
                CoreActionComparison.STRING_EQUALS, server + network));
        
        return new Action(getName(), server + network,
    //#PerformWrapper.java:139: Warning: call too complex - analysis skipped
    //#    call on void com.dmdirc.actions.Action(String, String, ActionType[], String[], List, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.actions.wrappers.PerformWrapper
    //#    method: Action createAction(String, String)
    //#    unanalyzed callee: void com.dmdirc.actions.Action(String, String, ActionType[], String[], List, String)
    //#PerformWrapper.java:139: end of method: Action com.dmdirc.actions.wrappers.PerformWrapper.createAction(String, String)
                new ActionType[]{CoreActionType.SERVER_CONNECTED},
                new String[0], conditions, null);
    }
    
    /**
     * Retrieve an action with a condition that checks the specified component,
     * and matches it against the specified target.
     *
     * @param component The action component to look for
     * @param target The string the component is matched against
     * @return The matching action if one exists, or null
     */    
    private Action getAction(final ActionComponent component, final String target) {
        for (Action action : this) {
    //#PerformWrapper.java:153: method: Action com.dmdirc.actions.wrappers.PerformWrapper.getAction(ActionComponent, String)
    //#input(Action getAction(ActionComponent, String)): __Descendant_Table[com/dmdirc/actions/wrappers/PerformWrapper]
    //#input(Action getAction(ActionComponent, String)): __Descendant_Table[others]
    //#input(Action getAction(ActionComponent, String)): __Dispatch_Table.iterator()Ljava/util/Iterator;
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/Action.__Descendant_Table[com/dmdirc/actions/Action]
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/Action.__Descendant_Table[others]
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/Action.__Dispatch_Table.getConditions()Ljava/util/List;
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/ActionCondition.__Descendant_Table[com/dmdirc/actions/ActionCondition]
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/ActionCondition.__Descendant_Table[others]
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getComponent()Lcom/dmdirc/actions/interfaces/ActionComponent;
    //#input(Action getAction(ActionComponent, String)): com/dmdirc/actions/ActionCondition.__Dispatch_Table.getTarget()Ljava/lang/String;
    //#input(Action getAction(ActionComponent, String)): component
    //#input(Action getAction(ActionComponent, String)): target
    //#input(Action getAction(ActionComponent, String)): this
    //#input(Action getAction(ActionComponent, String)): this.__Tag
    //#input(Action getAction(ActionComponent, String)): this.actions
    //#output(Action getAction(ActionComponent, String)): return_value
    //#pre[4] (Action getAction(ActionComponent, String)): this.__Tag == com/dmdirc/actions/wrappers/PerformWrapper
    //#pre[5] (Action getAction(ActionComponent, String)): this.actions != null
    //#presumption(Action getAction(ActionComponent, String)): action.conditions@153 != null
    //#presumption(Action getAction(ActionComponent, String)): java.util.Iterator:next(...).__Tag@153 == com/dmdirc/actions/Action
    //#presumption(Action getAction(ActionComponent, String)): java.util.Iterator:next(...)@153 != null
    //#presumption(Action getAction(ActionComponent, String)): java.util.List:get(...).__Tag@154 == com/dmdirc/actions/ActionCondition
    //#presumption(Action getAction(ActionComponent, String)): java.util.List:get(...).__Tag@154 == com/dmdirc/actions/ActionCondition
    //#presumption(Action getAction(ActionComponent, String)): java.util.List:get(...).target@154 != null
    //#presumption(Action getAction(ActionComponent, String)): java.util.List:get(...)@154 != null
    //#presumption(Action getAction(ActionComponent, String)): java.util.List:get(...)@154 != null
    //#post(Action getAction(ActionComponent, String)): init'ed(return_value)
    //#unanalyzed(Action getAction(ActionComponent, String)): Effects-of-calling:java.util.List:iterator
    //#test_vector(Action getAction(ActionComponent, String)): java.lang.String:equalsIgnoreCase(...)@154: {0}, {1}
    //#test_vector(Action getAction(ActionComponent, String)): java.util.Iterator:hasNext(...)@153: {0}, {1}
            if (action.getConditions().get(0).getComponent() == component
                    && action.getConditions().get(0).getTarget().equalsIgnoreCase(target)) {
                return action;
            }
        }
        
        return null;
    //#PerformWrapper.java:160: end of method: Action com.dmdirc.actions.wrappers.PerformWrapper.getAction(ActionComponent, String)
    }
    
    /** {@inheritDoc} */
    @Override
    public boolean isDelible() {
        return false;
    //#PerformWrapper.java:166: method: bool com.dmdirc.actions.wrappers.PerformWrapper.isDelible()
    //#output(bool isDelible()): return_value
    //#post(bool isDelible()): return_value == 0
    //#PerformWrapper.java:166: end of method: bool com.dmdirc.actions.wrappers.PerformWrapper.isDelible()
    }
    
    /** {@inheritDoc} */
    @Override
    public String getDescription() {
        return "Performs allow you to automatically execute commands when"
    //#PerformWrapper.java:172: method: String com.dmdirc.actions.wrappers.PerformWrapper.getDescription()
    //#output(String getDescription()): return_value
    //#post(String getDescription()): return_value == &"Performs allow you to automatically execute commands when you connect  ... ver Settings" dialog, which can be accessed through the Settings menu."
    //#PerformWrapper.java:172: end of method: String com.dmdirc.actions.wrappers.PerformWrapper.getDescription()
                + " you connect to a specific server or network. You can edit"
                + " the perform for the current server or network in the "
                + "\"Server Settings\" dialog, which can be accessed through "
                + "the Settings menu.";
    }
    
}
    //#PerformWrapper.java:: end of class: com.dmdirc.actions.wrappers.PerformWrapper
