//# 2 errors, 818 messages
//#
/*
    //#WebloggerStartup.java:1:1: class: org.apache.roller.weblogger.business.startup.WebloggerStartup
 * 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.business.startup;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.business.DatabaseProvider;
import org.apache.roller.weblogger.business.MailProvider;
import org.apache.roller.weblogger.config.WebloggerConfig;


/**
 * Manages Roller Weblogger startup process.
 */
public final class WebloggerStartup {
    
    private static final Log log = LogFactory.getLog(WebloggerStartup.class);
    //#WebloggerStartup.java:34: method: org.apache.roller.weblogger.business.startup.WebloggerStartup.org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init
    //#WebloggerStartup.java:34: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.startup.WebloggerStartup
    //#    method: org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): __Descendant_Table[org/apache/roller/weblogger/business/startup/WebloggerStartup]
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): dbInstaller
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): dbProvider
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): dbProviderException
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): log
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): mailProvider
    //#output(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): prepared
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): __Descendant_Table[org/apache/roller/weblogger/business/startup/WebloggerStartup] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): dbInstaller == null
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): dbProvider == null
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): dbProviderException == null
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): mailProvider == null
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): init'ed(log)
    //#post(org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init): prepared == 0
    
    private static boolean prepared = false;
    
    private static DatabaseProvider dbProvider = null;
    private static StartupException dbProviderException = null;
    
    private static MailProvider mailProvider = null;
    
    private static DatabaseInstaller dbInstaller = null;
    //#WebloggerStartup.java:43: end of method: org.apache.roller.weblogger.business.startup.WebloggerStartup.org.apache.roller.weblogger.business.startup.WebloggerStartup__static_init
    
    
    // non-instantiable
    private WebloggerStartup() {}
    //#WebloggerStartup.java:47: method: void org.apache.roller.weblogger.business.startup.WebloggerStartup.org.apache.roller.weblogger.business.startup.WebloggerStartup()
    //#WebloggerStartup.java:47: end of method: void org.apache.roller.weblogger.business.startup.WebloggerStartup.org.apache.roller.weblogger.business.startup.WebloggerStartup()
    
    
    /**
     * Is the Roller Weblogger app properly prepared to be bootstrapped?
     */
    public static boolean isPrepared() {
        return prepared;
    //#WebloggerStartup.java:54: method: bool org.apache.roller.weblogger.business.startup.WebloggerStartup.isPrepared()
    //#input(bool isPrepared()): prepared
    //#output(bool isPrepared()): return_value
    //#pre[1] (bool isPrepared()): init'ed(prepared)
    //#post(bool isPrepared()): return_value == prepared
    //#post(bool isPrepared()): init'ed(return_value)
    //#WebloggerStartup.java:54: end of method: bool org.apache.roller.weblogger.business.startup.WebloggerStartup.isPrepared()
    }
    
    
    /**
     * Get a reference to the currently configured DatabaseProvider.
     *
     * @return DatabaseProvider The configured database provider.
     * @throws IllegalStateException If the app has not been properly prepared yet.
     */
    public static DatabaseProvider getDatabaseProvider() {
        if (dbProvider == null) {
    //#WebloggerStartup.java:65: method: DatabaseProvider org.apache.roller.weblogger.business.startup.WebloggerStartup.getDatabaseProvider()
    //#input(DatabaseProvider getDatabaseProvider()): dbProvider
    //#output(DatabaseProvider getDatabaseProvider()): return_value
    //#pre[1] (DatabaseProvider getDatabaseProvider()): dbProvider != null
    //#post(DatabaseProvider getDatabaseProvider()): return_value == dbProvider
    //#post(DatabaseProvider getDatabaseProvider()): return_value != null
            throw new IllegalStateException("Roller Weblogger has not been prepared yet");
        }
        return dbProvider;
    //#WebloggerStartup.java:68: end of method: DatabaseProvider org.apache.roller.weblogger.business.startup.WebloggerStartup.getDatabaseProvider()
    }
    
    
    /**
     * Get a reference to the exception thrown while instantiating the 
     * database provider, if any.
     *
     * @return StartupException Exception from db provider, or null if no exception thrown.
     */
    public static StartupException getDatabaseProviderException() {
        return dbProviderException;
    //#WebloggerStartup.java:79: method: StartupException org.apache.roller.weblogger.business.startup.WebloggerStartup.getDatabaseProviderException()
    //#input(StartupException getDatabaseProviderException()): dbProviderException
    //#output(StartupException getDatabaseProviderException()): return_value
    //#pre[1] (StartupException getDatabaseProviderException()): init'ed(dbProviderException)
    //#post(StartupException getDatabaseProviderException()): return_value == dbProviderException
    //#post(StartupException getDatabaseProviderException()): init'ed(return_value)
    //#WebloggerStartup.java:79: end of method: StartupException org.apache.roller.weblogger.business.startup.WebloggerStartup.getDatabaseProviderException()
    }
    
    
    /**
     * Get a reference to the currently configured MailProvider, if available.
     *
     * @return MailProvider The configured mail provider, or null if none configured.
     */
    public static MailProvider getMailProvider() {
        return mailProvider;
    //#WebloggerStartup.java:89: method: MailProvider org.apache.roller.weblogger.business.startup.WebloggerStartup.getMailProvider()
    //#input(MailProvider getMailProvider()): mailProvider
    //#output(MailProvider getMailProvider()): return_value
    //#pre[1] (MailProvider getMailProvider()): init'ed(mailProvider)
    //#post(MailProvider getMailProvider()): return_value == mailProvider
    //#post(MailProvider getMailProvider()): init'ed(return_value)
    //#WebloggerStartup.java:89: end of method: MailProvider org.apache.roller.weblogger.business.startup.WebloggerStartup.getMailProvider()
    }
    
    
    /**
     * Does the app need to create the database tables?
     */
    public static boolean isDatabaseCreationRequired() {
        return getDatabaseInstaller().isCreationRequired();
    //#WebloggerStartup.java:97: method: bool org.apache.roller.weblogger.business.startup.WebloggerStartup.isDatabaseCreationRequired()
    //#input(bool isDatabaseCreationRequired()): dbProvider
    //#input(bool isDatabaseCreationRequired()): dbProvider.__Tag
    //#input(bool isDatabaseCreationRequired()): dbProvider.dataSource
    //#input(bool isDatabaseCreationRequired()): dbProvider.jdbcConnectionURL
    //#input(bool isDatabaseCreationRequired()): dbProvider.props
    //#input(bool isDatabaseCreationRequired()): dbProvider.props._tainted
    //#input(bool isDatabaseCreationRequired()): dbProvider.type
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType.JDBC_PROPERTIES
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[org/apache/roller/weblogger/business/DatabaseProvider]
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[others]
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getConnection()Ljava/sql/Connection;
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcConnectionURL()Ljava/lang/String;
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getType()Lorg/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType;
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseInstaller]
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.isCreationRequired()Z
    //#input(bool isDatabaseCreationRequired()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.log
    //#output(bool isDatabaseCreationRequired()): return_value
    //#pre[1] (bool isDatabaseCreationRequired()): dbProvider != null
    //#pre[2] (bool isDatabaseCreationRequired()): dbProvider.__Tag == org/apache/roller/weblogger/business/DatabaseProvider
    //#pre[7] (bool isDatabaseCreationRequired()): init'ed(dbProvider.type)
    //#pre[3] (bool isDatabaseCreationRequired()): (soft) dbProvider.dataSource != null
    //#pre[4] (bool isDatabaseCreationRequired()): (soft) init'ed(dbProvider.jdbcConnectionURL)
    //#pre[5] (bool isDatabaseCreationRequired()): (soft) dbProvider.props != null
    //#pre[6] (bool isDatabaseCreationRequired()): (soft) dbProvider.props._tainted == 0
    //#pre[8] (bool isDatabaseCreationRequired()): (soft) org/apache/roller/weblogger/business/startup/DatabaseInstaller.log != null
    //#post(bool isDatabaseCreationRequired()): init'ed(return_value)
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.util.Properties
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.lang.Class:getResourceAsStream
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.sql.Connection:getMetaData
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.sql.DatabaseMetaData:getTables
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.sql.ResultSet:next
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.sql.ResultSet:getString
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.sql.DriverManager:getConnection
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:javax.sql.DataSource:getConnection
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.sql.Connection:close
    //#unanalyzed(bool isDatabaseCreationRequired()): Effects-of-calling:java.lang.RuntimeException
    //#WebloggerStartup.java:97: end of method: bool org.apache.roller.weblogger.business.startup.WebloggerStartup.isDatabaseCreationRequired()
    }
    
    
    /**
     * Run database creation scripts.
     */
    public static List<String> createDatabase() throws StartupException {
        
        DatabaseInstaller installer = getDatabaseInstaller();
    //#WebloggerStartup.java:106: method: List org.apache.roller.weblogger.business.startup.WebloggerStartup.createDatabase()
    //#input(List createDatabase()): " "._tainted
    //#input(List createDatabase()): ""._tainted
    //#input(List createDatabase()): "')"._tainted
    //#input(List createDatabase()): ".createdb.sql"._tainted
    //#input(List createDatabase()): ".dbscripts."._tainted
    //#input(List createDatabase()): "ERROR: SQLException executing SQL ["._tainted
    //#input(List createDatabase()): "Set database verstion to "._tainted
    //#input(List createDatabase()): "] : "._tainted
    //#input(List createDatabase()): "db2"._tainted
    //#input(List createDatabase()): "derby"._tainted
    //#input(List createDatabase()): "hsqldb"._tainted
    //#input(List createDatabase()): "insert into roller_properties values('roller.database.version', '"._tainted
    //#input(List createDatabase()): "mssql"._tainted
    //#input(List createDatabase()): "mysql"._tainted
    //#input(List createDatabase()): "oracle"._tainted
    //#input(List createDatabase()): "postgresql"._tainted
    //#input(List createDatabase()): dbProvider
    //#input(List createDatabase()): dbProvider.__Tag
    //#input(List createDatabase()): dbProvider.dataSource
    //#input(List createDatabase()): dbProvider.jdbcConnectionURL
    //#input(List createDatabase()): dbProvider.props
    //#input(List createDatabase()): dbProvider.props._tainted
    //#input(List createDatabase()): dbProvider.type
    //#input(List createDatabase()): org/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType.JDBC_PROPERTIES
    //#input(List createDatabase()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[org/apache/roller/weblogger/business/DatabaseProvider]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[others]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getConnection()Ljava/sql/Connection;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcConnectionURL()Ljava/lang/String;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getType()Lorg/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.__Dispatch_Table.getDatabaseScript(Ljava/lang/String;)Ljava/io/InputStream;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseInstaller]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[others]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.createDatabase()V
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.getDatabaseHandle(Ljava/sql/Connection;)Ljava/lang/String;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.getMessages()Ljava/util/List;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.log
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseScriptProvider]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[others]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Dispatch_Table.getDatabaseScript(Ljava/lang/String;)Ljava/io/InputStream;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Descendant_Table[org/apache/roller/weblogger/business/startup/SQLScriptRunner]
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Dispatch_Table.getMessages()Ljava/util/List;
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Dispatch_Table.runScript(Ljava/sql/Connection;Z)V
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.log
    //#input(List createDatabase()): org/apache/roller/weblogger/business/startup/StartupException.java.util.Collections.EMPTY_LIST
    //#output(List createDatabase()): new ArrayList(DatabaseInstaller#1) num objects
    //#output(List createDatabase()): prepared
    //#output(List createDatabase()): return_value
    //#new obj(List createDatabase()): new ArrayList(DatabaseInstaller#1)
    //#pre[1] (List createDatabase()): dbProvider != null
    //#pre[2] (List createDatabase()): dbProvider.__Tag == org/apache/roller/weblogger/business/DatabaseProvider
    //#pre[7] (List createDatabase()): init'ed(dbProvider.type)
    //#pre[9] (List createDatabase()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.log != null
    //#pre[3] (List createDatabase()): (soft) dbProvider.dataSource != null
    //#pre[4] (List createDatabase()): (soft) init'ed(dbProvider.jdbcConnectionURL)
    //#pre[5] (List createDatabase()): (soft) dbProvider.props != null
    //#pre[6] (List createDatabase()): (soft) dbProvider.props._tainted == 0
    //#pre[8] (List createDatabase()): (soft) org/apache/roller/weblogger/business/startup/DatabaseInstaller.log != null
    //#presumption(List createDatabase()): java.util.Properties:getProperty(...)@65 != null
    //#post(List createDatabase()): prepared == 1
    //#post(List createDatabase()): return_value == &new ArrayList(DatabaseInstaller#1)
    //#post(List createDatabase()): new ArrayList(DatabaseInstaller#1) num objects == 1
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.Properties
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.Class:getResourceAsStream
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(List createDatabase()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.Connection:getMetaData
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.DriverManager:getConnection
    //#unanalyzed(List createDatabase()): Effects-of-calling:javax.sql.DataSource:getConnection
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.Connection:close
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.List:add
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:replaceAll
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:length
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.Connection:createStatement
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.Statement:executeUpdate
    //#unanalyzed(List createDatabase()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(List createDatabase()): Effects-of-calling:org.apache.roller.weblogger.WebloggerException
    //#unanalyzed(List createDatabase()): Effects-of-calling:org.apache.roller.RollerException
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.DatabaseMetaData:getDatabaseProductName
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(List createDatabase()): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(List createDatabase()): Effects-of-calling:getDatabaseScript
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.InputStreamReader
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.BufferedReader
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.BufferedReader:readLine
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.lang.String:endsWith
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.BufferedReader:close
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.Connection:getAutoCommit
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.Connection:commit
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.SQLException:getLocalizedMessage
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.StringWriter
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.PrintWriter
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.sql.SQLException:printStackTrace
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.io.StringWriter:toString
    //#unanalyzed(List createDatabase()): Effects-of-calling:java.util.List:addAll
        try {
            installer.createDatabase();
            
            // any time we've successfully installed a db we are prepared
            prepared = true;
            
        } catch (StartupException se) {
            throw new StartupException(se.getMessage(), se.getRootCause(), installer.getMessages());
        }
        
        return installer.getMessages();
    //#WebloggerStartup.java:117: end of method: List org.apache.roller.weblogger.business.startup.WebloggerStartup.createDatabase()
    }
    
    
    /**
     * Does the app require any upgrading?
     */
    public static boolean isDatabaseUpgradeRequired() {
        return getDatabaseInstaller().isUpgradeRequired();
    //#WebloggerStartup.java:125: method: bool org.apache.roller.weblogger.business.startup.WebloggerStartup.isDatabaseUpgradeRequired()
    //#input(bool isDatabaseUpgradeRequired()): "')"._tainted
    //#input(bool isDatabaseUpgradeRequired()): "Set database verstion to "._tainted
    //#input(bool isDatabaseUpgradeRequired()): "insert into roller_properties values('roller.database.version', '"._tainted
    //#input(bool isDatabaseUpgradeRequired()): dbProvider
    //#input(bool isDatabaseUpgradeRequired()): dbProvider.__Tag
    //#input(bool isDatabaseUpgradeRequired()): dbProvider.dataSource
    //#input(bool isDatabaseUpgradeRequired()): dbProvider.jdbcConnectionURL
    //#input(bool isDatabaseUpgradeRequired()): dbProvider.props
    //#input(bool isDatabaseUpgradeRequired()): dbProvider.props._tainted
    //#input(bool isDatabaseUpgradeRequired()): dbProvider.type
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType.JDBC_PROPERTIES
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[org/apache/roller/weblogger/business/DatabaseProvider]
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[others]
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getConnection()Ljava/sql/Connection;
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcConnectionURL()Ljava/lang/String;
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getType()Lorg/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType;
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseInstaller]
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.isUpgradeRequired()Z
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.log
    //#input(bool isDatabaseUpgradeRequired()): org/apache/roller/weblogger/business/startup/StartupException.java.util.Collections.EMPTY_LIST
    //#output(bool isDatabaseUpgradeRequired()): return_value
    //#pre[1] (bool isDatabaseUpgradeRequired()): dbProvider != null
    //#pre[2] (bool isDatabaseUpgradeRequired()): (soft) dbProvider.__Tag == org/apache/roller/weblogger/business/DatabaseProvider
    //#pre[3] (bool isDatabaseUpgradeRequired()): (soft) dbProvider.dataSource != null
    //#pre[4] (bool isDatabaseUpgradeRequired()): (soft) init'ed(dbProvider.jdbcConnectionURL)
    //#pre[5] (bool isDatabaseUpgradeRequired()): (soft) dbProvider.props != null
    //#pre[6] (bool isDatabaseUpgradeRequired()): (soft) dbProvider.props._tainted == 0
    //#pre[7] (bool isDatabaseUpgradeRequired()): (soft) init'ed(dbProvider.type)
    //#pre[8] (bool isDatabaseUpgradeRequired()): (soft) org/apache/roller/weblogger/business/startup/DatabaseInstaller.log != null
    //#presumption(bool isDatabaseUpgradeRequired()): java.util.Properties:getProperty(...)@65 != null
    //#post(bool isDatabaseUpgradeRequired()): init'ed(return_value)
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.util.Properties
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.Class:getResourceAsStream
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.ResultSet:next
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.DriverManager:getConnection
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:javax.sql.DataSource:getConnection
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.Connection:close
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.util.List:add
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.String:replaceAll
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.String:length
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.Connection:createStatement
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.Statement:executeUpdate
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:org.apache.roller.weblogger.WebloggerException
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:org.apache.roller.RollerException
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:getDatabaseVersion
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.lang.RuntimeException
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.ResultSet:getString
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.Statement:executeQuery
    //#unanalyzed(bool isDatabaseUpgradeRequired()): Effects-of-calling:java.sql.ResultSet:getInt
    //#WebloggerStartup.java:125: end of method: bool org.apache.roller.weblogger.business.startup.WebloggerStartup.isDatabaseUpgradeRequired()
    }
    
    
    /**
     * Run database upgrade work, optionally including upgrade scripts.
     */
    public static List<String> upgradeDatabase(boolean runScripts) 
            throws StartupException {
        
        DatabaseInstaller installer = getDatabaseInstaller();
    //#WebloggerStartup.java:135: method: List org.apache.roller.weblogger.business.startup.WebloggerStartup.upgradeDatabase(bool)
    //#input(List upgradeDatabase(bool)): " "._tainted
    //#input(List upgradeDatabase(bool)): " Lx category paths"._tainted
    //#input(List upgradeDatabase(bool)): " Lx folder paths"._tainted
    //#input(List upgradeDatabase(bool)): " for websites with no locale"._tainted
    //#input(List upgradeDatabase(bool)): ""._tainted
    //#input(List upgradeDatabase(bool)): "'"._tainted
    //#input(List upgradeDatabase(bool)): "."._tainted
    //#input(List upgradeDatabase(bool)): ".120-to-130-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".130-to-200-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".200-to-210-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".210-to-230-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".230-to-240-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".240-to-300-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".300-to-310-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".310-to-400-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".400-to-401-migration.sql"._tainted
    //#input(List upgradeDatabase(bool)): ".dbscripts."._tainted
    //#input(List upgradeDatabase(bool)): "Database is old, beginning upgrade to version "._tainted
    //#input(List upgradeDatabase(bool)): "Database version = "._tainted
    //#input(List upgradeDatabase(bool)): "Desired version = "._tainted
    //#input(List upgradeDatabase(bool)): "ERROR: SQLException executing SQL ["._tainted
    //#input(List upgradeDatabase(bool)): "Processing website: "._tainted
    //#input(List upgradeDatabase(bool)): "Running database upgrade script: "._tainted
    //#input(List upgradeDatabase(bool)): "Setting website locale to "._tainted
    //#input(List upgradeDatabase(bool)): "Updated "._tainted
    //#input(List upgradeDatabase(bool)): "Updated database verstion to "._tainted
    //#input(List upgradeDatabase(bool)): "] : "._tainted
    //#input(List upgradeDatabase(bool)): "db2"._tainted
    //#input(List upgradeDatabase(bool)): "delete from rag_group where handle = 'external'"._tainted
    //#input(List upgradeDatabase(bool)): "derby"._tainted
    //#input(List upgradeDatabase(bool)): "hsqldb"._tainted
    //#input(List upgradeDatabase(bool)): "insert into roller_properties(name,value) values(?,?)"._tainted
    //#input(List upgradeDatabase(bool)): "insert into roller_user_permissions (id, website_id, user_id, permission_mask, pending) values (?,?,?,?,?)"._tainted
    //#input(List upgradeDatabase(bool)): "insert into webpage(id, name, description, link, websiteid, template, updatetime) values(?,?,?,?,?,?,?)"._tainted
    //#input(List upgradeDatabase(bool)): "mssql"._tainted
    //#input(List upgradeDatabase(bool)): "mysql"._tainted
    //#input(List upgradeDatabase(bool)): "oracle"._tainted
    //#input(List upgradeDatabase(bool)): "p"._tainted
    //#input(List upgradeDatabase(bool)): "postgresql"._tainted
    //#input(List upgradeDatabase(bool)): "q"._tainted
    //#input(List upgradeDatabase(bool)): "roller.database.version"._tainted
    //#input(List upgradeDatabase(bool)): "select categoryid, ancestorid from weblogcategoryassoc where relation='PARENT'"._tainted
    //#input(List upgradeDatabase(bool)): "select f.id, f.name from folder f, folder p where f.parentid = p.id and p.parentid is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "select f.id, f.name from weblogcategory f, weblogcategory p where f.parentid = p.id and p.parentid is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "select f.id, f.name, p.path from folder f, folder p where f.parentid = p.id and p.path <> '.' and p.path is not NULL and f.path is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "select f.id, f.name, p.path from weblogcategory f, weblogcategory p wh ... tid = p.id and p.path <> '.' and p.path is not NULL and f.path is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "select folderid, ancestorid from folderassoc where relation='PARENT'"._tainted
    //#input(List upgradeDatabase(bool)): "select id from rag_group where handle = 'all'"._tainted
    //#input(List upgradeDatabase(bool)): "select id from rag_group where handle = 'external'"._tainted
    //#input(List upgradeDatabase(bool)): "select id from webpage where websiteid = ? and link = 'Weblog'"._tainted
    //#input(List upgradeDatabase(bool)): "select id,feed_url,author from rag_subscription"._tainted
    //#input(List upgradeDatabase(bool)): "select value from roller_properties where name = 'site.absoluteurl'"._tainted
    //#input(List upgradeDatabase(bool)): "select value from roller_properties where name = 'users.comments.autoformat'"._tainted
    //#input(List upgradeDatabase(bool)): "select value from roller_properties where name = 'users.comments.escapehtml'"._tainted
    //#input(List upgradeDatabase(bool)): "select w.id as wid, u.id as uid, u.username as uname from website as w, rolleruser as u where u.id=w.userid"._tainted
    //#input(List upgradeDatabase(bool)): "select weblogentry.id,website.locale from weblogentry,website where weblogentry.websiteid = website.id"._tainted
    //#input(List upgradeDatabase(bool)): "select website.id,template,website.handle from website,webpage where webpage.id = website.defaultpageid and webpage.link != 'Weblog'"._tainted
    //#input(List upgradeDatabase(bool)): "update folder set parentid=? where id=?"._tainted
    //#input(List upgradeDatabase(bool)): "update folder set path = '.' where parentid is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "update folder set path=? where id=?"._tainted
    //#input(List upgradeDatabase(bool)): "update rag_group set handle = 'all' where handle = 'external'"._tainted
    //#input(List upgradeDatabase(bool)): "update rag_group_subscription set group_id = ? where group_id = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update rag_subscription set last_updated=last_updated, feed_url = ? where id = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update roller_comment set posttime=posttime, contenttype = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update roller_comment set posttime=posttime, plugins = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update roller_properties set value = '"._tainted
    //#input(List upgradeDatabase(bool)): "update weblogcategory set parentid=? where id=?"._tainted
    //#input(List upgradeDatabase(bool)): "update weblogcategory set path = '.' where parentid is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "update weblogcategory set path=? where id=?"._tainted
    //#input(List upgradeDatabase(bool)): "update weblogentry set locale = ? where id = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update weblogentry set userid=?, status=?, pubtime=pubtime, updatetime=updatetime where publishentry=? and websiteid=?"._tainted
    //#input(List upgradeDatabase(bool)): "update webpage set template = ? where id = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update website set defaultpageid = ? where id = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update website set editortheme = ?"._tainted
    //#input(List upgradeDatabase(bool)): "update website set handle=? where id=?"._tainted
    //#input(List upgradeDatabase(bool)): "update website set locale = ? where locale = ''"._tainted
    //#input(List upgradeDatabase(bool)): "update website set locale = ? where locale is NULL"._tainted
    //#input(List upgradeDatabase(bool)): "weblogger:"._tainted
    //#input(List upgradeDatabase(bool)): "where name = '"._tainted
    //#input(List upgradeDatabase(bool)): dbProvider
    //#input(List upgradeDatabase(bool)): dbProvider.__Tag
    //#input(List upgradeDatabase(bool)): dbProvider.dataSource
    //#input(List upgradeDatabase(bool)): dbProvider.jdbcConnectionURL
    //#input(List upgradeDatabase(bool)): dbProvider.props
    //#input(List upgradeDatabase(bool)): dbProvider.props._tainted
    //#input(List upgradeDatabase(bool)): dbProvider.type
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType.JDBC_PROPERTIES
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[org/apache/roller/weblogger/business/DatabaseProvider]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[others]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getConnection()Ljava/sql/Connection;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcConnectionURL()Ljava/lang/String;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getType()Lorg/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.__Dispatch_Table.getDatabaseScript(Ljava/lang/String;)Ljava/io/InputStream;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseInstaller]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[others]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.getDatabaseHandle(Ljava/sql/Connection;)Ljava/lang/String;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.getMessages()Ljava/util/List;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.upgradeDatabase(Z)V
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.log
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseInstaller.org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseScriptProvider]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[others]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Dispatch_Table.getDatabaseScript(Ljava/lang/String;)Ljava/io/InputStream;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Descendant_Table[org/apache/roller/weblogger/business/startup/SQLScriptRunner]
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Dispatch_Table.getMessages()Ljava/util/List;
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Dispatch_Table.runScript(Ljava/sql/Connection;Z)V
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/SQLScriptRunner.log
    //#input(List upgradeDatabase(bool)): org/apache/roller/weblogger/business/startup/StartupException.java.util.Collections.EMPTY_LIST
    //#output(List upgradeDatabase(bool)): new ArrayList(DatabaseInstaller#1) num objects
    //#output(List upgradeDatabase(bool)): prepared
    //#output(List upgradeDatabase(bool)): return_value
    //#new obj(List upgradeDatabase(bool)): new ArrayList(DatabaseInstaller#1)
    //#pre[1] (List upgradeDatabase(bool)): dbProvider != null
    //#pre[2] (List upgradeDatabase(bool)): (soft) dbProvider.__Tag == org/apache/roller/weblogger/business/DatabaseProvider
    //#pre[3] (List upgradeDatabase(bool)): (soft) dbProvider.dataSource != null
    //#pre[4] (List upgradeDatabase(bool)): (soft) init'ed(dbProvider.jdbcConnectionURL)
    //#pre[5] (List upgradeDatabase(bool)): (soft) dbProvider.props != null
    //#pre[6] (List upgradeDatabase(bool)): (soft) dbProvider.props._tainted == 0
    //#pre[7] (List upgradeDatabase(bool)): (soft) init'ed(dbProvider.type)
    //#pre[8] (List upgradeDatabase(bool)): (soft) org/apache/roller/weblogger/business/startup/DatabaseInstaller.log != null
    //#pre[9] (List upgradeDatabase(bool)): (soft) org/apache/roller/weblogger/business/startup/SQLScriptRunner.log != null
    //#presumption(List upgradeDatabase(bool)): java.util.Properties:getProperty(...)@65 != null
    //#post(List upgradeDatabase(bool)): prepared == 1
    //#post(List upgradeDatabase(bool)): return_value == &new ArrayList(DatabaseInstaller#1)
    //#post(List upgradeDatabase(bool)): new ArrayList(DatabaseInstaller#1) num objects == 1
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Properties
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.Class:getResourceAsStream
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Connection:getMetaData
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.ResultSet:next
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.ResultSet:getString
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.DriverManager:getConnection
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:javax.sql.DataSource:getConnection
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Connection:close
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.List:add
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:replaceAll
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Connection:createStatement
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Statement:executeUpdate
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:org.apache.roller.weblogger.WebloggerException
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:org.apache.roller.RollerException
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.DatabaseMetaData:getDatabaseProductName
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:getDatabaseScript
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.InputStreamReader
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.BufferedReader
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.BufferedReader:readLine
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.lang.String:endsWith
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.BufferedReader:close
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Connection:getAutoCommit
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Connection:commit
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.SQLException:getLocalizedMessage
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.StringWriter
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.PrintWriter
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.SQLException:printStackTrace
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.io.StringWriter:toString
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.List:addAll
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Statement:executeQuery
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.ResultSet:getInt
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:org.apache.commons.logging.Log:trace
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Connection:prepareStatement
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:executeQuery
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:clearParameters
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:setString
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:executeUpdate
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Date
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Date:getTime
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.Date
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:setDate
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:setBoolean
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.sql.PreparedStatement:setShort
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:upgradeTo300
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Locale:getDefault
    //#unanalyzed(List upgradeDatabase(bool)): Effects-of-calling:java.util.Locale:getLanguage
        try {
            installer.upgradeDatabase(true);
            
            // any time we've successfully upgraded a db we are prepared
            prepared = true;
            
        } catch (StartupException se) {
            throw new StartupException(se.getMessage(), se.getRootCause(), installer.getMessages());
        }
        
        return installer.getMessages();
    //#WebloggerStartup.java:146: end of method: List org.apache.roller.weblogger.business.startup.WebloggerStartup.upgradeDatabase(bool)
    }
    
    
    /**
     * Get a database installer.
     *
     * @return DatabaseInstaller A database installer.
     * @throws IllegalStateException If the database provider has not been properly setup yet.
     */
    private static DatabaseInstaller getDatabaseInstaller() {
        return new DatabaseInstaller(getDatabaseProvider(), new ClasspathDatabaseScriptProvider());
    //#WebloggerStartup.java:157: method: DatabaseInstaller org.apache.roller.weblogger.business.startup.WebloggerStartup.getDatabaseInstaller()
    //#input(DatabaseInstaller getDatabaseInstaller()): dbProvider
    //#input(DatabaseInstaller getDatabaseInstaller()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.log
    //#output(DatabaseInstaller getDatabaseInstaller()): new ArrayList(DatabaseInstaller#1) num objects
    //#output(DatabaseInstaller getDatabaseInstaller()): new ClasspathDatabaseScriptProvider(getDatabaseInstaller#2) num objects
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value.scripts.__Tag
    //#output(DatabaseInstaller getDatabaseInstaller()): new DatabaseInstaller(getDatabaseInstaller#1) num objects
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value.__Tag
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value.db
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value.messages
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value.scripts
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value.version
    //#output(DatabaseInstaller getDatabaseInstaller()): return_value
    //#new obj(DatabaseInstaller getDatabaseInstaller()): new ArrayList(DatabaseInstaller#1)
    //#new obj(DatabaseInstaller getDatabaseInstaller()): new ClasspathDatabaseScriptProvider(getDatabaseInstaller#2)
    //#new obj(DatabaseInstaller getDatabaseInstaller()): new DatabaseInstaller(getDatabaseInstaller#1)
    //#pre[1] (DatabaseInstaller getDatabaseInstaller()): dbProvider != null
    //#pre[2] (DatabaseInstaller getDatabaseInstaller()): (soft) org/apache/roller/weblogger/business/startup/DatabaseInstaller.log != null
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value == &new DatabaseInstaller(getDatabaseInstaller#1)
    //#post(DatabaseInstaller getDatabaseInstaller()): new ArrayList(DatabaseInstaller#1) num objects == 1
    //#post(DatabaseInstaller getDatabaseInstaller()): new ClasspathDatabaseScriptProvider(getDatabaseInstaller#2) num objects == 1
    //#post(DatabaseInstaller getDatabaseInstaller()): new DatabaseInstaller(getDatabaseInstaller#1) num objects == 1
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value.scripts.__Tag == org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value.__Tag == org/apache/roller/weblogger/business/startup/DatabaseInstaller
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value.db == dbProvider
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value.db != null
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value.messages == &new ArrayList(DatabaseInstaller#1)
    //#post(DatabaseInstaller getDatabaseInstaller()): return_value.scripts == &new ClasspathDatabaseScriptProvider(getDatabaseInstaller#2)
    //#post(DatabaseInstaller getDatabaseInstaller()): init'ed(return_value.version)
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.util.Properties
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.lang.Class:getResourceAsStream
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(DatabaseInstaller getDatabaseInstaller()): Effects-of-calling:java.util.Properties:getProperty
    //#WebloggerStartup.java:157: end of method: DatabaseInstaller org.apache.roller.weblogger.business.startup.WebloggerStartup.getDatabaseInstaller()
    }
    
    
    /**
     * Run the Roller Weblogger preparation sequence.
     *
     * This sequence is what prepares the core services of the application such
     * as setting up the database and mail providers.
     */
    public static void prepare() throws StartupException {
        
        // setup database provider
        try {
            dbProvider = new DatabaseProvider();
    //#WebloggerStartup.java:171: method: void org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare()
    //#input(void prepare()): " "._tainted
    //#input(void prepare()): " Lx category paths"._tainted
    //#input(void prepare()): " Lx folder paths"._tainted
    //#input(void prepare()): " for websites with no locale"._tainted
    //#input(void prepare()): ""._tainted
    //#input(void prepare()): "'"._tainted
    //#input(void prepare()): "')"._tainted
    //#input(void prepare()): "-- Using JDBC connection URL: "._tainted
    //#input(void prepare()): "-- Using JDBC driver class: "._tainted
    //#input(void prepare()): "-- Using JDBC username: "._tainted
    //#input(void prepare()): "-- Using JNDI datasource name: "._tainted
    //#input(void prepare()): "."._tainted
    //#input(void prepare()): ".120-to-130-migration.sql"._tainted
    //#input(void prepare()): ".130-to-200-migration.sql"._tainted
    //#input(void prepare()): ".200-to-210-migration.sql"._tainted
    //#input(void prepare()): ".210-to-230-migration.sql"._tainted
    //#input(void prepare()): ".230-to-240-migration.sql"._tainted
    //#input(void prepare()): ".240-to-300-migration.sql"._tainted
    //#input(void prepare()): ".300-to-310-migration.sql"._tainted
    //#input(void prepare()): ".310-to-400-migration.sql"._tainted
    //#input(void prepare()): ".400-to-401-migration.sql"._tainted
    //#input(void prepare()): ".dbscripts."._tainted
    //#input(void prepare()): "="._tainted
    //#input(void prepare()): "Database is old, beginning upgrade to version "._tainted
    //#input(void prepare()): "Database version = "._tainted
    //#input(void prepare()): "Desired version = "._tainted
    //#input(void prepare()): "ERROR looking up mail-session with JNDI name: "._tainted
    //#input(void prepare()): "ERROR: SQLException executing SQL ["._tainted
    //#input(void prepare()): "ERROR: cannot load JDBC driver class ["._tainted
    //#input(void prepare()): "ERROR: cannot locate JNDI DataSource ["._tainted
    //#input(void prepare()): "Failed to setup mail provider, continuing anways.&#10;Reason: "._tainted
    //#input(void prepare()): "Fetching property ["._tainted
    //#input(void prepare()): "Likely problem: JDBC driver jar missing from server classpath."._tainted
    //#input(void prepare()): "Likely problem: no DataSource or datasource is misconfigured."._tainted
    //#input(void prepare()): "Processing website: "._tainted
    //#input(void prepare()): "Running database upgrade script: "._tainted
    //#input(void prepare()): "SUCCESS: Got parameters. Using configuration type "._tainted
    //#input(void prepare()): "SUCCESS: loaded JDBC driver class ["._tainted
    //#input(void prepare()): "SUCCESS: located JNDI DataSource ["._tainted
    //#input(void prepare()): "Set database verstion to "._tainted
    //#input(void prepare()): "Setting website locale to "._tainted
    //#input(void prepare()): "Updated "._tainted
    //#input(void prepare()): "Updated database verstion to "._tainted
    //#input(void prepare()): "] : "._tainted
    //#input(void prepare()): "]"._tainted
    //#input(void prepare()): "]. "._tainted
    //#input(void prepare()): "database.configurationType"._tainted
    //#input(void prepare()): "database.jdbc.connectionURL"._tainted
    //#input(void prepare()): "database.jdbc.driverClass"._tainted
    //#input(void prepare()): "database.jdbc.password"._tainted
    //#input(void prepare()): "database.jdbc.username"._tainted
    //#input(void prepare()): "database.jndi.name"._tainted
    //#input(void prepare()): "db2"._tainted
    //#input(void prepare()): "delete from rag_group where handle = 'external'"._tainted
    //#input(void prepare()): "derby"._tainted
    //#input(void prepare()): "hsqldb"._tainted
    //#input(void prepare()): "insert into roller_properties values('roller.database.version', '"._tainted
    //#input(void prepare()): "insert into roller_properties(name,value) values(?,?)"._tainted
    //#input(void prepare()): "insert into roller_user_permissions (id, website_id, user_id, permission_mask, pending) values (?,?,?,?,?)"._tainted
    //#input(void prepare()): "insert into webpage(id, name, description, link, websiteid, template, updatetime) values(?,?,?,?,?,?,?)"._tainted
    //#input(void prepare()): "installation.type"._tainted
    //#input(void prepare()): "java:comp.env."._tainted
    //#input(void prepare()): "mail.configurationType"._tainted
    //#input(void prepare()): "mail.hostname"._tainted
    //#input(void prepare()): "mail.jndi.name"._tainted
    //#input(void prepare()): "mail.password"._tainted
    //#input(void prepare()): "mail.port"._tainted
    //#input(void prepare()): "mail.username"._tainted
    //#input(void prepare()): "mssql"._tainted
    //#input(void prepare()): "mysql"._tainted
    //#input(void prepare()): "oracle"._tainted
    //#input(void prepare()): "p"._tainted
    //#input(void prepare()): "postgresql"._tainted
    //#input(void prepare()): "q"._tainted
    //#input(void prepare()): "roller.database.version"._tainted
    //#input(void prepare()): "select categoryid, ancestorid from weblogcategoryassoc where relation='PARENT'"._tainted
    //#input(void prepare()): "select f.id, f.name from folder f, folder p where f.parentid = p.id and p.parentid is NULL"._tainted
    //#input(void prepare()): "select f.id, f.name from weblogcategory f, weblogcategory p where f.parentid = p.id and p.parentid is NULL"._tainted
    //#input(void prepare()): "select f.id, f.name, p.path from folder f, folder p where f.parentid = p.id and p.path <> '.' and p.path is not NULL and f.path is NULL"._tainted
    //#input(void prepare()): "select f.id, f.name, p.path from weblogcategory f, weblogcategory p wh ... tid = p.id and p.path <> '.' and p.path is not NULL and f.path is NULL"._tainted
    //#input(void prepare()): "select folderid, ancestorid from folderassoc where relation='PARENT'"._tainted
    //#input(void prepare()): "select id from rag_group where handle = 'all'"._tainted
    //#input(void prepare()): "select id from rag_group where handle = 'external'"._tainted
    //#input(void prepare()): "select id from webpage where websiteid = ? and link = 'Weblog'"._tainted
    //#input(void prepare()): "select id,feed_url,author from rag_subscription"._tainted
    //#input(void prepare()): "select value from roller_properties where name = 'site.absoluteurl'"._tainted
    //#input(void prepare()): "select value from roller_properties where name = 'users.comments.autoformat'"._tainted
    //#input(void prepare()): "select value from roller_properties where name = 'users.comments.escapehtml'"._tainted
    //#input(void prepare()): "select w.id as wid, u.id as uid, u.username as uname from website as w, rolleruser as u where u.id=w.userid"._tainted
    //#input(void prepare()): "select weblogentry.id,website.locale from weblogentry,website where weblogentry.websiteid = website.id"._tainted
    //#input(void prepare()): "select website.id,template,website.handle from website,webpage where webpage.id = website.defaultpageid and webpage.link != 'Weblog'"._tainted
    //#input(void prepare()): "update folder set parentid=? where id=?"._tainted
    //#input(void prepare()): "update folder set path = '.' where parentid is NULL"._tainted
    //#input(void prepare()): "update folder set path=? where id=?"._tainted
    //#input(void prepare()): "update rag_group set handle = 'all' where handle = 'external'"._tainted
    //#input(void prepare()): "update rag_group_subscription set group_id = ? where group_id = ?"._tainted
    //#input(void prepare()): "update rag_subscription set last_updated=last_updated, feed_url = ? where id = ?"._tainted
    //#input(void prepare()): "update roller_comment set posttime=posttime, contenttype = ?"._tainted
    //#input(void prepare()): "update roller_comment set posttime=posttime, plugins = ?"._tainted
    //#input(void prepare()): "update roller_properties set value = '"._tainted
    //#input(void prepare()): "update weblogcategory set parentid=? where id=?"._tainted
    //#input(void prepare()): "update weblogcategory set path = '.' where parentid is NULL"._tainted
    //#input(void prepare()): "update weblogcategory set path=? where id=?"._tainted
    //#input(void prepare()): "update weblogentry set locale = ? where id = ?"._tainted
    //#input(void prepare()): "update weblogentry set userid=?, status=?, pubtime=pubtime, updatetime=updatetime where publishentry=? and websiteid=?"._tainted
    //#input(void prepare()): "update webpage set template = ? where id = ?"._tainted
    //#input(void prepare()): "update website set defaultpageid = ? where id = ?"._tainted
    //#input(void prepare()): "update website set editortheme = ?"._tainted
    //#input(void prepare()): "update website set handle=? where id=?"._tainted
    //#input(void prepare()): "update website set locale = ? where locale = ''"._tainted
    //#input(void prepare()): "update website set locale = ? where locale is NULL"._tainted
    //#input(void prepare()): "weblogger:"._tainted
    //#input(void prepare()): "where name = '"._tainted
    //#input(void prepare()): dbProvider.__Tag
    //#input(void prepare()): dbProvider.dataSource
    //#input(void prepare()): dbProvider.jdbcConnectionURL
    //#input(void prepare()): dbProvider.props._tainted
    //#input(void prepare()): dbProvider.type
    //#input(void prepare()): log
    //#input(void prepare()): org.apache.roller.weblogger.business.DatabaseProvider$ConfigurationType__static_init.new DatabaseProvider$ConfigurationType(DatabaseProvider$ConfigurationType__static_init#1)._tainted
    //#input(void prepare()): org.apache.roller.weblogger.business.DatabaseProvider$ConfigurationType__static_init.new DatabaseProvider$ConfigurationType(DatabaseProvider$ConfigurationType__static_init#2)._tainted
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType.JDBC_PROPERTIES
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType.JNDI_NAME
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[org/apache/roller/weblogger/business/DatabaseProvider]
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Descendant_Table[others]
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getConnection()Ljava/sql/Connection;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcConnectionURL()Ljava/lang/String;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcDriverClass()Ljava/lang/String;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcPassword()Ljava/lang/String;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJdbcUsername()Ljava/lang/String;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getJndiName()Ljava/lang/String;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.__Dispatch_Table.getType()Lorg/apache/roller/weblogger/business/DatabaseProvider$ConfigurationType;
    //#input(void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.log
    //#input(void prepare()): org/apache/roller/weblogger/business/MailProvider$ConfigurationType.JNDI_NAME
    //#input(void prepare()): org/apache/roller/weblogger/business/MailProvider$ConfigurationType.MAIL_PROPERTIES
    //#input(void prepare()): org/apache/roller/weblogger/business/MailProvider.__Descendant_Table[org/apache/roller/weblogger/business/MailProvider]
    //#input(void prepare()): org/apache/roller/weblogger/business/MailProvider.__Descendant_Table[others]
    //#input(void prepare()): org/apache/roller/weblogger/business/MailProvider.__Dispatch_Table.getTransport()Ljavax/mail/Transport;
    //#input(void prepare()): org/apache/roller/weblogger/business/MailProvider.log
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider.__Dispatch_Table.getDatabaseScript(Ljava/lang/String;)Ljava/io/InputStream;
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseInstaller]
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Descendant_Table[others]
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.getDatabaseHandle(Ljava/sql/Connection;)Ljava/lang/String;
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.isCreationRequired()Z
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.isUpgradeRequired()Z
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.__Dispatch_Table.upgradeDatabase(Z)V
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.log
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseInstaller.org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[org/apache/roller/weblogger/business/startup/ClasspathDatabaseScriptProvider]
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[org/apache/roller/weblogger/business/startup/DatabaseScriptProvider]
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Descendant_Table[others]
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/DatabaseScriptProvider.__Dispatch_Table.getDatabaseScript(Ljava/lang/String;)Ljava/io/InputStream;
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Descendant_Table[org/apache/roller/weblogger/business/startup/SQLScriptRunner]
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Dispatch_Table.getMessages()Ljava/util/List;
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.__Dispatch_Table.runScript(Ljava/sql/Connection;Z)V
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/SQLScriptRunner.log
    //#input(void prepare()): org/apache/roller/weblogger/business/startup/StartupException.java.util.Collections.EMPTY_LIST
    //#input(void prepare()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(void prepare()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#output(void prepare()): dbProvider
    //#output(void prepare()): dbProviderException
    //#output(void prepare()): mailProvider
    //#output(void prepare()): new ArrayList(DatabaseProvider#1) num objects
    //#output(void prepare()): new DatabaseProvider(prepare#1) num objects
    //#output(void prepare()): new DatabaseProvider(prepare#1).__Tag
    //#output(void prepare()): new DatabaseProvider(prepare#1).dataSource
    //#output(void prepare()): new DatabaseProvider(prepare#1).jdbcConnectionURL
    //#output(void prepare()): new DatabaseProvider(prepare#1).jdbcDriverClass
    //#output(void prepare()): new DatabaseProvider(prepare#1).jdbcPassword
    //#output(void prepare()): new DatabaseProvider(prepare#1).jdbcUsername
    //#output(void prepare()): new DatabaseProvider(prepare#1).jndiName
    //#output(void prepare()): new DatabaseProvider(prepare#1).props
    //#output(void prepare()): new DatabaseProvider(prepare#1).startupLog
    //#output(void prepare()): new DatabaseProvider(prepare#1).type
    //#output(void prepare()): new MailProvider(prepare#2) num objects
    //#output(void prepare()): new MailProvider(prepare#2).__Tag
    //#output(void prepare()): new MailProvider(prepare#2).jndiName
    //#output(void prepare()): new MailProvider(prepare#2).mailHostname
    //#output(void prepare()): new MailProvider(prepare#2).mailPassword
    //#output(void prepare()): new MailProvider(prepare#2).mailPort
    //#output(void prepare()): new MailProvider(prepare#2).mailUsername
    //#output(void prepare()): new MailProvider(prepare#2).session
    //#output(void prepare()): new MailProvider(prepare#2).type
    //#output(void prepare()): new Properties(DatabaseProvider#9) num objects
    //#output(void prepare()): new Properties(DatabaseProvider#9)._tainted
    //#output(void prepare()): prepared
    //#new obj(void prepare()): new ArrayList(DatabaseProvider#1)
    //#new obj(void prepare()): new DatabaseProvider(prepare#1)
    //#new obj(void prepare()): new MailProvider(prepare#2)
    //#new obj(void prepare()): new Properties(DatabaseProvider#9)
    //#pre[8] (void prepare()): org/apache/roller/weblogger/business/DatabaseProvider.log != null
    //#pre[11] (void prepare()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[12] (void prepare()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#pre[2] (void prepare()): (soft) dbProvider.props._tainted == 0
    //#pre[9] (void prepare()): (soft) org/apache/roller/weblogger/business/startup/DatabaseInstaller.log != null
    //#pre[10] (void prepare()): (soft) org/apache/roller/weblogger/business/startup/SQLScriptRunner.log != null
    //#presumption(void prepare()): java.util.Properties:getProperty(...)@65 != null
    //#presumption(void prepare()): java.util.Properties:getProperty(...)@65 != null
    //#presumption(void prepare()): org.apache.commons.logging.LogFactory:getLog(...)@34 != null
    //#post(void prepare()): dbProvider == &new DatabaseProvider(prepare#1)
    //#post(void prepare()): dbProviderException == old dbProviderException
    //#post(void prepare()): mailProvider == One-of{&new MailProvider(prepare#2), old mailProvider}
    //#post(void prepare()): possibly_updated(prepared)
    //#post(void prepare()): new ArrayList(DatabaseProvider#1) num objects == 1
    //#post(void prepare()): new DatabaseProvider(prepare#1) num objects == 1
    //#post(void prepare()): new DatabaseProvider(prepare#1).__Tag == org/apache/roller/weblogger/business/DatabaseProvider
    //#post(void prepare()): new DatabaseProvider(prepare#1).dataSource != null
    //#post(void prepare()): init'ed(new DatabaseProvider(prepare#1).jdbcConnectionURL)
    //#post(void prepare()): init'ed(new DatabaseProvider(prepare#1).jdbcDriverClass)
    //#post(void prepare()): init'ed(new DatabaseProvider(prepare#1).jdbcPassword)
    //#post(void prepare()): init'ed(new DatabaseProvider(prepare#1).jdbcUsername)
    //#post(void prepare()): init'ed(new DatabaseProvider(prepare#1).jndiName)
    //#post(void prepare()): new DatabaseProvider(prepare#1).props != null
    //#post(void prepare()): new DatabaseProvider(prepare#1).startupLog == &new ArrayList(DatabaseProvider#1)
    //#post(void prepare()): new DatabaseProvider(prepare#1).type in Addr_Set{&org.apache.roller.weblogger.business.DatabaseProvider$ConfigurationType__static_init.new DatabaseProvider$ConfigurationType(DatabaseProvider$ConfigurationType__static_init#2),&org.apache.roller.weblogger.business.DatabaseProvider$ConfigurationType__static_init.new DatabaseProvider$ConfigurationType(DatabaseProvider$ConfigurationType__static_init#1)}
    //#post(void prepare()): new MailProvider(prepare#2) num objects <= 1
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).__Tag)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).jndiName)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).mailHostname)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).mailPassword)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).mailPort)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).mailUsername)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).session)
    //#post(void prepare()): init'ed(new MailProvider(prepare#2).type)
    //#post(void prepare()): new Properties(DatabaseProvider#9) num objects <= 1
    //#post(void prepare()): new Properties(DatabaseProvider#9)._tainted == 0
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Properties
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.Class:getResourceAsStream
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Connection:getMetaData
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.DatabaseMetaData:getTables
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.ResultSet:next
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.ResultSet:getString
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.DriverManager:getConnection
    //#unanalyzed(void prepare()): Effects-of-calling:javax.sql.DataSource:getConnection
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Connection:close
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.RuntimeException
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.List:add
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:replaceAll
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:length
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Connection:createStatement
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Statement:executeUpdate
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.roller.weblogger.WebloggerException
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.roller.RollerException
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.DatabaseMetaData:getDatabaseProductName
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(void prepare()): Effects-of-calling:getDatabaseScript
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.InputStreamReader
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.BufferedReader
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.BufferedReader:readLine
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.String:endsWith
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.BufferedReader:close
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Connection:getAutoCommit
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Connection:commit
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.SQLException:getLocalizedMessage
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.StringWriter
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.PrintWriter
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.SQLException:printStackTrace
    //#unanalyzed(void prepare()): Effects-of-calling:java.io.StringWriter:toString
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.List:addAll
    //#unanalyzed(void prepare()): Effects-of-calling:getDatabaseVersion
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Statement:executeQuery
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.ResultSet:getInt
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.commons.logging.Log:trace
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Connection:prepareStatement
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:executeQuery
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:clearParameters
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:setString
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:executeUpdate
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Date
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Date:getTime
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.Date
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:setDate
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:setBoolean
    //#unanalyzed(void prepare()): Effects-of-calling:java.sql.PreparedStatement:setShort
    //#unanalyzed(void prepare()): Effects-of-calling:upgradeTo300
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Locale:getDefault
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Locale:getLanguage
    //#unanalyzed(void prepare()): Effects-of-calling:java.lang.Class:forName
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.Properties:put
    //#unanalyzed(void prepare()): Effects-of-calling:javax.naming.InitialContext
    //#unanalyzed(void prepare()): Effects-of-calling:javax.naming.InitialContext:lookup
    //#unanalyzed(void prepare()): Effects-of-calling:javax.mail.Session:getTransport
    //#unanalyzed(void prepare()): Effects-of-calling:javax.mail.Transport:connect
    //#unanalyzed(void prepare()): Effects-of-calling:org.apache.commons.logging.Log:warn
    //#unanalyzed(void prepare()): Effects-of-calling:javax.naming.Context:lookup
    //#unanalyzed(void prepare()): Effects-of-calling:javax.mail.Session:getDefaultInstance
    //#unanalyzed(void prepare()): Effects-of-calling:javax.mail.Transport:close
    //#test_vector(void prepare()): java.lang.String:equals(...)@186: {0}, {1}
        } catch(StartupException ex) {
            dbProviderException = ex;
            throw ex;
        }
        
        // setup mail provider, if configured
        try {
            mailProvider = new MailProvider();
        } catch(StartupException ex) {
            log.warn("Failed to setup mail provider, continuing anways.\n"+
    //#WebloggerStartup.java:181: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.business.startup.StartupException:getMessage()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.startup.WebloggerStartup
    //#    method: void prepare()
    //#    unanalyzed callee: String org.apache.roller.weblogger.business.startup.StartupException:getMessage()
    //#WebloggerStartup.java:181: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.startup.WebloggerStartup
    //#    method: void prepare()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object, Throwable)
                    "Reason: "+ex.getMessage(), ex);
        }
        
        // now we need to deal with database install/upgrade logic
        if("manual".equals(WebloggerConfig.getProperty("installation.type"))) {
            
            // if we are doing manual install then all that is needed is the
            // app handled database upgrade work, not the db scripts
            DatabaseInstaller dbInstaller = getDatabaseInstaller();
            if(dbInstaller.isUpgradeRequired()) {
    //#WebloggerStartup.java:191: ?precondition failure
    //#    org/apache/roller/weblogger/business/startup/DatabaseInstaller.isUpgradeRequired: (soft) this.db.props._tainted == 0
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.business.startup.WebloggerStartup
    //#    method: void prepare()
    //#    basic block: bb_8
    //#    assertion: (soft) dbInstaller.db.props._tainted == 0
    //#    callee: bool org/apache/roller/weblogger/business/startup/DatabaseInstaller.isUpgradeRequired()
    //#    callee assertion: (soft) this.db.props._tainted == 0
    //#    callee file: DatabaseInstaller.java
    //#    callee precondition index: [8]
    //#    callee srcpos: 96
    //#    VN: dbInstaller.db.props._tainted
    //#    Expected: {0}
    //#    Bad: {1}
    //#    Attribs:  Int  Exp in +/-1000  Exp singleton  Bad singleton  Bad overlaps +/-1000  Soft  Bad > Exp
                dbInstaller.upgradeDatabase(false);
            }
            
            prepared = true;
            
        } else {
            
            // we are in auto install mode, so see if there is any work to do
            DatabaseInstaller dbInstaller = getDatabaseInstaller();
            if(!dbInstaller.isCreationRequired() && 
    //#WebloggerStartup.java:201: ?precondition failure
    //#    org/apache/roller/weblogger/business/startup/DatabaseInstaller.isCreationRequired: (soft) this.db.props._tainted == 0
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.business.startup.WebloggerStartup
    //#    method: void prepare()
    //#    basic block: bb_11
    //#    assertion: (soft) dbInstaller.db.props._tainted == 0
    //#    callee: bool org/apache/roller/weblogger/business/startup/DatabaseInstaller.isCreationRequired()
    //#    callee assertion: (soft) this.db.props._tainted == 0
    //#    callee file: DatabaseInstaller.java
    //#    callee precondition index: [7]
    //#    callee srcpos: 73
    //#    VN: dbInstaller.db.props._tainted
    //#    Expected: {0}
    //#    Bad: {1}
    //#    Attribs:  Int  Exp in +/-1000  Exp singleton  Bad singleton  Bad overlaps +/-1000  Soft  Bad > Exp
                    !dbInstaller.isUpgradeRequired()) {
                prepared = true;
            }
        }
        
    }
    //#WebloggerStartup.java:207: end of method: void org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare()
    
}
    //#WebloggerStartup.java:: end of class: org.apache.roller.weblogger.business.startup.WebloggerStartup
