//# 2 errors, 217 messages
//#
/*
    //#RollerContext.java:1:1: class: org.apache.roller.weblogger.ui.core.RollerContext
 * 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;

import java.io.File;
import java.io.InputStream;
import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.acegisecurity.providers.ProviderManager;
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
import org.acegisecurity.providers.dao.UserCache;
import org.acegisecurity.providers.encoding.Md5PasswordEncoder;
import org.acegisecurity.providers.encoding.PasswordEncoder;
import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.PropertyConfigurator;
import org.apache.roller.planet.business.GuicePlanetProvider;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.BootstrapException;
import org.apache.roller.weblogger.business.startup.StartupException;
import org.apache.roller.weblogger.config.WebloggerConfig;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.planet.business.PlanetFactory;
import org.apache.roller.planet.business.PlanetProvider;
import org.apache.roller.planet.business.startup.PlanetStartup;
import org.apache.roller.weblogger.business.startup.WebloggerStartup;
import org.apache.roller.weblogger.pojos.User;
import org.apache.roller.weblogger.ui.core.plugins.UIPluginManager;
import org.apache.roller.weblogger.ui.core.plugins.UIPluginManagerImpl;
import org.apache.roller.weblogger.ui.core.security.AutoProvision;
import org.apache.roller.weblogger.util.cache.CacheManager;
import org.apache.velocity.runtime.RuntimeSingleton;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.WebApplicationContextUtils;


/**
 * Initialize the Roller web application/context.
 */
