//# 0 errors, 292 messages
//#
/*
    //#PopupManager.java:1:1: class: com.dmdirc.commandparser.PopupManager
    //#PopupManager.java:1:1: method: com.dmdirc.commandparser.PopupManager.com.dmdirc.commandparser.PopupManager__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.commandparser;

import com.dmdirc.actions.ActionManager;
import com.dmdirc.actions.CoreActionType;
import com.dmdirc.config.ConfigManager;


/**
 * The popup manager manages which commands should be present in popup menus.
 *
 * @author Chris
 */
public class PopupManager {
    
    /**
     * Creates a new instance of PopupManager.
     */
    private PopupManager() {
    //#PopupManager.java:40: method: void com.dmdirc.commandparser.PopupManager.com.dmdirc.commandparser.PopupManager()
        // Shouldn't be instansiated.
    }
    //#PopupManager.java:42: end of method: void com.dmdirc.commandparser.PopupManager.com.dmdirc.commandparser.PopupManager()
    
    /**
     * Returns the popup menu that should be used for the specified type.
     * Configuration data is read from the specified config manager.
     * 
     * @param menuType The type of the menu that is needed
     * @param configManager The config manager to be used for the menu
     * @return The PopupMenu that should be displayed
     */
    public static PopupMenu getMenu(final PopupType menuType, final ConfigManager configManager) {
        final PopupMenu menu = getMenu(menuType.toString(), configManager);
    //#PopupManager.java:53: method: PopupMenu com.dmdirc.commandparser.PopupManager.getMenu(PopupType, ConfigManager)
    //#PopupManager.java:53: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.commandparser.PopupType:toString()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.commandparser.PopupManager
    //#    method: PopupMenu getMenu(PopupType, ConfigManager)
    //#    unanalyzed callee: String com.dmdirc.commandparser.PopupType:toString()
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): "."._tainted
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): "Config option not found: "._tainted
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): "Invalid popup menu item: "._tainted
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): "popups"._tainted
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com.dmdirc.actions.CoreActionType.CLIENT_POPUP_GENERATED
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Descendant_Table[com/dmdirc/commandparser/PopupMenu]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Descendant_Table[others]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.add(Lcom/dmdirc/commandparser/PopupMenuItem;)V
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.addAll(Ljava/util/Collection;)V
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.getItems()Ljava/util/List;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.__Descendant_Table[others]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigManager.stats
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/ConfigSource]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[others]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/Identity.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/Identity.__Descendant_Table[others]
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): configManager
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): configManager.__Tag
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): configManager.file
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): configManager.sources
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): menuType
    //#input(PopupMenu getMenu(PopupType, ConfigManager)): menuType._tainted
    //#output(PopupMenu getMenu(PopupType, ConfigManager)): new ArrayList(PopupMenu#1) num objects
    //#output(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*) num objects
    //#output(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*).__Tag
    //#output(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*).items
    //#output(PopupMenu getMenu(PopupType, ConfigManager)): return_value
    //#new obj(PopupMenu getMenu(PopupType, ConfigManager)): new ArrayList(PopupMenu#1)
    //#new obj(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*)
    //#pre[1] (PopupMenu getMenu(PopupType, ConfigManager)): configManager != null
    //#pre[3] (PopupMenu getMenu(PopupType, ConfigManager)): configManager.__Tag == com/dmdirc/config/ConfigManager
    //#pre[7] (PopupMenu getMenu(PopupType, ConfigManager)): menuType != null
    //#presumption(PopupMenu getMenu(PopupType, ConfigManager)): init'ed(com.dmdirc.actions.CoreActionType.CLIENT_POPUP_GENERATED)
    //#post(PopupMenu getMenu(PopupType, ConfigManager)): return_value == &new PopupMenu(getMenu#1*)
    //#post(PopupMenu getMenu(PopupType, ConfigManager)): new ArrayList(PopupMenu#1) num objects == 1
    //#post(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*) num objects == 1
    //#post(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*).__Tag == com/dmdirc/commandparser/PopupMenu
    //#post(PopupMenu getMenu(PopupType, ConfigManager)): new PopupMenu(getMenu#1*).items == &new ArrayList(PopupMenu#1)
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.IllegalArgumentException
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:charAt
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:getMenu
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:hasOption
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.Integer:intValue
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.Integer:valueOf
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:getOption
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.List:add
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:com.dmdirc.util.ConfigFile:getKeyDomain
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:com.dmdirc.util.ConfigFile:isKeyDomain
    //#unanalyzed(PopupMenu getMenu(PopupType, ConfigManager)): Effects-of-calling:java.util.List:addAll
        
        ActionManager.processEvent(CoreActionType.CLIENT_POPUP_GENERATED, 
    //#PopupManager.java:55: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.actions.ActionManager:processEvent(ActionType, StringBuffer, Object[])
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.commandparser.PopupManager
    //#    method: PopupMenu getMenu(PopupType, ConfigManager)
    //#    unanalyzed callee: void com.dmdirc.actions.ActionManager:processEvent(ActionType, StringBuffer, Object[])
                null, menuType, menu, configManager);
        
        return menu;
    //#PopupManager.java:58: end of method: PopupMenu com.dmdirc.commandparser.PopupManager.getMenu(PopupType, ConfigManager)
    }
    
    /**
     * Retrieves the menu with the specified name.
     * 
     * @param menuName The name of the menu to read
     * @param configManager The config manager to be used for the menu
     * @return The PopupMenu with the specified name
     */
    private static PopupMenu getMenu(final String menuName, final ConfigManager configManager) {
        final PopupMenu res = new PopupMenu();
    //#PopupManager.java:69: method: PopupMenu com.dmdirc.commandparser.PopupManager.getMenu(String, ConfigManager)
    //#input(PopupMenu getMenu(String, ConfigManager)): "."._tainted
    //#input(PopupMenu getMenu(String, ConfigManager)): "Config option not found: "._tainted
    //#input(PopupMenu getMenu(String, ConfigManager)): "Invalid popup menu item: "._tainted
    //#input(PopupMenu getMenu(String, ConfigManager)): "popups"._tainted
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Descendant_Table[com/dmdirc/commandparser/PopupMenu]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Descendant_Table[others]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.add(Lcom/dmdirc/commandparser/PopupMenuItem;)V
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.addAll(Ljava/util/Collection;)V
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.getItems()Ljava/util/List;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Descendant_Table[others]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigManager.stats
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/ConfigSource]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[others]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/Identity.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/Identity.__Descendant_Table[others]
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenu getMenu(String, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenu getMenu(String, ConfigManager)): configManager
    //#input(PopupMenu getMenu(String, ConfigManager)): configManager.__Tag
    //#input(PopupMenu getMenu(String, ConfigManager)): configManager.file
    //#input(PopupMenu getMenu(String, ConfigManager)): configManager.sources
    //#input(PopupMenu getMenu(String, ConfigManager)): menuName
    //#input(PopupMenu getMenu(String, ConfigManager)): menuName._tainted
    //#output(PopupMenu getMenu(String, ConfigManager)): new ArrayList(PopupMenu#1) num objects
    //#output(PopupMenu getMenu(String, ConfigManager)): new PopupMenu(getMenu#1) num objects
    //#output(PopupMenu getMenu(String, ConfigManager)): return_value.__Tag
    //#output(PopupMenu getMenu(String, ConfigManager)): return_value.items
    //#output(PopupMenu getMenu(String, ConfigManager)): return_value
    //#new obj(PopupMenu getMenu(String, ConfigManager)): new ArrayList(PopupMenu#1)
    //#new obj(PopupMenu getMenu(String, ConfigManager)): new PopupMenu(getMenu#1)
    //#pre[1] (PopupMenu getMenu(String, ConfigManager)): configManager != null
    //#pre[3] (PopupMenu getMenu(String, ConfigManager)): configManager.__Tag == com/dmdirc/config/ConfigManager
    //#presumption(PopupMenu getMenu(String, ConfigManager)): java.util.Iterator:next(...)@71 != null
    //#post(PopupMenu getMenu(String, ConfigManager)): return_value == &new PopupMenu(getMenu#1)
    //#post(PopupMenu getMenu(String, ConfigManager)): new ArrayList(PopupMenu#1) num objects == 1
    //#post(PopupMenu getMenu(String, ConfigManager)): new PopupMenu(getMenu#1) num objects == 1
    //#post(PopupMenu getMenu(String, ConfigManager)): return_value.__Tag == com/dmdirc/commandparser/PopupMenu
    //#post(PopupMenu getMenu(String, ConfigManager)): return_value.items == &new ArrayList(PopupMenu#1)
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.IllegalArgumentException
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:charAt
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:getMenu
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:hasOption
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.Integer:intValue
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.Integer:valueOf
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:getOption
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.List:add
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:com.dmdirc.util.ConfigFile:getKeyDomain
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:com.dmdirc.util.ConfigFile:isKeyDomain
    //#unanalyzed(PopupMenu getMenu(String, ConfigManager)): Effects-of-calling:java.util.List:addAll
    //#test_vector(PopupMenu getMenu(String, ConfigManager)): java.lang.String:charAt(...)@72: {0..59, 61..65_535}, {60}
    //#test_vector(PopupMenu getMenu(String, ConfigManager)): java.lang.String:length(...)@72: {0}, {1..4_294_967_295}
    //#test_vector(PopupMenu getMenu(String, ConfigManager)): java.util.Iterator:hasNext(...)@71: {0}, {1}
        
        for (String item : configManager.getOptionList("popups", menuName)) {
            if (item.length() > 0 && item.charAt(0) == '<') {
                res.addAll(getMenu(item.substring(1), configManager).getItems());
            } else {
                res.add(getItem(item, configManager));
            }
        }
        
        return res;
    //#PopupManager.java:79: end of method: PopupMenu com.dmdirc.commandparser.PopupManager.getMenu(String, ConfigManager)
    }
    
    /**
     * Creates a PopupMenuItem for the specified item.
     * 
     * @param item The item to be turned into a PopupMenuItem
     * @param configManager The config manager to beused for the menu
     * @return The corresponding PopupMenuItem
     */
    private static PopupMenuItem getItem(final String item, final ConfigManager configManager) {
        PopupMenuItem res;
        
        if ("-".equals(item)) {
    //#PopupManager.java:92: method: PopupMenuItem com.dmdirc.commandparser.PopupManager.getItem(String, ConfigManager)
    //#input(PopupMenuItem getItem(String, ConfigManager)): "."._tainted
    //#input(PopupMenuItem getItem(String, ConfigManager)): "Config option not found: "._tainted
    //#input(PopupMenuItem getItem(String, ConfigManager)): "Invalid popup menu item: "._tainted
    //#input(PopupMenuItem getItem(String, ConfigManager)): "popups"._tainted
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Descendant_Table[com/dmdirc/commandparser/PopupMenu]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Descendant_Table[others]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.add(Lcom/dmdirc/commandparser/PopupMenuItem;)V
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.addAll(Ljava/util/Collection;)V
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/commandparser/PopupMenu.__Dispatch_Table.getItems()Ljava/util/List;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Descendant_Table[others]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigManager.stats
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/ConfigSource]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Descendant_Table[others]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/ConfigSource.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/Identity.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/Identity.__Descendant_Table[others]
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.getOptionList(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
    //#input(PopupMenuItem getItem(String, ConfigManager)): com/dmdirc/config/Identity.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(PopupMenuItem getItem(String, ConfigManager)): configManager
    //#input(PopupMenuItem getItem(String, ConfigManager)): configManager.__Tag
    //#input(PopupMenuItem getItem(String, ConfigManager)): configManager.file
    //#input(PopupMenuItem getItem(String, ConfigManager)): configManager.sources
    //#input(PopupMenuItem getItem(String, ConfigManager)): item
    //#input(PopupMenuItem getItem(String, ConfigManager)): item._tainted
    //#output(PopupMenuItem getItem(String, ConfigManager)): java.lang.String:substring(...)._tainted
    //#output(PopupMenuItem getItem(String, ConfigManager)): new ArrayList(PopupMenu#1) num objects
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1) num objects
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1).__Tag
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1).items
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1) num objects
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1).__Tag
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1).divider
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1).submenu
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4) num objects
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).__Tag
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).divider
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).name
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).submenu
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5) num objects
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).__Tag
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).command
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).divider
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).name
    //#output(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).submenu
    //#output(PopupMenuItem getItem(String, ConfigManager)): return_value
    //#new obj(PopupMenuItem getItem(String, ConfigManager)): java.lang.String:substring(...)
    //#new obj(PopupMenuItem getItem(String, ConfigManager)): new ArrayList(PopupMenu#1)
    //#new obj(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1)
    //#new obj(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1)
    //#new obj(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4)
    //#new obj(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5)
    //#pre[1] (PopupMenuItem getItem(String, ConfigManager)): (soft) configManager != null
    //#pre[3] (PopupMenuItem getItem(String, ConfigManager)): (soft) configManager.__Tag == com/dmdirc/config/ConfigManager
    //#pre[7] (PopupMenuItem getItem(String, ConfigManager)): (soft) item != null
    //#presumption(PopupMenuItem getItem(String, ConfigManager)): java.lang.String:indexOf(...)@95 in {-2_147_483_648..-2, 0..4_294_967_294}
    //#post(PopupMenuItem getItem(String, ConfigManager)): init'ed(java.lang.String:substring(...)._tainted)
    //#post(PopupMenuItem getItem(String, ConfigManager)): return_value in Addr_Set{&new PopupMenuItem(getItem#4),&new PopupMenuItem(getItem#5),&new PopupMenuItem(getItem#1)}
    //#post(PopupMenuItem getItem(String, ConfigManager)): new ArrayList(PopupMenu#1) num objects <= 1
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1) num objects <= 1
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1).__Tag == com/dmdirc/commandparser/PopupMenu
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenu(getMenu#1).items == &new ArrayList(PopupMenu#1)
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1) num objects <= 1
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1).__Tag == com/dmdirc/commandparser/PopupMenuItem
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1).divider == 1
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#1).submenu == null
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4) num objects <= 1
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).__Tag == com/dmdirc/commandparser/PopupMenuItem
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).divider == 0
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).name == &java.lang.String:substring(...)
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#4).submenu == &new PopupMenu(getMenu#1)
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5) num objects <= 1
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).__Tag == com/dmdirc/commandparser/PopupMenuItem
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).command == &java.lang.String:substring(...)
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).divider == 0
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).name == &java.lang.String:substring(...)
    //#post(PopupMenuItem getItem(String, ConfigManager)): new PopupMenuItem(getItem#5).submenu == null
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.IllegalArgumentException
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:charAt
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:getMenu
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:hasOption
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.Integer:intValue
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.Integer:valueOf
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:getOption
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.List:add
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:com.dmdirc.util.ConfigFile:getKeyDomain
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:com.dmdirc.util.ConfigFile:isKeyDomain
    //#unanalyzed(PopupMenuItem getItem(String, ConfigManager)): Effects-of-calling:java.util.List:addAll
    //#test_vector(PopupMenuItem getItem(String, ConfigManager)): java.lang.String:charAt(...)@105: {0..59, 61..65_535}, {60}
    //#test_vector(PopupMenuItem getItem(String, ConfigManager)): java.lang.String:equals(...)@92: {0}, {1}
    //#test_vector(PopupMenuItem getItem(String, ConfigManager)): java.lang.String:length(...)@105: {0}, {1..4_294_967_295}
            res = new PopupMenuItem();
        } else {
            final int colon = item.indexOf(':');
            
            if (colon == -1) {
                throw new IllegalArgumentException("Invalid popup menu item: "
                        + item);
            }
            
            final String name = item.substring(0, colon);
            final String command = item.substring(colon + 1);
            
            if (command.length() > 0 && command.charAt(0) == '<') {
                res = new PopupMenuItem(name, getMenu(command.substring(1), configManager));
            } else {
                res = new PopupMenuItem(name, command);
            }
        }
        
        return res;
    //#PopupManager.java:112: end of method: PopupMenuItem com.dmdirc.commandparser.PopupManager.getItem(String, ConfigManager)
    }
    
}    //#output(com.dmdirc.commandparser.PopupManager__static_init): __Descendant_Table[com/dmdirc/commandparser/PopupManager]
    //#post(com.dmdirc.commandparser.PopupManager__static_init): __Descendant_Table[com/dmdirc/commandparser/PopupManager] == &__Dispatch_Table
    //#PopupManager.java:: end of method: com.dmdirc.commandparser.PopupManager.com.dmdirc.commandparser.PopupManager__static_init
    //#PopupManager.java:: end of class: com.dmdirc.commandparser.PopupManager
