//# 1 errors, 438 messages
//#
/*
    //#MenuHelper.java:1:1: class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
 * Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  The ASF licenses this file to You
 * under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.  For additional information regarding
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */

package org.apache.roller.weblogger.ui.core.util.menu;

import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.config.WebloggerConfig;
import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
import org.apache.roller.weblogger.pojos.WeblogPermission;
import org.apache.roller.weblogger.pojos.User;
import org.apache.roller.weblogger.pojos.Weblog;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;


/**
 * A helper class for dealing with UI menus.
 */
public class MenuHelper {
    //#MenuHelper.java:42: method: void org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.org.apache.roller.weblogger.ui.core.util.menu.MenuHelper()
    //#MenuHelper.java:42: end of method: void org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.org.apache.roller.weblogger.ui.core.util.menu.MenuHelper()
    
    private static Log log = LogFactory.getLog(MenuHelper.class);
    //#MenuHelper.java:44: method: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init
    //#MenuHelper.java:44: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu]
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Dispatch_Table.addTab(Lorg/apache/roller/weblogger/ui/core/util/menu/ParsedTab;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTab]
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.addItem(Lorg/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setSubActions([Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/MenuHelper]
    //#output(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): log
    //#output(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): menus
    //#output(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): new Hashtable(MenuHelper__static_init#1) num objects
    //#new obj(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): new Hashtable(MenuHelper__static_init#1)
    //#presumption(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): java.lang.Class:getResourceAsStream(...)@53 != null
    //#presumption(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): java.lang.Class:getResourceAsStream(...)@56 != null
    //#presumption(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): org.apache.commons.logging.LogFactory:getLog(...)@44 != null
    //#post(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/MenuHelper] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): (soft) log != null
    //#post(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): menus == &new Hashtable(MenuHelper__static_init#1)
    //#post(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): new Hashtable(MenuHelper__static_init#1) num objects == 1
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:org.jdom.Element:getAttributeValue
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:java.lang.String:split
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:org.jdom.Element:getChildren
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:java.util.List:add
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:org.jdom.input.SAXBuilder
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:org.jdom.input.SAXBuilder:build
    //#unanalyzed(org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init): Effects-of-calling:org.jdom.Document:getRootElement
    
    private static Hashtable menus = new Hashtable();
    
    
    static {
        try {
            // parse menus and cache so we can efficiently reuse them
            // TODO: there is probably a better way than putting the whole path
            ParsedMenu editorMenu = unmarshall(MenuHelper.class.getResourceAsStream("/org/apache/roller/weblogger/ui/struts2/editor/editor-menu.xml"));
            menus.put("editor", editorMenu);
            
            ParsedMenu adminMenu = unmarshall(MenuHelper.class.getResourceAsStream("/org/apache/roller/weblogger/ui/struts2/admin/admin-menu.xml"));
            menus.put("admin", adminMenu);
            
        } catch (Exception ex) {
            log.error("Error parsing menu configs", ex);
    //#MenuHelper.java:60: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
        }
    }
    //#MenuHelper.java:62: end of method: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.org.apache.roller.weblogger.ui.core.util.menu.MenuHelper__static_init
    
    
    public static Menu getMenu(String menuId, String currentAction,
                               User user, Weblog weblog) {
        
        if(menuId == null) {
    //#MenuHelper.java:68: method: Menu org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.getMenu(String, String, User, Weblog)
    //#input(Menu getMenu(String, String, User, Weblog)): "config tab = "._tainted
    //#input(Menu getMenu(String, String, User, Weblog)): "config tab item = "._tainted
    //#input(Menu getMenu(String, String, User, Weblog)): "creating menu for action - "._tainted
    //#input(Menu getMenu(String, String, User, Weblog)): "tab allowed - "._tainted
    //#input(Menu getMenu(String, String, User, Weblog)): "tab item allowed - "._tainted
    //#input(Menu getMenu(String, String, User, Weblog)): currentAction
    //#input(Menu getMenu(String, String, User, Weblog)): currentAction._tainted
    //#input(Menu getMenu(String, String, User, Weblog)): log
    //#input(Menu getMenu(String, String, User, Weblog)): menuId
    //#input(Menu getMenu(String, String, User, Weblog)): menus
    //#input(Menu getMenu(String, String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#input(Menu getMenu(String, String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR
    //#input(Menu getMenu(String, String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.LIMITED
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/Menu.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/Menu]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/Menu.__Dispatch_Table.addTab(Lorg/apache/roller/weblogger/ui/core/util/menu/MenuTab;)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/MenuTab]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.addItem(Lorg/apache/roller/weblogger/ui/core/util/menu/MenuTabItem;)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.setKey(Ljava/lang/String;)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.setSelected(Z)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.getAction()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.setKey(Ljava/lang/String;)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.setSelected(Z)V
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Descendant_Table[others]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Dispatch_Table.getTabs()Ljava/util/List;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTab]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[others]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getDisabledProperty()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getEnabledProperty()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getPerm()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getRole()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getTabItems()Ljava/util/List;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[others]
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getAction()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getDisabledProperty()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getEnabledProperty()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getPerm()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getRole()Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getSubActions()[Ljava/lang/String;
    //#input(Menu getMenu(String, String, User, Weblog)): user
    //#input(Menu getMenu(String, String, User, Weblog)): weblog
    //#output(Menu getMenu(String, String, User, Weblog)): new ArrayList(Menu#1) num objects
    //#output(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2) num objects
    //#output(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2).__Tag
    //#output(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2).tabs
    //#output(Menu getMenu(String, String, User, Weblog)): return_value
    //#new obj(Menu getMenu(String, String, User, Weblog)): new ArrayList(Menu#1)
    //#new obj(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2)
    //#pre[1] (Menu getMenu(String, String, User, Weblog)): (soft) currentAction != null
    //#pre[3] (Menu getMenu(String, String, User, Weblog)): (soft) log != null
    //#pre[5] (Menu getMenu(String, String, User, Weblog)): (soft) menus != null
    //#pre[6] (Menu getMenu(String, String, User, Weblog)): (soft) user != null
    //#pre[7] (Menu getMenu(String, String, User, Weblog)): (soft) weblog != null
    //#presumption(Menu getMenu(String, String, User, Weblog)): java.util.Hashtable:get(...).__Tag@75 == org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu
    //#presumption(Menu getMenu(String, String, User, Weblog)): menuConfig.tabs@75 != null
    //#post(Menu getMenu(String, String, User, Weblog)): return_value in Addr_Set{null,&new Menu(buildMenu#2)}
    //#post(Menu getMenu(String, String, User, Weblog)): new ArrayList(Menu#1) num objects <= 1
    //#post(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2) num objects <= 1
    //#post(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2).__Tag == org/apache/roller/weblogger/ui/core/util/menu/Menu
    //#post(Menu getMenu(String, String, User, Weblog)): new Menu(buildMenu#2).tabs == &new ArrayList(Menu#1)
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getBooleanProperty
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.pojos.Weblog:hasUserPermissions
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.pojos.User:hasRole
    //#unanalyzed(Menu getMenu(String, String, User, Weblog)): Effects-of-calling:java.util.List:add
    //#test_vector(Menu getMenu(String, String, User, Weblog)): menuId: Inverse{null}, Addr_Set{null}
    //#test_vector(Menu getMenu(String, String, User, Weblog)): java.util.Hashtable:get(...)@75: Addr_Set{null}, Inverse{null}
            return null;
        }
        
        Menu menu = null;
        
        // do we know the specified menu config?
        ParsedMenu menuConfig = (ParsedMenu) menus.get(menuId);
        if(menuConfig != null) {
            menu = buildMenu(menuConfig, currentAction, user, weblog);
        }
        
        return menu;
    //#MenuHelper.java:80: end of method: Menu org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.getMenu(String, String, User, Weblog)
    }
    
    
    private static Menu buildMenu(ParsedMenu menuConfig, String currentAction, 
                                  User user, Weblog weblog) {
        
        log.debug("creating menu for action - "+currentAction);
    //#MenuHelper.java:87: method: Menu org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.buildMenu(ParsedMenu, String, User, Weblog)
    //#MenuHelper.java:87: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): "config tab = "._tainted
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): "config tab item = "._tainted
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): "creating menu for action - "._tainted
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): "tab allowed - "._tainted
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): "tab item allowed - "._tainted
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): currentAction
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): currentAction._tainted
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): log
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): menuConfig
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): menuConfig.__Tag
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): menuConfig.tabs
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.LIMITED
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/Menu.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/Menu]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/Menu.__Dispatch_Table.addTab(Lorg/apache/roller/weblogger/ui/core/util/menu/MenuTab;)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/MenuTab]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.addItem(Lorg/apache/roller/weblogger/ui/core/util/menu/MenuTabItem;)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.setKey(Ljava/lang/String;)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTab.__Dispatch_Table.setSelected(Z)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.getAction()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.setKey(Ljava/lang/String;)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/MenuTabItem.__Dispatch_Table.setSelected(Z)V
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Descendant_Table[others]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Dispatch_Table.getTabs()Ljava/util/List;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTab]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[others]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getDisabledProperty()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getEnabledProperty()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getPerm()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getRole()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.getTabItems()Ljava/util/List;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[others]
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getAction()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getDisabledProperty()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getEnabledProperty()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getPerm()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getRole()Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getSubActions()[Ljava/lang/String;
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): user
    //#input(Menu buildMenu(ParsedMenu, String, User, Weblog)): weblog
    //#output(Menu buildMenu(ParsedMenu, String, User, Weblog)): new ArrayList(Menu#1) num objects
    //#output(Menu buildMenu(ParsedMenu, String, User, Weblog)): new Menu(buildMenu#2) num objects
    //#output(Menu buildMenu(ParsedMenu, String, User, Weblog)): return_value.__Tag
    //#output(Menu buildMenu(ParsedMenu, String, User, Weblog)): return_value.tabs
    //#output(Menu buildMenu(ParsedMenu, String, User, Weblog)): return_value
    //#new obj(Menu buildMenu(ParsedMenu, String, User, Weblog)): new ArrayList(Menu#1)
    //#new obj(Menu buildMenu(ParsedMenu, String, User, Weblog)): new Menu(buildMenu#2)
    //#pre[3] (Menu buildMenu(ParsedMenu, String, User, Weblog)): log != null
    //#pre[4] (Menu buildMenu(ParsedMenu, String, User, Weblog)): menuConfig != null
    //#pre[5] (Menu buildMenu(ParsedMenu, String, User, Weblog)): menuConfig.__Tag == org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu
    //#pre[6] (Menu buildMenu(ParsedMenu, String, User, Weblog)): menuConfig.tabs != null
    //#pre[1] (Menu buildMenu(ParsedMenu, String, User, Weblog)): (soft) currentAction != null
    //#pre[7] (Menu buildMenu(ParsedMenu, String, User, Weblog)): (soft) user != null
    //#pre[8] (Menu buildMenu(ParsedMenu, String, User, Weblog)): (soft) weblog != null
    //#presumption(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTab.tabItems@95 != null
    //#presumption(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTabItem.subActions.length@133 <= 4_294_967_295
    //#presumption(Menu buildMenu(ParsedMenu, String, User, Weblog)): java.util.Iterator:next(...).__Tag@133 == org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem
    //#presumption(Menu buildMenu(ParsedMenu, String, User, Weblog)): java.util.Iterator:next(...).__Tag@95 == org/apache/roller/weblogger/ui/core/util/menu/ParsedTab
    //#presumption(Menu buildMenu(ParsedMenu, String, User, Weblog)): java.util.Iterator:next(...)@133 != null
    //#presumption(Menu buildMenu(ParsedMenu, String, User, Weblog)): java.util.Iterator:next(...)@95 != null
    //#post(Menu buildMenu(ParsedMenu, String, User, Weblog)): return_value == &new Menu(buildMenu#2)
    //#post(Menu buildMenu(ParsedMenu, String, User, Weblog)): new ArrayList(Menu#1) num objects == 1
    //#post(Menu buildMenu(ParsedMenu, String, User, Weblog)): new Menu(buildMenu#2) num objects == 1
    //#post(Menu buildMenu(ParsedMenu, String, User, Weblog)): return_value.__Tag == org/apache/roller/weblogger/ui/core/util/menu/Menu
    //#post(Menu buildMenu(ParsedMenu, String, User, Weblog)): return_value.tabs == &new ArrayList(Menu#1)
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getBooleanProperty
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:org.apache.roller.weblogger.pojos.Weblog:hasUserPermissions
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(Menu buildMenu(ParsedMenu, String, User, Weblog)): Effects-of-calling:java.util.List:add
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTab.disabledProperty@95: Addr_Set{null}, Inverse{null}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTab.enabledProperty@95: Addr_Set{null}, Inverse{null}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTab.role@95: Addr_Set{null}, Inverse{null}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTabItem.disabledProperty@133: Addr_Set{null}, Inverse{null}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTabItem.enabledProperty@133: Addr_Set{null}, Inverse{null}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): configTabItem.role@133: Addr_Set{null}, Inverse{null}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): java.util.Iterator:hasNext(...)@132: {0}, {1}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): java.util.Iterator:hasNext(...)@94: {0}, {1}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): org.apache.roller.weblogger.pojos.User:hasRole(...)@110: {1}, {0}
    //#test_vector(Menu buildMenu(ParsedMenu, String, User, Weblog)): org.apache.roller.weblogger.pojos.User:hasRole(...)@147: {1}, {0}
        
        Menu tabMenu = new Menu();
        
        // iterate over tabs from parsed config
        ParsedTab configTab = null;
    //#MenuHelper.java:92: Warning: unused assignment
    //#    unused assignment into configTab
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    Attribs:  Uncertain
        Iterator tabsIter = menuConfig.getTabs().iterator();
        while(tabsIter.hasNext()) {
            configTab = (ParsedTab) tabsIter.next();
            
            log.debug("config tab = "+configTab.getName());
    //#MenuHelper.java:97: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            
            // does this tab have an enabledProperty?
            boolean includeTab = true;
            if(configTab.getEnabledProperty() != null) {
                includeTab = getBooleanProperty(configTab.getEnabledProperty());
            } else if(configTab.getDisabledProperty() != null) {
                includeTab = ! getBooleanProperty(configTab.getDisabledProperty());
            }
            
            if(includeTab) {
                // user roles check
                if(configTab.getRole() != null) {
                    if(!user.hasRole(configTab.getRole())) {
    //#MenuHelper.java:110: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.pojos.User:hasRole(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.pojos.User:hasRole(String)
                        includeTab = false;
                    }
                }
            }
            
            if(includeTab) {
                // weblog permissions check
                includeTab = isPermitted(configTab.getPerm(), user, weblog);
            }
            
            if(includeTab) {
                log.debug("tab allowed - "+configTab.getName());
    //#MenuHelper.java:122: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
                
                // all checks passed, tab should be included
                MenuTab tab = new MenuTab();
                tab.setKey(configTab.getName());
                
                // setup tab items
                boolean firstItem = true;
                ParsedTabItem configTabItem = null;
    //#MenuHelper.java:130: Warning: unused assignment
    //#    unused assignment into configTabItem
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    Attribs:  Uncertain
                Iterator itemsIter = configTab.getTabItems().iterator();
                while(itemsIter.hasNext()) {
                    configTabItem = (ParsedTabItem) itemsIter.next();
                    
                    log.debug("config tab item = "+configTabItem.getName());
    //#MenuHelper.java:135: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
                    
                    boolean includeItem = true;
                    if(configTabItem.getEnabledProperty() != null) {
                        includeItem = getBooleanProperty(configTabItem.getEnabledProperty());
                    } else if(configTabItem.getDisabledProperty() != null) {
                        includeItem = !getBooleanProperty(configTabItem.getDisabledProperty());
                    }
                    
                    if(includeItem) {
                        // user roles check
                        if(configTabItem.getRole() != null) {
                            if(!user.hasRole(configTabItem.getRole())) {
    //#MenuHelper.java:147: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.pojos.User:hasRole(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.pojos.User:hasRole(String)
                                includeItem = false;
                            }
                        }
                    }
                    
                    if(includeItem) {
                        // weblog permissions check
                        includeItem = isPermitted(configTabItem.getPerm(), user, weblog);
                    }
                    
                    if(includeItem) {
                        log.debug("tab item allowed - "+configTabItem.getName());
    //#MenuHelper.java:159: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
                        
                        // all checks passed, item should be included
                        MenuTabItem tabItem = new MenuTabItem();
                        tabItem.setKey(configTabItem.getName());
                        tabItem.setAction(configTabItem.getAction());
                        
                        // is this the selected item?
                        if(isSelected(currentAction, configTabItem)) {
    //#MenuHelper.java:167: ?precondition failure
    //#    org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.isSelected: (soft) init'ed(tabItem.subActions[0..4_294_967_295])
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: Menu buildMenu(ParsedMenu, String, User, Weblog)
    //#    basic block: bb_33
    //#    assertion: (soft) init'ed(undefined)
    //#    callee: bool org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.isSelected(String, ParsedTabItem)
    //#    callee assertion: (soft) init'ed(tabItem.subActions[0..4_294_967_295])
    //#    callee file: MenuHelper.java
    //#    callee precondition index: [7]
    //#    callee srcpos: 222
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Soft  Bad only invalid
                            tabItem.setSelected(true);
                            tab.setSelected(true);
                        }
                        
                        // the url for the tab is the url of the first item of the tab
                        if(firstItem) {
                            tab.setAction(tabItem.getAction());
                            firstItem = false;
                        }
                        
                        // add the item
                        tab.addItem(tabItem);
                    }
                }
                
                // add the tab
                tabMenu.addTab(tab);
            }
        }
        
        return tabMenu;
    //#MenuHelper.java:188: end of method: Menu org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.buildMenu(ParsedMenu, String, User, Weblog)
    }
    
    
    private static boolean isPermitted(String perm, User user, Weblog weblog) {
        
        // convert permissions string to short
        short permMask = -1;
    //#MenuHelper.java:195: method: bool org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.isPermitted(String, User, Weblog)
    //#MenuHelper.java:195: Warning: unused assignment
    //#    unused assignment into permMask
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: bool isPermitted(String, User, Weblog)
    //#    Attribs:  Uncertain
    //#input(bool isPermitted(String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#input(bool isPermitted(String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR
    //#input(bool isPermitted(String, User, Weblog)): org.apache.roller.weblogger.pojos.WeblogPermission.LIMITED
    //#input(bool isPermitted(String, User, Weblog)): perm
    //#input(bool isPermitted(String, User, Weblog)): user
    //#input(bool isPermitted(String, User, Weblog)): weblog
    //#output(bool isPermitted(String, User, Weblog)): return_value
    //#pre[3] (bool isPermitted(String, User, Weblog)): (soft) weblog != null
    //#presumption(bool isPermitted(String, User, Weblog)): init'ed(org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN)
    //#presumption(bool isPermitted(String, User, Weblog)): init'ed(org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR)
    //#presumption(bool isPermitted(String, User, Weblog)): init'ed(org.apache.roller.weblogger.pojos.WeblogPermission.LIMITED)
    //#post(bool isPermitted(String, User, Weblog)): init'ed(return_value)
    //#test_vector(bool isPermitted(String, User, Weblog)): perm: Inverse{null}, Addr_Set{null}
    //#test_vector(bool isPermitted(String, User, Weblog)): java.lang.String:equals(...)@198: {0}, {1}
    //#test_vector(bool isPermitted(String, User, Weblog)): java.lang.String:equals(...)@200: {0}, {1}
    //#test_vector(bool isPermitted(String, User, Weblog)): java.lang.String:equals(...)@202: {0}, {1}
        if(perm == null) {
            return true;
        } else if("limited".equals(perm)) {
            permMask = WeblogPermission.LIMITED;
        } else if("author".equals(perm)) {
            permMask = WeblogPermission.AUTHOR;
        } else if("admin".equals(perm)) {
            permMask = WeblogPermission.ADMIN;
        } else {
            // unknown perm
            return false;
        }
        
        return weblog.hasUserPermissions(user, permMask);
    //#MenuHelper.java:209: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.pojos.Weblog:hasUserPermissions(User, short)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: bool isPermitted(String, User, Weblog)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.pojos.Weblog:hasUserPermissions(User, short)
    //#MenuHelper.java:209: end of method: bool org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.isPermitted(String, User, Weblog)
    }
    
    /** Check enabled property, prefers runtime properties */
    private static boolean getBooleanProperty(String propertyName) {
        if (WebloggerRuntimeConfig.getProperty(propertyName) != null) {
    //#MenuHelper.java:214: method: bool org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.getBooleanProperty(String)
    //#MenuHelper.java:214: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: bool getBooleanProperty(String)
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty(String)
    //#input(bool getBooleanProperty(String)): propertyName
    //#output(bool getBooleanProperty(String)): return_value
    //#post(bool getBooleanProperty(String)): init'ed(return_value)
    //#test_vector(bool getBooleanProperty(String)): org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty(...)@214: Addr_Set{null}, Inverse{null}
            return WebloggerRuntimeConfig.getBooleanProperty(propertyName);
    //#MenuHelper.java:215: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: bool getBooleanProperty(String)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getBooleanProperty(String)
        }
        return WebloggerConfig.getBooleanProperty(propertyName);
    //#MenuHelper.java:217: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: bool getBooleanProperty(String)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#MenuHelper.java:217: end of method: bool org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.getBooleanProperty(String)
    }
    
    private static boolean isSelected(String currentAction, ParsedTabItem tabItem) {
        
        if(currentAction.equals(tabItem.getAction())) {
    //#MenuHelper.java:222: method: bool org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.isSelected(String, ParsedTabItem)
    //#input(bool isSelected(String, ParsedTabItem)): currentAction
    //#input(bool isSelected(String, ParsedTabItem)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(bool isSelected(String, ParsedTabItem)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[others]
    //#input(bool isSelected(String, ParsedTabItem)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getAction()Ljava/lang/String;
    //#input(bool isSelected(String, ParsedTabItem)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.getSubActions()[Ljava/lang/String;
    //#input(bool isSelected(String, ParsedTabItem)): tabItem
    //#input(bool isSelected(String, ParsedTabItem)): tabItem.__Tag
    //#input(bool isSelected(String, ParsedTabItem)): tabItem.action
    //#input(bool isSelected(String, ParsedTabItem)): tabItem.subActions
    //#input(bool isSelected(String, ParsedTabItem)): tabItem.subActions.length
    //#input(bool isSelected(String, ParsedTabItem)): tabItem.subActions[0..4_294_967_295]
    //#output(bool isSelected(String, ParsedTabItem)): return_value
    //#pre[1] (bool isSelected(String, ParsedTabItem)): currentAction != null
    //#pre[2] (bool isSelected(String, ParsedTabItem)): tabItem != null
    //#pre[3] (bool isSelected(String, ParsedTabItem)): tabItem.__Tag == org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem
    //#pre[4] (bool isSelected(String, ParsedTabItem)): init'ed(tabItem.action)
    //#pre[5] (bool isSelected(String, ParsedTabItem)): (soft) init'ed(tabItem.subActions)
    //#pre[6] (bool isSelected(String, ParsedTabItem)): (soft) tabItem.subActions.length <= 4_294_967_295
    //#pre[7] (bool isSelected(String, ParsedTabItem)): (soft) init'ed(tabItem.subActions[0..4_294_967_295])
    //#post(bool isSelected(String, ParsedTabItem)): init'ed(return_value)
    //#test_vector(bool isSelected(String, ParsedTabItem)): tabItem.subActions: Addr_Set{null}, Inverse{null}
    //#test_vector(bool isSelected(String, ParsedTabItem)): tabItem.subActions.length: {0}, {1..4_294_967_295}
    //#test_vector(bool isSelected(String, ParsedTabItem)): java.lang.String:equals(...)@222: {0}, {1}
    //#test_vector(bool isSelected(String, ParsedTabItem)): java.lang.String:equals(...)@230: {0}, {1}
            return true;
        }
        
        // an item is also considered selected if it's subforwards are the current action
        String[] subActions = tabItem.getSubActions();
        if(subActions != null && subActions.length > 0) {
            for(int i=0; i < subActions.length; i++) {
                if(currentAction.equals(subActions[i])) {
                    return true;
                }
            }
        }
        
        return false;
    //#MenuHelper.java:236: end of method: bool org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.isSelected(String, ParsedTabItem)
    }
    
    
    /**
     * Unmarshall the given input stream into our defined
     * set of Java objects.
     **/
    private static ParsedMenu unmarshall(InputStream instream) 
        throws IOException, JDOMException {
        
        if(instream == null)
    //#MenuHelper.java:247: method: ParsedMenu org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.unmarshall(InputStream)
    //#input(ParsedMenu unmarshall(InputStream)): instream
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu]
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu.__Dispatch_Table.addTab(Lorg/apache/roller/weblogger/ui/core/util/menu/ParsedTab;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTab]
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.addItem(Lorg/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(ParsedMenu unmarshall(InputStream)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setSubActions([Ljava/lang/String;)V
    //#output(ParsedMenu unmarshall(InputStream)): new ArrayList(ParsedMenu#1) num objects
    //#output(ParsedMenu unmarshall(InputStream)): new ParsedMenu(unmarshall#1) num objects
    //#output(ParsedMenu unmarshall(InputStream)): return_value.__Tag
    //#output(ParsedMenu unmarshall(InputStream)): return_value.tabs
    //#output(ParsedMenu unmarshall(InputStream)): return_value
    //#new obj(ParsedMenu unmarshall(InputStream)): new ArrayList(ParsedMenu#1)
    //#new obj(ParsedMenu unmarshall(InputStream)): new ParsedMenu(unmarshall#1)
    //#pre[1] (ParsedMenu unmarshall(InputStream)): instream != null
    //#presumption(ParsedMenu unmarshall(InputStream)): java.util.Iterator:next(...)@259 != null
    //#presumption(ParsedMenu unmarshall(InputStream)): org.jdom.Document:getRootElement(...)@255 != null
    //#presumption(ParsedMenu unmarshall(InputStream)): org.jdom.Element:getChildren(...)@256 != null
    //#presumption(ParsedMenu unmarshall(InputStream)): org.jdom.input.SAXBuilder:build(...)@253 != null
    //#post(ParsedMenu unmarshall(InputStream)): return_value == &new ParsedMenu(unmarshall#1)
    //#post(ParsedMenu unmarshall(InputStream)): new ArrayList(ParsedMenu#1) num objects == 1
    //#post(ParsedMenu unmarshall(InputStream)): new ParsedMenu(unmarshall#1) num objects == 1
    //#post(ParsedMenu unmarshall(InputStream)): return_value.__Tag == org/apache/roller/weblogger/ui/core/util/menu/ParsedMenu
    //#post(ParsedMenu unmarshall(InputStream)): return_value.tabs == &new ArrayList(ParsedMenu#1)
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:org.jdom.Element:getAttributeValue
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:org.jdom.Element:getChildren
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(ParsedMenu unmarshall(InputStream)): Effects-of-calling:java.util.List:add
    //#test_vector(ParsedMenu unmarshall(InputStream)): java.util.Iterator:hasNext(...)@258: {0}, {1}
            throw new IOException("InputStream is null!");
        
        ParsedMenu config = new ParsedMenu();
        
        SAXBuilder builder = new SAXBuilder();
    //#MenuHelper.java:252: Warning: method not available
    //#    -- call on void org.jdom.input.SAXBuilder()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedMenu unmarshall(InputStream)
    //#    unanalyzed callee: void org.jdom.input.SAXBuilder()
        Document doc = builder.build(instream);
    //#MenuHelper.java:253: Warning: method not available
    //#    -- call on Document org.jdom.input.SAXBuilder:build(InputStream)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedMenu unmarshall(InputStream)
    //#    unanalyzed callee: Document org.jdom.input.SAXBuilder:build(InputStream)
        
        Element root = doc.getRootElement();
    //#MenuHelper.java:255: Warning: method not available
    //#    -- call on Element org.jdom.Document:getRootElement()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedMenu unmarshall(InputStream)
    //#    unanalyzed callee: Element org.jdom.Document:getRootElement()
        List menus = root.getChildren("menu");
    //#MenuHelper.java:256: Warning: method not available
    //#    -- call on List org.jdom.Element:getChildren(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedMenu unmarshall(InputStream)
    //#    unanalyzed callee: List org.jdom.Element:getChildren(String)
        Iterator iter = menus.iterator();
        while (iter.hasNext()) {
            Element e = (Element) iter.next();
            config.addTab(elementToParsedTab(e));
        }
        
        return config;
    //#MenuHelper.java:263: end of method: ParsedMenu org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.unmarshall(InputStream)
    }
    
    
    private static ParsedTab elementToParsedTab(Element element) {
        
        ParsedTab tab = new ParsedTab();
    //#MenuHelper.java:269: method: ParsedTab org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.elementToParsedTab(Element)
    //#input(ParsedTab elementToParsedTab(Element)): element
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTab]
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.addItem(Lorg/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTab.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(ParsedTab elementToParsedTab(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setSubActions([Ljava/lang/String;)V
    //#output(ParsedTab elementToParsedTab(Element)): new ArrayList(ParsedTab#1) num objects
    //#output(ParsedTab elementToParsedTab(Element)): new ParsedTab(elementToParsedTab#1) num objects
    //#output(ParsedTab elementToParsedTab(Element)): return_value.__Tag
    //#output(ParsedTab elementToParsedTab(Element)): return_value.disabledProperty
    //#output(ParsedTab elementToParsedTab(Element)): return_value.enabledProperty
    //#output(ParsedTab elementToParsedTab(Element)): return_value.name
    //#output(ParsedTab elementToParsedTab(Element)): return_value.perm
    //#output(ParsedTab elementToParsedTab(Element)): return_value.role
    //#output(ParsedTab elementToParsedTab(Element)): return_value.tabItems
    //#output(ParsedTab elementToParsedTab(Element)): return_value
    //#new obj(ParsedTab elementToParsedTab(Element)): new ArrayList(ParsedTab#1)
    //#new obj(ParsedTab elementToParsedTab(Element)): new ParsedTab(elementToParsedTab#1)
    //#pre[1] (ParsedTab elementToParsedTab(Element)): element != null
    //#presumption(ParsedTab elementToParsedTab(Element)): java.util.Iterator:next(...)@280 != null
    //#presumption(ParsedTab elementToParsedTab(Element)): org.jdom.Element:getChildren(...)@277 != null
    //#post(ParsedTab elementToParsedTab(Element)): return_value == &new ParsedTab(elementToParsedTab#1)
    //#post(ParsedTab elementToParsedTab(Element)): new ArrayList(ParsedTab#1) num objects == 1
    //#post(ParsedTab elementToParsedTab(Element)): new ParsedTab(elementToParsedTab#1) num objects == 1
    //#post(ParsedTab elementToParsedTab(Element)): return_value.__Tag == org/apache/roller/weblogger/ui/core/util/menu/ParsedTab
    //#post(ParsedTab elementToParsedTab(Element)): init'ed(return_value.disabledProperty)
    //#post(ParsedTab elementToParsedTab(Element)): init'ed(return_value.enabledProperty)
    //#post(ParsedTab elementToParsedTab(Element)): init'ed(return_value.name)
    //#post(ParsedTab elementToParsedTab(Element)): init'ed(return_value.perm)
    //#post(ParsedTab elementToParsedTab(Element)): init'ed(return_value.role)
    //#post(ParsedTab elementToParsedTab(Element)): return_value.tabItems == &new ArrayList(ParsedTab#1)
    //#unanalyzed(ParsedTab elementToParsedTab(Element)): Effects-of-calling:org.jdom.Element:getAttributeValue
    //#unanalyzed(ParsedTab elementToParsedTab(Element)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(ParsedTab elementToParsedTab(Element)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(ParsedTab elementToParsedTab(Element)): Effects-of-calling:java.util.List:add
    //#test_vector(ParsedTab elementToParsedTab(Element)): java.util.Iterator:hasNext(...)@279: {0}, {1}
        
        tab.setName(element.getAttributeValue("name"));
    //#MenuHelper.java:271: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTab elementToParsedTab(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tab.setPerm(element.getAttributeValue("perms"));
    //#MenuHelper.java:272: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTab elementToParsedTab(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tab.setRole(element.getAttributeValue("roles"));
    //#MenuHelper.java:273: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTab elementToParsedTab(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tab.setEnabledProperty(element.getAttributeValue("enabledProperty"));
    //#MenuHelper.java:274: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTab elementToParsedTab(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tab.setDisabledProperty(element.getAttributeValue("disabledProperty"));
    //#MenuHelper.java:275: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTab elementToParsedTab(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        
        List menuItems = element.getChildren("menu-item");
    //#MenuHelper.java:277: Warning: method not available
    //#    -- call on List org.jdom.Element:getChildren(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTab elementToParsedTab(Element)
    //#    unanalyzed callee: List org.jdom.Element:getChildren(String)
        Iterator iter = menuItems.iterator();
        while (iter.hasNext()) {
            Element e = (Element) iter.next();
            tab.addItem(elementToParsedTabItem(e));
        }
        
        return tab;
    //#MenuHelper.java:284: end of method: ParsedTab org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.elementToParsedTab(Element)
    }
    
    
    private static ParsedTabItem elementToParsedTabItem(Element element) {
        
        ParsedTabItem tabItem = new ParsedTabItem();
    //#MenuHelper.java:290: method: ParsedTabItem org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.elementToParsedTabItem(Element)
    //#input(ParsedTabItem elementToParsedTabItem(Element)): element
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Descendant_Table[org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem]
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setAction(Ljava/lang/String;)V
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setDisabledProperty(Ljava/lang/String;)V
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setEnabledProperty(Ljava/lang/String;)V
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setName(Ljava/lang/String;)V
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setPerm(Ljava/lang/String;)V
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setRole(Ljava/lang/String;)V
    //#input(ParsedTabItem elementToParsedTabItem(Element)): org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem.__Dispatch_Table.setSubActions([Ljava/lang/String;)V
    //#output(ParsedTabItem elementToParsedTabItem(Element)): java.lang.String:split(...)._tainted
    //#output(ParsedTabItem elementToParsedTabItem(Element)): new ParsedTabItem(elementToParsedTabItem#1) num objects
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.__Tag
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.action
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.disabledProperty
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.enabledProperty
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.name
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.perm
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.role
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value.subActions
    //#output(ParsedTabItem elementToParsedTabItem(Element)): return_value
    //#new obj(ParsedTabItem elementToParsedTabItem(Element)): java.lang.String:split(...)
    //#new obj(ParsedTabItem elementToParsedTabItem(Element)): new ParsedTabItem(elementToParsedTabItem#1)
    //#pre[1] (ParsedTabItem elementToParsedTabItem(Element)): element != null
    //#post(ParsedTabItem elementToParsedTabItem(Element)): java.lang.String:split(...)._tainted == 0
    //#post(ParsedTabItem elementToParsedTabItem(Element)): return_value == &new ParsedTabItem(elementToParsedTabItem#1)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): new ParsedTabItem(elementToParsedTabItem#1) num objects == 1
    //#post(ParsedTabItem elementToParsedTabItem(Element)): return_value.__Tag == org/apache/roller/weblogger/ui/core/util/menu/ParsedTabItem
    //#post(ParsedTabItem elementToParsedTabItem(Element)): init'ed(return_value.action)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): init'ed(return_value.disabledProperty)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): init'ed(return_value.enabledProperty)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): init'ed(return_value.name)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): init'ed(return_value.perm)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): init'ed(return_value.role)
    //#post(ParsedTabItem elementToParsedTabItem(Element)): return_value.subActions in Addr_Set{null,&java.lang.String:split(...)}
    //#test_vector(ParsedTabItem elementToParsedTabItem(Element)): org.jdom.Element:getAttributeValue(...)@295: Addr_Set{null}, Inverse{null}
        
        tabItem.setName(element.getAttributeValue("name"));
    //#MenuHelper.java:292: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tabItem.setAction(element.getAttributeValue("action"));
    //#MenuHelper.java:293: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        
        String subActions = element.getAttributeValue("subactions");
    //#MenuHelper.java:295: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        if(subActions != null) {
            tabItem.setSubActions(subActions.split(","));
        }
        
        tabItem.setPerm(element.getAttributeValue("perms"));
    //#MenuHelper.java:300: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tabItem.setRole(element.getAttributeValue("roles"));
    //#MenuHelper.java:301: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tabItem.setEnabledProperty(element.getAttributeValue("enabledProperty"));
    //#MenuHelper.java:302: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        tabItem.setDisabledProperty(element.getAttributeValue("disabledProperty"));
    //#MenuHelper.java:303: Warning: method not available
    //#    -- call on String org.jdom.Element:getAttributeValue(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
    //#    method: ParsedTabItem elementToParsedTabItem(Element)
    //#    unanalyzed callee: String org.jdom.Element:getAttributeValue(String)
        
        return tabItem;
    //#MenuHelper.java:305: end of method: ParsedTabItem org.apache.roller.weblogger.ui.core.util.menu.MenuHelper.elementToParsedTabItem(Element)
    }
    
}
    //#MenuHelper.java:: end of class: org.apache.roller.weblogger.ui.core.util.menu.MenuHelper