public class RollerContext extends ContextLoaderListener  
        implements ServletContextListener { 
    
    private static Log log = LogFactory.getLog(RollerContext.class);
    //#RollerContext.java:64: method: org.apache.roller.weblogger.ui.core.RollerContext.org.apache.roller.weblogger.ui.core.RollerContext__static_init
    //#RollerContext.java:64: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: org.apache.roller.weblogger.ui.core.RollerContext__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/core/RollerContext]
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.contextDestroyed(Ljavax/servlet/ServletContextEvent;)V
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.contextInitialized(Ljavax/servlet/ServletContextEvent;)V
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.initializeSecurityFeatures(Ljavax/servlet/ServletContext;)V
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.setupVelocity()V
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): log
    //#output(org.apache.roller.weblogger.ui.core.RollerContext__static_init): servletContext
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/core/RollerContext] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.contextDestroyed(Ljavax/servlet/ServletContextEvent;)V == &contextDestroyed
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.contextInitialized(Ljavax/servlet/ServletContextEvent;)V == &contextInitialized
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.initializeSecurityFeatures(Ljavax/servlet/ServletContext;)V == &initializeSecurityFeatures
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): __Dispatch_Table.setupVelocity()V == &setupVelocity
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): init'ed(log)
    //#post(org.apache.roller.weblogger.ui.core.RollerContext__static_init): servletContext == null
    
    private static ServletContext servletContext = null;
    //#RollerContext.java:66: end of method: org.apache.roller.weblogger.ui.core.RollerContext.org.apache.roller.weblogger.ui.core.RollerContext__static_init

    
    public RollerContext() {
        super();
    //#RollerContext.java:70: method: void org.apache.roller.weblogger.ui.core.RollerContext.org.apache.roller.weblogger.ui.core.RollerContext()
    //#RollerContext.java:70: Warning: method not available
    //#    -- call on void org.springframework.web.context.ContextLoaderListener()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void org.apache.roller.weblogger.ui.core.RollerContext()
    //#    unanalyzed callee: void org.springframework.web.context.ContextLoaderListener()
    //#input(void org.apache.roller.weblogger.ui.core.RollerContext()): this
    }
    //#RollerContext.java:71: end of method: void org.apache.roller.weblogger.ui.core.RollerContext.org.apache.roller.weblogger.ui.core.RollerContext()
    
    
    /**
     * Access to the plugin manager for the UI layer. TODO: we may want 
     * something similar to the Roller interface for the UI layer if we dont 
     * want methods like this here in RollerContext.
     */
    public static UIPluginManager getUIPluginManager() {
        return UIPluginManagerImpl.getInstance();
    //#RollerContext.java:80: method: UIPluginManager org.apache.roller.weblogger.ui.core.RollerContext.getUIPluginManager()
    //#input(UIPluginManager getUIPluginManager()): org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.instance
    //#output(UIPluginManager getUIPluginManager()): return_value
    //#pre[1] (UIPluginManager getUIPluginManager()): init'ed(org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.instance)
    //#post(UIPluginManager getUIPluginManager()): return_value == org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.instance
    //#post(UIPluginManager getUIPluginManager()): init'ed(return_value)
    //#RollerContext.java:80: end of method: UIPluginManager org.apache.roller.weblogger.ui.core.RollerContext.getUIPluginManager()
    }
    
    
    /**
     * Get the ServletContext.
     * @return ServletContext
     */
    public static ServletContext getServletContext() {
        return servletContext;
    //#RollerContext.java:89: method: ServletContext org.apache.roller.weblogger.ui.core.RollerContext.getServletContext()
    //#input(ServletContext getServletContext()): servletContext
    //#output(ServletContext getServletContext()): return_value
    //#pre[1] (ServletContext getServletContext()): init'ed(servletContext)
    //#post(ServletContext getServletContext()): return_value == servletContext
    //#post(ServletContext getServletContext()): init'ed(return_value)
    //#RollerContext.java:89: end of method: ServletContext org.apache.roller.weblogger.ui.core.RollerContext.getServletContext()
    } 
    
    
    /**
     * Responds to app-init event and triggers startup procedures.
     */
    public void contextInitialized(ServletContextEvent sce) {
        
        // First, initialize everything that requires no database
        
        // Keep a reverence to ServletContext object
        this.servletContext = sce.getServletContext();
    //#RollerContext.java:101: method: void org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(ServletContextEvent)
    //#input(void contextInitialized(ServletContextEvent)): "&#10;--------------------------------------------------------------"._tainted
    //#input(void contextInitialized(ServletContextEvent)): "&#10;Roller Weblogger startup INCOMPLETE, user interaction required"._tainted
    //#input(void contextInitialized(ServletContextEvent)): "' not supported, disabling encryption."._tainted
    //#input(void contextInitialized(ServletContextEvent)): "'"._tainted
    //#input(void contextInitialized(ServletContextEvent)): ","._tainted
    //#input(void contextInitialized(ServletContextEvent)): "Encryption algorithm '"._tainted
    //#input(void contextInitialized(ServletContextEvent)): "Password Encryption Algorithm set to '"._tainted
    //#input(void contextInitialized(ServletContextEvent)): "Remember Me enabled: "._tainted
    //#input(void contextInitialized(ServletContextEvent)): "Velocity props = "._tainted
    //#input(void contextInitialized(ServletContextEvent)): "resources"._tainted
    //#input(void contextInitialized(ServletContextEvent)): "themes"._tainted
    //#input(void contextInitialized(ServletContextEvent)): __Descendant_Table[org/apache/roller/weblogger/ui/core/RollerContext]
    //#input(void contextInitialized(ServletContextEvent)): __Descendant_Table[others]
    //#input(void contextInitialized(ServletContextEvent)): __Dispatch_Table.initializeSecurityFeatures(Ljavax/servlet/ServletContext;)V
    //#input(void contextInitialized(ServletContextEvent)): java.io.File.separator
    //#input(void contextInitialized(ServletContextEvent)): java.io.File.separator._tainted
    //#input(void contextInitialized(ServletContextEvent)): log
    //#input(void contextInitialized(ServletContextEvent)): sce
    //#input(void contextInitialized(ServletContextEvent)): this
    //#input(void contextInitialized(ServletContextEvent)): this.__Tag
    //#output(void contextInitialized(ServletContextEvent)): servletContext
    //#pre[1] (void contextInitialized(ServletContextEvent)): log != null
    //#pre[2] (void contextInitialized(ServletContextEvent)): sce != null
    //#pre[4] (void contextInitialized(ServletContextEvent)): (soft) this.__Tag == org/apache/roller/weblogger/ui/core/RollerContext
    //#presumption(void contextInitialized(ServletContextEvent)): init'ed(java.io.File.separator)
    //#presumption(void contextInitialized(ServletContextEvent)): javax.servlet.ServletContext:getRealPath(...)@109 != null
    //#presumption(void contextInitialized(ServletContextEvent)): javax.servlet.ServletContextEvent:getServletContext(...)@101 != null
    //#presumption(void contextInitialized(ServletContextEvent)): org.apache.roller.planet.business.PlanetFactory:getPlanet(...)@187 != null
    //#presumption(void contextInitialized(ServletContextEvent)): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@159 != null
    //#post(void contextInitialized(ServletContextEvent)): (soft) servletContext != null
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.util.Properties
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:javax.servlet.ServletContext:getResourceAsStream
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.util.Properties:get
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getProperty
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.util.Properties:setProperty
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.velocity.runtime.RuntimeSingleton:init
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.roller.weblogger.WebloggerException
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.Boolean:booleanValue
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:javax.servlet.ServletContext:setAttribute
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.springframework.context.ApplicationContext:getBean
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.acegisecurity.providers.ProviderManager:getProviders
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.util.List:add
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:java.lang.String:equalsIgnoreCase
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.acegisecurity.providers.encoding.ShaPasswordEncoder
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.acegisecurity.providers.encoding.Md5PasswordEncoder
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.acegisecurity.providers.dao.DaoAuthenticationProvider:setPasswordEncoder
    //#unanalyzed(void contextInitialized(ServletContextEvent)): Effects-of-calling:org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint:setForceHttps
    //#test_vector(void contextInitialized(ServletContextEvent)): java.lang.String:endsWith(...)@110: {1}, {0}
    //#test_vector(void contextInitialized(ServletContextEvent)): org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped(...)@168: {0}, {1}
    //#test_vector(void contextInitialized(ServletContextEvent)): org.apache.roller.weblogger.business.startup.WebloggerStartup:isPrepared(...)@147: {1}, {0}
    //#test_vector(void contextInitialized(ServletContextEvent)): org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(...)@169: {0}, {1}
        
        // Call Spring's context ContextLoaderListener to initialize all the
        // context files specified in web.xml. This is necessary because
        // listeners don't initialize in the order specified in 2.3 containers
        super.contextInitialized(sce);
    //#RollerContext.java:106: Warning: method not available
    //#    -- call on void org.springframework.web.context.ContextLoaderListener:contextInitialized(ServletContextEvent)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.springframework.web.context.ContextLoaderListener:contextInitialized(ServletContextEvent)
        
        // get the *real* path to <context>/resources
        String ctxPath = servletContext.getRealPath("/");
        if(!ctxPath.endsWith(File.separator))
            ctxPath += File.separator + "resources";
        else
            ctxPath += "resources";
        
        // try setting the uploads path to <context>/resources
        // NOTE: this should go away at some point
        // we leave it here for now to allow users to keep writing
        // uploads into their webapp context, but this is a bad idea
        //
        // also, the WebloggerConfig.setUploadsDir() method is smart
        // enough to disregard this call unless the uploads.path
        // is set to ${webapp.context}
        WebloggerConfig.setUploadsDir(ctxPath);
    //#RollerContext.java:123: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.config.WebloggerConfig:setUploadsDir(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.weblogger.config.WebloggerConfig:setUploadsDir(String)
        
        // try setting the themes path to <context>/themes
        // NOTE: this should go away at some point
        // we leave it here for now to allow users to keep using
        // themes in their webapp context, but this is a bad idea
        //
        // also, the WebloggerConfig.setThemesDir() method is smart
        // enough to disregard this call unless the themes.dir
        // is set to ${webapp.context}
        WebloggerConfig.setThemesDir(servletContext.getRealPath("/")+File.separator+"themes");
    //#RollerContext.java:133: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.config.WebloggerConfig:setThemesDir(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.weblogger.config.WebloggerConfig:setThemesDir(String)
        
        
        // Now prepare the core services of the app so we can bootstrap
        try {
            WebloggerStartup.prepare();
    //#RollerContext.java:138: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.startup.WebloggerStartup:prepare()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.startup.WebloggerStartup:prepare()
        } catch (StartupException ex) {
            log.fatal("Roller Weblogger startup failed during app preparation", ex);
    //#RollerContext.java:140: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
            return;
        }
        
        
        // if preparation failed or is incomplete then we are done,
        // otherwise try to bootstrap the business tier
        if (!WebloggerStartup.isPrepared()) {
    //#RollerContext.java:147: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isPrepared()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isPrepared()
            StringBuffer buf = new StringBuffer();
            buf.append("\n--------------------------------------------------------------");
            buf.append("\nRoller Weblogger startup INCOMPLETE, user interaction required");
            buf.append("\n--------------------------------------------------------------");
            log.info(buf.toString());
    //#RollerContext.java:152: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
        } else {
            try {
                // trigger bootstrapping process
                WebloggerFactory.bootstrap();
    //#RollerContext.java:156: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.WebloggerFactory:bootstrap()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.WebloggerFactory:bootstrap()
                
                // trigger initialization process
                WebloggerFactory.getWeblogger().initialize();
    //#RollerContext.java:159: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#RollerContext.java:159: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:initialize()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:initialize()
                
            } catch (BootstrapException ex) {
                log.fatal("Roller Weblogger bootstrap failed", ex);
    //#RollerContext.java:162: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
            } catch (WebloggerException ex) {
                log.fatal("Roller Weblogger initialization failed", ex);
    //#RollerContext.java:164: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
            }
            
            // Initialize Planet if necessary
            if (WebloggerFactory.isBootstrapped()) {
    //#RollerContext.java:168: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
                if (WebloggerConfig.getBooleanProperty("planet.aggregator.enabled")) {
    //#RollerContext.java:169: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
                    
                    // Now prepare the core services of planet so we can bootstrap it
                    try {
                        PlanetStartup.prepare();
    //#RollerContext.java:173: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.startup.PlanetStartup:prepare()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.planet.business.startup.PlanetStartup:prepare()
                    } catch (Throwable ex) {
                        log.fatal("Roller Planet startup failed during app preparation", ex);
    //#RollerContext.java:175: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
                        return;
                    }
        
                    try {
                        // trigger planet bootstrapping process
                        // we need to use our own planet provider for integration
                        String guiceModule = WebloggerConfig.getProperty("planet.aggregator.guice.module");
    //#RollerContext.java:182: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
                        PlanetProvider provider = new GuicePlanetProvider(guiceModule);
    //#RollerContext.java:183: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.GuicePlanetProvider(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.planet.business.GuicePlanetProvider(String)
                        PlanetFactory.bootstrap(provider);
    //#RollerContext.java:184: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.PlanetFactory:bootstrap(PlanetProvider)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.planet.business.PlanetFactory:bootstrap(PlanetProvider)
                        
                        // and now initialize planet
                        PlanetFactory.getPlanet().initialize();
    //#RollerContext.java:187: Warning: method not available
    //#    -- call on Planet org.apache.roller.planet.business.PlanetFactory:getPlanet()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: Planet org.apache.roller.planet.business.PlanetFactory:getPlanet()
    //#RollerContext.java:187: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.Planet:initialize()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.planet.business.Planet:initialize()
                        
                    } catch (Throwable t) {
                        log.fatal("Roller Planet initialization failed", t);
    //#RollerContext.java:190: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
                    }
                }
            }
        }
        
        
        // do a small amount of work to initialize the web tier
        try {
            // Initialize Acegi based on Roller configuration
            initializeSecurityFeatures(servletContext);
            
            // Setup Velocity template engine
            setupVelocity();
        } catch (WebloggerException ex) {
            log.fatal("Error initializing Roller Weblogger web tier", ex);
    //#RollerContext.java:205: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextInitialized(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
        }
        
    }
    //#RollerContext.java:208: end of method: void org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(ServletContextEvent)
    
    
    /** 
     * Responds to app-destroy event and triggers shutdown sequence.
     */
    public void contextDestroyed(ServletContextEvent sce) {        
        WebloggerFactory.getWeblogger().shutdown();        
    //#RollerContext.java:215: method: void org.apache.roller.weblogger.ui.core.RollerContext.contextDestroyed(ServletContextEvent)
    //#RollerContext.java:215: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextDestroyed(ServletContextEvent)
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#RollerContext.java:215: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:shutdown()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void contextDestroyed(ServletContextEvent)
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:shutdown()
    //#presumption(void contextDestroyed(ServletContextEvent)): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@215 != null
        // do we need a more generic mechanism for presentation layer shutdown?
        CacheManager.shutdown();
    }
    //#RollerContext.java:218: end of method: void org.apache.roller.weblogger.ui.core.RollerContext.contextDestroyed(ServletContextEvent)
    
    
    /**
     * Initialize the Velocity rendering engine.
     */
    private void setupVelocity() throws WebloggerException {        
        log.info("Initializing Velocity");
    //#RollerContext.java:225: method: void org.apache.roller.weblogger.ui.core.RollerContext.setupVelocity()
    //#RollerContext.java:225: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void setupVelocity()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void setupVelocity()): ","._tainted
    //#input(void setupVelocity()): "Velocity props = "._tainted
    //#input(void setupVelocity()): log
    //#input(void setupVelocity()): servletContext
    //#pre[1] (void setupVelocity()): log != null
    //#pre[2] (void setupVelocity()): servletContext != null
    //#test_vector(void setupVelocity()): org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(...)@236: {0}, {1}
        
        // initialize the Velocity engine
        Properties velocityProps = new Properties();
        
        try {
            InputStream instream = servletContext.getResourceAsStream("/WEB-INF/velocity.properties");
            
            velocityProps.load(instream);
            
            // need to dynamically add old macro libraries if they are enabled
            if(WebloggerConfig.getBooleanProperty("rendering.legacyModels.enabled")) {
    //#RollerContext.java:236: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void setupVelocity()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
                String macroLibraries = (String) velocityProps.get("velocimacro.library");
                String oldLibraries = WebloggerConfig.getProperty("velocity.oldMacroLibraries");
    //#RollerContext.java:238: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void setupVelocity()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
                
                // set the new value
                velocityProps.setProperty("velocimacro.library", oldLibraries+","+macroLibraries);
            }
            
            log.debug("Velocity props = "+velocityProps);
    //#RollerContext.java:244: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void setupVelocity()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            
            // init velocity
            RuntimeSingleton.init(velocityProps);
    //#RollerContext.java:247: Warning: method not available
    //#    -- call on void org.apache.velocity.runtime.RuntimeSingleton:init(Properties)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void setupVelocity()
    //#    unanalyzed callee: void org.apache.velocity.runtime.RuntimeSingleton:init(Properties)
            
        } catch (Exception e) {
            throw new WebloggerException(e);
        }
        
    }
    //#RollerContext.java:253: end of method: void org.apache.roller.weblogger.ui.core.RollerContext.setupVelocity()
         
    /**
     * Setup Acegi security features.
     */
    protected void initializeSecurityFeatures(ServletContext context) { 

        ApplicationContext ctx =
    //#RollerContext.java:260: method: void org.apache.roller.weblogger.ui.core.RollerContext.initializeSecurityFeatures(ServletContext)
    //#RollerContext.java:260: Warning: method not available
    //#    -- call on WebApplicationContext org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext(ServletContext)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: WebApplicationContext org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext(ServletContext)
    //#input(void initializeSecurityFeatures(ServletContext)): "' not supported, disabling encryption."._tainted
    //#input(void initializeSecurityFeatures(ServletContext)): "'"._tainted
    //#input(void initializeSecurityFeatures(ServletContext)): "Encryption algorithm '"._tainted
    //#input(void initializeSecurityFeatures(ServletContext)): "Password Encryption Algorithm set to '"._tainted
    //#input(void initializeSecurityFeatures(ServletContext)): "Remember Me enabled: "._tainted
    //#input(void initializeSecurityFeatures(ServletContext)): context
    //#input(void initializeSecurityFeatures(ServletContext)): log
    //#pre[1] (void initializeSecurityFeatures(ServletContext)): context != null
    //#pre[2] (void initializeSecurityFeatures(ServletContext)): log != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): java.lang.Boolean:valueOf(...)@265 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): java.lang.Boolean:valueOf(...)@278 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): org.acegisecurity.providers.ProviderManager:getProviders(...)@273 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): org.apache.roller.weblogger.config.WebloggerConfig:getProperty(...)@283 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): org.springframework.context.ApplicationContext:getBean(...)@272 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): org.springframework.context.ApplicationContext:getBean(...)@281 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): org.springframework.context.ApplicationContext:getBean(...)@301 != null
    //#presumption(void initializeSecurityFeatures(ServletContext)): org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext(...)@260 != null
    //#test_vector(void initializeSecurityFeatures(ServletContext)): java.lang.Boolean:booleanValue(...)@265: {0}, {1}
    //#test_vector(void initializeSecurityFeatures(ServletContext)): java.lang.Boolean:booleanValue(...)@278: {0}, {1}
    //#test_vector(void initializeSecurityFeatures(ServletContext)): java.lang.String:equalsIgnoreCase(...)@285: {0}, {1}
    //#test_vector(void initializeSecurityFeatures(ServletContext)): java.lang.String:equalsIgnoreCase(...)@287: {0}, {1}
    //#test_vector(void initializeSecurityFeatures(ServletContext)): org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(...)@300: {0}, {1}
                WebApplicationContextUtils.getRequiredWebApplicationContext(context);
        

        String rememberMe = WebloggerConfig.getProperty("rememberme.enabled");
    //#RollerContext.java:264: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
        boolean rememberMeEnabled = Boolean.valueOf(rememberMe).booleanValue();
        
        log.info("Remember Me enabled: " + rememberMeEnabled);
    //#RollerContext.java:267: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
        
        context.setAttribute("rememberMeEnabled", rememberMe);
        
        if (rememberMeEnabled) {
            ProviderManager provider = (ProviderManager) ctx.getBean("authenticationManager");
    //#RollerContext.java:272: Warning: method not available
    //#    -- call on Object org.springframework.context.ApplicationContext:getBean(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: Object org.springframework.context.ApplicationContext:getBean(String)
            provider.getProviders().add(ctx.getBean("rememberMeAuthenticationProvider"));
    //#RollerContext.java:273: Warning: method not available
    //#    -- call on List org.acegisecurity.providers.ProviderManager:getProviders()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: List org.acegisecurity.providers.ProviderManager:getProviders()
    //#RollerContext.java:273: Warning: method not available
    //#    -- call on Object org.springframework.context.ApplicationContext:getBean(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: Object org.springframework.context.ApplicationContext:getBean(String)
        }
        

        String encryptPasswords = WebloggerConfig.getProperty("passwds.encryption.enabled");
    //#RollerContext.java:277: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
        boolean doEncrypt = Boolean.valueOf(encryptPasswords).booleanValue();
        
        if (doEncrypt) {
            DaoAuthenticationProvider provider =
    //#RollerContext.java:281: Warning: method not available
    //#    -- call on Object org.springframework.context.ApplicationContext:getBean(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: Object org.springframework.context.ApplicationContext:getBean(String)
                    (DaoAuthenticationProvider) ctx.getBean("daoAuthenticationProvider");
            String algorithm = WebloggerConfig.getProperty("passwds.encryption.algorithm");
    //#RollerContext.java:283: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
            PasswordEncoder encoder = null;
            if (algorithm.equalsIgnoreCase("SHA")) {
                encoder = new ShaPasswordEncoder();
    //#RollerContext.java:286: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.encoding.ShaPasswordEncoder()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.acegisecurity.providers.encoding.ShaPasswordEncoder()
            } else if (algorithm.equalsIgnoreCase("MD5")) {
                encoder = new Md5PasswordEncoder();
    //#RollerContext.java:288: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.encoding.Md5PasswordEncoder()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.acegisecurity.providers.encoding.Md5PasswordEncoder()
            } else {
                log.error("Encryption algorithm '" + algorithm +
    //#RollerContext.java:290: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object)
                        "' not supported, disabling encryption.");
            }
            if (encoder != null) {
                provider.setPasswordEncoder(encoder);
    //#RollerContext.java:294: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.dao.DaoAuthenticationProvider:setPasswordEncoder(PasswordEncoder)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.acegisecurity.providers.dao.DaoAuthenticationProvider:setPasswordEncoder(PasswordEncoder)
                log.info("Password Encryption Algorithm set to '" + algorithm + "'");
    //#RollerContext.java:295: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
            }
        }
        

        if (WebloggerConfig.getBooleanProperty("securelogin.enabled")) {
    //#RollerContext.java:300: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
            AuthenticationProcessingFilterEntryPoint entryPoint =
    //#RollerContext.java:301: Warning: method not available
    //#    -- call on Object org.springframework.context.ApplicationContext:getBean(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: Object org.springframework.context.ApplicationContext:getBean(String)
                (AuthenticationProcessingFilterEntryPoint)
                    ctx.getBean("authenticationProcessingFilterEntryPoint");
            entryPoint.setForceHttps(true);
    //#RollerContext.java:304: Warning: method not available
    //#    -- call on void org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint:setForceHttps(bool)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void initializeSecurityFeatures(ServletContext)
    //#    unanalyzed callee: void org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint:setForceHttps(bool)
        }
                
        /*
        if (WebloggerConfig.getBooleanProperty("schemeenforcement.enabled")) {
            
            ChannelProcessingFilter procfilter =
                    (ChannelProcessingFilter)ctx.getBean("channelProcessingFilter");
            ConfigAttributeDefinition secureDef = new ConfigAttributeDefinition();
            secureDef.addConfigAttribute(new SecurityConfig("REQUIRES_SECURE_CHANNEL"));
            ConfigAttributeDefinition insecureDef = new ConfigAttributeDefinition();
            insecureDef.addConfigAttribute(new SecurityConfig("REQUIRES_INSECURE_CHANNEL"));
            PathBasedFilterInvocationDefinitionMap defmap =
                    (PathBasedFilterInvocationDefinitionMap)procfilter.getFilterInvocationDefinitionSource();
            
            // add HTTPS URL path patterns to Acegi config
            String httpsUrlsProp = WebloggerConfig.getProperty("schemeenforcement.https.urls");
            if (httpsUrlsProp != null) {
                String[] httpsUrls = StringUtils.stripAll(StringUtils.split(httpsUrlsProp, ",") );
                for (int i=0; i<httpsUrls.length; i++) {
                    defmap.addSecureUrl(httpsUrls[i], secureDef);
                }
            }
            // all other action URLs are non-HTTPS
            defmap.addSecureUrl("/**<!-- need to remove this when uncommenting -->/*.do*", insecureDef);
        }
        */
    }
    //#RollerContext.java:331: end of method: void org.apache.roller.weblogger.ui.core.RollerContext.initializeSecurityFeatures(ServletContext)
    
    
    /**
     * Flush user from any caches maintained by security system.
     */
    public static void flushAuthenticationUserCache(String userName) {                                
        ApplicationContext ctx = 
    //#RollerContext.java:338: method: void org.apache.roller.weblogger.ui.core.RollerContext.flushAuthenticationUserCache(String)
    //#RollerContext.java:338: Warning: method not available
    //#    -- call on WebApplicationContext org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext(ServletContext)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void flushAuthenticationUserCache(String)
    //#    unanalyzed callee: WebApplicationContext org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext(ServletContext)
    //#input(void flushAuthenticationUserCache(String)): servletContext
    //#input(void flushAuthenticationUserCache(String)): userName
    //#pre[1] (void flushAuthenticationUserCache(String)): init'ed(servletContext)
    //#presumption(void flushAuthenticationUserCache(String)): org.springframework.web.context.support.WebApplicationContextUtils:getRequiredWebApplicationContext(...)@338 != null
    //#test_vector(void flushAuthenticationUserCache(String)): org.springframework.context.ApplicationContext:getBean(...)@340: Addr_Set{null}, Inverse{null}
            WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
        UserCache userCache = (UserCache)ctx.getBean("userCache");
    //#RollerContext.java:340: Warning: method not available
    //#    -- call on Object org.springframework.context.ApplicationContext:getBean(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void flushAuthenticationUserCache(String)
    //#    unanalyzed callee: Object org.springframework.context.ApplicationContext:getBean(String)
        if (userCache != null) {
            userCache.removeUserFromCache(userName);
    //#RollerContext.java:342: Warning: method not available
    //#    -- call on void org.acegisecurity.providers.dao.UserCache:removeUserFromCache(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: void flushAuthenticationUserCache(String)
    //#    unanalyzed callee: void org.acegisecurity.providers.dao.UserCache:removeUserFromCache(String)
        }
    }
    //#RollerContext.java:344: end of method: void org.apache.roller.weblogger.ui.core.RollerContext.flushAuthenticationUserCache(String)
 
    
    /**
     * Get an instance of AutoProvision, if available in roller.properties
     * @return AutoProvision
     */
    public static AutoProvision getAutoProvision() {        
        String clazzName = WebloggerConfig.getProperty("users.sso.autoProvision.className");
    //#RollerContext.java:352: method: AutoProvision org.apache.roller.weblogger.ui.core.RollerContext.getAutoProvision()
    //#RollerContext.java:352: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: AutoProvision getAutoProvision()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#input(AutoProvision getAutoProvision()): "IllegalAccessException while creating: "._tainted
    //#input(AutoProvision getAutoProvision()): "InstantiationException while creating: "._tainted
    //#input(AutoProvision getAutoProvision()): log
    //#input(AutoProvision getAutoProvision()): org/apache/roller/weblogger/ui/core/security/AutoProvision.__Descendant_Table[org/apache/roller/weblogger/ui/core/security/AutoProvision]
    //#input(AutoProvision getAutoProvision()): org/apache/roller/weblogger/ui/core/security/AutoProvision.__Descendant_Table[org/apache/roller/weblogger/ui/core/security/BasicUserAutoProvision]
    //#input(AutoProvision getAutoProvision()): org/apache/roller/weblogger/ui/core/security/AutoProvision.__Descendant_Table[others]
    //#output(AutoProvision getAutoProvision()): return_value
    //#pre[1] (AutoProvision getAutoProvision()): (soft) log != null
    //#presumption(AutoProvision getAutoProvision()): interfaces.length@370 <= 4_294_967_295
    //#presumption(AutoProvision getAutoProvision()): java.lang.Class:getInterfaces(...)@370 != null
    //#presumption(AutoProvision getAutoProvision()): java.lang.Class:newInstance(...).__Tag@374 in {org/apache/roller/weblogger/ui/core/security/AutoProvision, org/apache/roller/weblogger/ui/core/security/BasicUserAutoProvision}
    //#post(AutoProvision getAutoProvision()): init'ed(return_value)
    //#test_vector(AutoProvision getAutoProvision()): java.lang.Class:forName(...)@360: Inverse{null}, Addr_Set{null}
    //#test_vector(AutoProvision getAutoProvision()): java.lang.Object:equals(...)@372: {0}, {1}
    //#test_vector(AutoProvision getAutoProvision()): org.apache.roller.weblogger.config.WebloggerConfig:getProperty(...)@352: Inverse{null}, Addr_Set{null}
        
        if (null == clazzName) {
            return null;
        }
        
        Class clazz;
        try {
            clazz = Class.forName(clazzName);
        } catch (ClassNotFoundException e) {
            log.warn("Unable to found specified Auto Provision class.", e);
    //#RollerContext.java:362: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: AutoProvision getAutoProvision()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object, Throwable)
            return null;
        }
        
        if(null == clazz) {
            return null;
        }
        
        Class[] interfaces = clazz.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            if (interfaces[i].equals(AutoProvision.class)) {
    //#RollerContext.java:372: ?use of default init
    //#    init'ed(interfaces[i])
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: AutoProvision getAutoProvision()
    //#    basic block: bb_10
    //#    assertion: init'ed(interfaces[i])
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
    //#RollerContext.java:372: ?null dereference
    //#    not_init'ed(interfaces[i])
    //#    severity: MEDIUM
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: AutoProvision getAutoProvision()
    //#    basic block: bb_10
    //#    assertion: not_init'ed(interfaces[i])
    //#    VN: undefined
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
                try {
                    return (AutoProvision) clazz.newInstance();
                } catch (InstantiationException e) {
                    log.warn("InstantiationException while creating: " + clazzName, e);
    //#RollerContext.java:376: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: AutoProvision getAutoProvision()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object, Throwable)
                } catch (IllegalAccessException e) {
                    log.warn("IllegalAccessException while creating: " + clazzName, e);
    //#RollerContext.java:378: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.core.RollerContext
    //#    method: AutoProvision getAutoProvision()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object, Throwable)
                }
            }
        }        
        return null;        
    //#RollerContext.java:382: end of method: AutoProvision org.apache.roller.weblogger.ui.core.RollerContext.getAutoProvision()
    }   
}
    //#RollerContext.java:: end of class: org.apache.roller.weblogger.ui.core.RollerContext
