//# 2 errors, 252 messages
//#
/*
    //#PerformPanel.java:1:1: class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#PerformPanel.java:1:1: method: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__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.addons.ui_swing.dialogs.serversetting;

import com.dmdirc.Server;
import com.dmdirc.actions.Action;
import com.dmdirc.actions.wrappers.PerformWrapper;
import com.dmdirc.addons.ui_swing.UIUtilities;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import net.miginfocom.swing.MigLayout;

/**
 * Perform panel.
 */
public final class PerformPanel extends JPanel implements ActionListener {
    
    /**
     * A version number for this class. It should be changed whenever the class
     * structure is changed (or anything else that would prevent serialized
     * objects being unserialized with the new class).
     */
    private static final long serialVersionUID = 1;
    
    /** Parent server. */
    private final Server server;
    
    /** The action used for server performs. */
    private Action serverAction;
    /** The action used for network performs. */
    private Action networkAction;
    
    /** The server perform string. */
    private String serverPerform;
    /** The network perform string. */
    private String networkPerform;
    
    /** Keeps track of which perform we're editing. */
    private boolean isNetworkPerform;
    
    /** Network/server combo box. */
    private JComboBox target;
    
    /** Perform text area. */
    private JTextArea textarea;
    
    /**
     * Creates a new instance of IgnoreList.
     *
     * @param server Parent server
     */
    public PerformPanel(final Server server) {
        super();
    //#PerformPanel.java:81: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): ")"._tainted
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): "Network perform ("._tainted
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): "Server perform ("._tainted
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): server
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): new JComboBox(initComponents#3) num objects
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): new JTextArea(initComponents#6) num objects
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.isNetworkPerform
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.networkAction
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.networkPerform
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.server
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.serverAction
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.serverPerform
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.target
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.textarea
    //#new obj(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): new JComboBox(initComponents#3)
    //#new obj(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): new JTextArea(initComponents#6)
    //#pre[1] (void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): server != null
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): init'ed(this.isNetworkPerform)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): init'ed(this.networkAction)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.networkPerform != null
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.server == server
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.server != null
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): init'ed(this.serverAction)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.serverPerform != null
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.target == &new JComboBox(initComponents#3)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): this.textarea == &new JTextArea(initComponents#6)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): new JComboBox(initComponents#3) num objects == 1
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): new JTextArea(initComponents#6) num objects == 1
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:setLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.DefaultComboBoxModel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JComboBox
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.Server:getNetwork
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.DefaultComboBoxModel:addElement
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.Server:getName
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:add
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JTextArea
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JTextArea:setColumns
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JScrollPane
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JComboBox:addActionListener
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:java.lang.StringBuilder:length
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:java.lang.StringBuilder:substring
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.actions.wrappers.PerformWrapper:getActionForServer
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.actions.wrappers.PerformWrapper:getActionForNetwork
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:com.dmdirc.actions.Action:getResponse
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JComboBox:getSelectedIndex
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)): Effects-of-calling:javax.swing.JTextArea:setText
        
        this.server = server;
        
        this.setOpaque(UIUtilities.getTabbedPaneOpaque());
    //#PerformPanel.java:85: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.addons.ui_swing.UIUtilities:getTabbedPaneOpaque()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)
    //#    unanalyzed callee: bool com.dmdirc.addons.ui_swing.UIUtilities:getTabbedPaneOpaque()
    //#PerformPanel.java:85: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:setOpaque(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:setOpaque(bool)
        initComponents();
        addListeners();
        loadPerforms();
        populatePerform();
    }
    //#PerformPanel.java:90: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel(Server)
    
    /** Initialises teh components. */
    private void initComponents() {
        setLayout(new MigLayout("fill"));
    //#PerformPanel.java:94: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.initComponents()
    //#PerformPanel.java:94: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
    //#PerformPanel.java:94: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:setLayout(LayoutManager)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:setLayout(LayoutManager)
    //#input(void initComponents()): ")"._tainted
    //#input(void initComponents()): "Network perform ("._tainted
    //#input(void initComponents()): "Server perform ("._tainted
    //#input(void initComponents()): this
    //#input(void initComponents()): this.server
    //#output(void initComponents()): new JComboBox(initComponents#3) num objects
    //#output(void initComponents()): new JTextArea(initComponents#6) num objects
    //#output(void initComponents()): this.target
    //#output(void initComponents()): this.textarea
    //#new obj(void initComponents()): new JComboBox(initComponents#3)
    //#new obj(void initComponents()): new JTextArea(initComponents#6)
    //#pre[2] (void initComponents()): this.server != null
    //#presumption(void initComponents()): com.dmdirc.Server:getName(...)@102 != null
    //#presumption(void initComponents()): com.dmdirc.Server:getNetwork(...)@99 != null
    //#post(void initComponents()): this.target == &new JComboBox(initComponents#3)
    //#post(void initComponents()): this.textarea == &new JTextArea(initComponents#6)
    //#post(void initComponents()): new JComboBox(initComponents#3) num objects == 1
    //#post(void initComponents()): new JTextArea(initComponents#6) num objects == 1
    //#test_vector(void initComponents()): java.lang.String:isEmpty(...)@102: {1}, {0}
    //#test_vector(void initComponents()): java.lang.String:isEmpty(...)@99: {1}, {0}
        
        final DefaultComboBoxModel model = new DefaultComboBoxModel();
        target = new JComboBox(model);
        
        if (!server.getNetwork().isEmpty()) {
    //#PerformPanel.java:99: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getNetwork()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: String com.dmdirc.Server:getNetwork()
            model.addElement("Network perform (" + server.getNetwork() + ")");
    //#PerformPanel.java:100: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getNetwork()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: String com.dmdirc.Server:getNetwork()
        }
        if (!server.getName().isEmpty()) {
    //#PerformPanel.java:102: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: String com.dmdirc.Server:getName()
            model.addElement("Server perform (" + server.getName() + ")");
    //#PerformPanel.java:103: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: String com.dmdirc.Server:getName()
        }
        
        add(target, "growx, pushx, wrap");
    //#PerformPanel.java:106: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:add(Component, Object)
        
        textarea = new JTextArea();
        textarea.setColumns(40);
        
        add(new JScrollPane(textarea), "grow, push");
    //#PerformPanel.java:111: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void initComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel:add(Component, Object)
    }
    //#PerformPanel.java:112: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.initComponents()
    
    /** Adds listeners to the components. */
    private void addListeners() {
        target.addActionListener(this);
    //#PerformPanel.java:116: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.addListeners()
    //#input(void addListeners()): this
    //#input(void addListeners()): this.target
    //#pre[2] (void addListeners()): this.target != null
    }
    //#PerformPanel.java:117: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.addListeners()
    
    /** Loads the perform actions. */
    private void loadPerforms() {
        serverAction = PerformWrapper.getPerformWrapper().getActionForServer(server.getName());
    //#PerformPanel.java:121: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.loadPerforms()
    //#PerformPanel.java:121: Warning: method not available - call not analyzed
    //#    call on PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#PerformPanel.java:121: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: String com.dmdirc.Server:getName()
    //#PerformPanel.java:121: Warning: method not available - call not analyzed
    //#    call on Action com.dmdirc.actions.wrappers.PerformWrapper:getActionForServer(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: Action com.dmdirc.actions.wrappers.PerformWrapper:getActionForServer(String)
    //#input(void loadPerforms()): this
    //#input(void loadPerforms()): this.server
    //#output(void loadPerforms()): this.networkAction
    //#output(void loadPerforms()): this.networkPerform
    //#output(void loadPerforms()): this.serverAction
    //#output(void loadPerforms()): this.serverPerform
    //#pre[2] (void loadPerforms()): this.server != null
    //#presumption(void loadPerforms()): com.dmdirc.actions.Action:getResponse(...).length@127 <= 4_294_967_295
    //#presumption(void loadPerforms()): com.dmdirc.actions.Action:getResponse(...).length@133 <= 4_294_967_295
    //#presumption(void loadPerforms()): com.dmdirc.actions.Action:getResponse(...)@127 != null
    //#presumption(void loadPerforms()): com.dmdirc.actions.Action:getResponse(...)@133 != null
    //#presumption(void loadPerforms()): com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper(...)@121 != null
    //#presumption(void loadPerforms()): com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper(...)@122 != null
    //#post(void loadPerforms()): init'ed(this.networkAction)
    //#post(void loadPerforms()): this.networkPerform != null
    //#post(void loadPerforms()): init'ed(this.serverAction)
    //#post(void loadPerforms()): this.serverPerform != null
    //#unanalyzed(void loadPerforms()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void loadPerforms()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void loadPerforms()): Effects-of-calling:java.lang.StringBuilder:length
    //#unanalyzed(void loadPerforms()): Effects-of-calling:java.lang.StringBuilder:substring
    //#test_vector(void loadPerforms()): com.dmdirc.actions.wrappers.PerformWrapper:getActionForNetwork(...)@122: Inverse{null}, Addr_Set{null}
    //#test_vector(void loadPerforms()): com.dmdirc.actions.wrappers.PerformWrapper:getActionForServer(...)@121: Inverse{null}, Addr_Set{null}
        networkAction = PerformWrapper.getPerformWrapper().getActionForNetwork(server.getNetwork());
    //#PerformPanel.java:122: Warning: method not available - call not analyzed
    //#    call on PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#PerformPanel.java:122: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getNetwork()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: String com.dmdirc.Server:getNetwork()
    //#PerformPanel.java:122: Warning: method not available - call not analyzed
    //#    call on Action com.dmdirc.actions.wrappers.PerformWrapper:getActionForNetwork(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: Action com.dmdirc.actions.wrappers.PerformWrapper:getActionForNetwork(String)
        
        if (serverAction == null) {
            serverPerform = "";
        } else {
            serverPerform = implode(serverAction.getResponse());
    //#PerformPanel.java:127: Warning: method not available - call not analyzed
    //#    call on String[] com.dmdirc.actions.Action:getResponse()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: String[] com.dmdirc.actions.Action:getResponse()
        }
        
        if (networkAction == null) {
            networkPerform = "";
        } else {
            networkPerform = implode(networkAction.getResponse());
    //#PerformPanel.java:133: Warning: method not available - call not analyzed
    //#    call on String[] com.dmdirc.actions.Action:getResponse()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void loadPerforms()
    //#    unanalyzed callee: String[] com.dmdirc.actions.Action:getResponse()
        }
    }
    //#PerformPanel.java:135: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.loadPerforms()
    
    /**
     * Implodes the specified string array, joining each line with a LF.
     *
     * @param lines The lines to be joined together
     * @return A string containing each element of lines, separated by a LF.
     */
    private String implode(final String[] lines) {
        final StringBuilder res = new StringBuilder();
    //#PerformPanel.java:144: method: String com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.implode(String[])
    //#input(String implode(String[])): lines
    //#input(String implode(String[])): lines.length
    //#input(String implode(String[])): lines[0..4_294_967_295]
    //#input(String implode(String[])): lines[0..4_294_967_295]._tainted
    //#output(String implode(String[])): return_value
    //#pre[1] (String implode(String[])): lines != null
    //#pre[2] (String implode(String[])): lines.length <= 4_294_967_295
    //#pre[3] (String implode(String[])): (soft) init'ed(lines[0..4_294_967_295])
    //#post(String implode(String[])): return_value != null
        
        for (String line : lines) {
            res.append('\n');
            res.append(line);
        }
        
        return res.length() == 0 ? "" : res.substring(1);
    //#PerformPanel.java:151: end of method: String com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.implode(String[])
    }
    
    /** Populates the perform text area. */
    private void populatePerform() {
        if (target.getSelectedIndex() == 0) {
    //#PerformPanel.java:156: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.populatePerform()
    //#input(void populatePerform()): this
    //#input(void populatePerform()): this.networkPerform
    //#input(void populatePerform()): this.serverPerform
    //#input(void populatePerform()): this.target
    //#input(void populatePerform()): this.textarea
    //#output(void populatePerform()): this.isNetworkPerform
    //#pre[4] (void populatePerform()): this.target != null
    //#pre[5] (void populatePerform()): this.textarea != null
    //#pre[2] (void populatePerform()): (soft) init'ed(this.networkPerform)
    //#pre[3] (void populatePerform()): (soft) init'ed(this.serverPerform)
    //#post(void populatePerform()): init'ed(this.isNetworkPerform)
    //#test_vector(void populatePerform()): javax.swing.JComboBox:getSelectedIndex(...)@156: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
            isNetworkPerform = true;
            textarea.setText(networkPerform);
        } else {
            isNetworkPerform = false;
            textarea.setText(serverPerform);
        }
    }
    //#PerformPanel.java:163: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.populatePerform()
    
    /** Stores the text currently in the textarea into the perform strings. */
    private void storeText() {
        if (isNetworkPerform) {
    //#PerformPanel.java:167: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.storeText()
    //#input(void storeText()): this
    //#input(void storeText()): this.isNetworkPerform
    //#input(void storeText()): this.textarea
    //#output(void storeText()): this.networkPerform
    //#output(void storeText()): this.serverPerform
    //#pre[4] (void storeText()): init'ed(this.isNetworkPerform)
    //#pre[5] (void storeText()): this.textarea != null
    //#post(void storeText()): possibly_updated(this.networkPerform)
    //#post(void storeText()): possibly_updated(this.serverPerform)
    //#test_vector(void storeText()): this.isNetworkPerform: {0}, {1}
            networkPerform = textarea.getText();
        } else {
            serverPerform = textarea.getText();
        }
    }
    //#PerformPanel.java:172: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.storeText()
    
    /** Saves the performs. */
    public void savePerforms() {
        storeText();
    //#PerformPanel.java:176: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.savePerforms()
    //#input(void savePerforms()): this
    //#input(void savePerforms()): this.isNetworkPerform
    //#input(void savePerforms()): this.networkAction
    //#input(void savePerforms()): this.networkPerform
    //#input(void savePerforms()): this.networkPerform._tainted
    //#input(void savePerforms()): this.server
    //#input(void savePerforms()): this.serverAction
    //#input(void savePerforms()): this.serverPerform
    //#input(void savePerforms()): this.serverPerform._tainted
    //#input(void savePerforms()): this.textarea
    //#output(void savePerforms()): this.networkAction
    //#output(void savePerforms()): this.networkPerform
    //#output(void savePerforms()): this.serverAction
    //#output(void savePerforms()): this.serverPerform
    //#pre[1] (void savePerforms()): init'ed(this.networkAction)
    //#pre[2] (void savePerforms()): init'ed(this.networkPerform)
    //#pre[3] (void savePerforms()): init'ed(this.serverAction)
    //#pre[4] (void savePerforms()): init'ed(this.serverPerform)
    //#pre[6] (void savePerforms()): init'ed(this.isNetworkPerform)
    //#pre[10] (void savePerforms()): this.textarea != null
    //#pre[8] (void savePerforms()): (soft) this.server != null
    //#presumption(void savePerforms()): com.dmdirc.actions.wrappers.PerformWrapper:createActionForNetwork(...)@188 != null
    //#presumption(void savePerforms()): com.dmdirc.actions.wrappers.PerformWrapper:createActionForServer(...)@180 != null
    //#presumption(void savePerforms()): com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper(...)@180 != null
    //#presumption(void savePerforms()): com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper(...)@188 != null
    //#post(void savePerforms()): init'ed(this.networkAction)
    //#post(void savePerforms()): this.networkPerform != null
    //#post(void savePerforms()): init'ed(this.serverAction)
    //#post(void savePerforms()): this.serverPerform != null
    //#unanalyzed(void savePerforms()): Effects-of-calling:javax.swing.JTextArea:getText
    //#test_vector(void savePerforms()): this.networkAction: Addr_Set{null}, Inverse{null}
    //#test_vector(void savePerforms()): this.serverAction: Addr_Set{null}, Inverse{null}
        
        if (!serverPerform.isEmpty() || serverAction != null) {
    //#PerformPanel.java:178: ?null dereference
    //#    this.serverPerform != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    basic block: Entry_BB_1
    //#    assertion: this.serverPerform != null
    //#    VN: this.serverPerform
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
            if (serverAction == null) {
                serverAction = PerformWrapper.getPerformWrapper().createActionForServer(server.getName());
    //#PerformPanel.java:180: Warning: method not available - call not analyzed
    //#    call on PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#PerformPanel.java:180: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: String com.dmdirc.Server:getName()
    //#PerformPanel.java:180: Warning: method not available - call not analyzed
    //#    call on Action com.dmdirc.actions.wrappers.PerformWrapper:createActionForServer(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: Action com.dmdirc.actions.wrappers.PerformWrapper:createActionForServer(String)
            }
            serverAction.setResponse(serverPerform.split("\n"));
    //#PerformPanel.java:182: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.Action:setResponse(String[])
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: void com.dmdirc.actions.Action:setResponse(String[])
            serverAction.save();
    //#PerformPanel.java:183: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.Action:save()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: void com.dmdirc.actions.Action:save()
        }
        
        if (!networkPerform.isEmpty() || networkAction != null) {
    //#PerformPanel.java:186: ?null dereference
    //#    this.networkPerform != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    basic block: bb_6
    //#    assertion: this.networkPerform != null
    //#    VN: this.networkPerform
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
            if (networkAction == null) {
                networkAction = PerformWrapper.getPerformWrapper().createActionForNetwork(server.getNetwork());
    //#PerformPanel.java:188: Warning: method not available - call not analyzed
    //#    call on PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: PerformWrapper com.dmdirc.actions.wrappers.PerformWrapper:getPerformWrapper()
    //#PerformPanel.java:188: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Server:getNetwork()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: String com.dmdirc.Server:getNetwork()
    //#PerformPanel.java:188: Warning: method not available - call not analyzed
    //#    call on Action com.dmdirc.actions.wrappers.PerformWrapper:createActionForNetwork(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: Action com.dmdirc.actions.wrappers.PerformWrapper:createActionForNetwork(String)
            }
            networkAction.setResponse(networkPerform.split("\n"));
    //#PerformPanel.java:190: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.Action:setResponse(String[])
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: void com.dmdirc.actions.Action:setResponse(String[])
            networkAction.save();
    //#PerformPanel.java:191: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.Action:save()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
    //#    method: void savePerforms()
    //#    unanalyzed callee: void com.dmdirc.actions.Action:save()
        }
    }
    //#PerformPanel.java:193: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.savePerforms()
    
    /** {@inheritDoc} */
    public void actionPerformed(final ActionEvent e) {
        storeText();
    //#PerformPanel.java:197: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.actionPerformed(ActionEvent)
    //#input(void actionPerformed(ActionEvent)): this
    //#input(void actionPerformed(ActionEvent)): this.isNetworkPerform
    //#input(void actionPerformed(ActionEvent)): this.networkPerform
    //#input(void actionPerformed(ActionEvent)): this.serverPerform
    //#input(void actionPerformed(ActionEvent)): this.target
    //#input(void actionPerformed(ActionEvent)): this.textarea
    //#output(void actionPerformed(ActionEvent)): this.isNetworkPerform
    //#output(void actionPerformed(ActionEvent)): this.networkPerform
    //#output(void actionPerformed(ActionEvent)): this.serverPerform
    //#pre[1] (void actionPerformed(ActionEvent)): init'ed(this.isNetworkPerform)
    //#pre[5] (void actionPerformed(ActionEvent)): this.target != null
    //#pre[6] (void actionPerformed(ActionEvent)): this.textarea != null
    //#pre[2] (void actionPerformed(ActionEvent)): (soft) init'ed(this.networkPerform)
    //#pre[3] (void actionPerformed(ActionEvent)): (soft) init'ed(this.serverPerform)
    //#post(void actionPerformed(ActionEvent)): init'ed(this.isNetworkPerform)
    //#post(void actionPerformed(ActionEvent)): init'ed(this.networkPerform)
    //#post(void actionPerformed(ActionEvent)): init'ed(this.serverPerform)
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JComboBox:getSelectedIndex
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JTextArea:setText
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JTextArea:getText
        populatePerform();
    }
    //#PerformPanel.java:199: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.actionPerformed(ActionEvent)
    
}
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/serversetting/PerformPanel]
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.addListeners()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.implode([Ljava/lang/String;)Ljava/lang/String;
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.initComponents()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.loadPerforms()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.populatePerform()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.savePerforms()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.storeText()V
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/serversetting/PerformPanel] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V == &actionPerformed
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.addListeners()V == &addListeners
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.implode([Ljava/lang/String;)Ljava/lang/String; == &implode
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.initComponents()V == &initComponents
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.loadPerforms()V == &loadPerforms
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.populatePerform()V == &populatePerform
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.savePerforms()V == &savePerforms
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init): __Dispatch_Table.storeText()V == &storeText
    //#PerformPanel.java:: end of method: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel.com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel__static_init
    //#PerformPanel.java:: end of class: com.dmdirc.addons.ui_swing.dialogs.serversetting.PerformPanel
