//# 2 errors, 428 messages
//#
/*
    //#PingConfig.java:1:1: class: org.apache.roller.weblogger.config.PingConfig
 * 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.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.pings.PingTargetManager;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.pojos.PingTarget;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

// This may need to move to a different package, but it seems appropriate here in the current structure.
// Previous placement in the presentation.pings package introduced the undesirable dependency of the
// business package on the presentation package.

/**
 * Thin wrapper around WebloggerConfig and WebloggerRuntimeConfig for centralizing access to the many configurable
 * settings for pings.
 * 
 * 
 * @author <a href="mailto:anil@busybuddha.org">Anil Gangolli</a>
 */
public class PingConfig {
    private static final Log logger = LogFactory.getLog(PingConfig.class);
    //#PingConfig.java:44: method: org.apache.roller.weblogger.config.PingConfig.org.apache.roller.weblogger.config.PingConfig__static_init
    //#PingConfig.java:44: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: org.apache.roller.weblogger.config.PingConfig__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.config.PingConfig__static_init): NESTED_BRACE_PAIR
    //#output(org.apache.roller.weblogger.config.PingConfig__static_init): __Descendant_Table[org/apache/roller/weblogger/config/PingConfig]
    //#output(org.apache.roller.weblogger.config.PingConfig__static_init): configuredVariants
    //#output(org.apache.roller.weblogger.config.PingConfig__static_init): logger
    //#output(org.apache.roller.weblogger.config.PingConfig__static_init): new HashMap(PingConfig__static_init#1) num objects
    //#new obj(org.apache.roller.weblogger.config.PingConfig__static_init): new HashMap(PingConfig__static_init#1)
    //#post(org.apache.roller.weblogger.config.PingConfig__static_init): init'ed(NESTED_BRACE_PAIR)
    //#post(org.apache.roller.weblogger.config.PingConfig__static_init): __Descendant_Table[org/apache/roller/weblogger/config/PingConfig] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.config.PingConfig__static_init): configuredVariants == &new HashMap(PingConfig__static_init#1)
    //#post(org.apache.roller.weblogger.config.PingConfig__static_init): init'ed(logger)
    //#post(org.apache.roller.weblogger.config.PingConfig__static_init): new HashMap(PingConfig__static_init#1) num objects == 1


    // Config property for maximim ping attempts.
    static final String MAX_PING_ATTEMPTS_PROP = "pings.maxPingAttempts";
    private static final int MAX_PING_ATTEMPTS_DEFAULT = 3;
    private static final int MAX_PING_ATTEMPTS_MIN = 1;
    private static final int MAX_PING_ATTEMPTS_MAX = 10;

    // Config property for queue processing interval
    private static final String QUEUE_PROCESSING_INTERVAL_PROP = "pings.queueProcessingIntervalMins";
    private static final int QUEUE_PROCESSING_INTERVAL_DEFAULT = 5;
    private static final int QUEUE_PROCESSING_INTERVAL_MIN = 0;
    private static final int QUEUE_PROCESSING_INTERVAL_MAX = 120;

    // PingConfig property for logging pings (not actually performing them).  Used for debugging.
    private static final String PINGS_LOG_ONLY_PROP = "pings.logOnly";
    private static final boolean PINGS_LOG_ONLY_DEFAULT = false;

    // PingConfig property for controlling whether or not to allow custom ping targets
    // ("Weblog:Custom Ping Targets" page and actions).  If absent, this defaults to false.
    // with the enabledProperty behavior in editor-menu.xml.
    // NOTE: If this property name is changed, editor-menu.xml must also be adjusted.
    private static final String PINGS_DISALLOW_CUSTOM_TARGETS_PROP = "pings.disallowCustomTargets";
    private static final boolean PINGS_DISALLOW_CUSTOM_TARGETS_DEFAULT = false;

    // PingConfig property for controlling whether or not to allow usage of pings
    // ("Weblog:Pings" page and actions).  If absent, this defaults to false
    // NOTE: If this property name is changed, editor-menu.xml must also be adjusted.
    private static final String PINGS_DISABLE_PING_USAGE_PROP = "pings.disablePingUsage";
    private static final boolean PINGS_DISABLE_PING_USAGE_DEFAULT = false;

    // PingConfig property for controlling suspending the processing of pings.  If true,
    // new auto ping requests are not queued, any existing queued requests are not processed,
    // and sending a manual ping results in a  message saying pings have been disabled.
    // NOTE: This is a "runtime" property settable on the Admin:PingConfig page, default is false.
    private static final String PINGS_SUSPEND_PING_PROCESSING_PROP = "pings.suspendPingProcessing";

    // PingConfig property determining the initial common ping targets.  If the list of common
    // ping targets is empty on startup, the value of this property is used to populate initial values.
    // The value takes the form of comma-separated ping targets where each ping target is specified in
    // the form {{name}{pingurl}}.  If an administrator wants to disable this initialization, in order to
    // maintain an empty list of common targets, the administrator can disable the initialization by
    // commenting out this property in the config file.
    private static final String PINGS_INITIAL_COMMON_TARGETS_PROP = "pings.initialCommonTargets";


    // PingConfig property determining the known WeblogUpdates.ping variants/bugs
    // in popular ping targets, which we are used when invoking pings on those targets.
    // The value takes the form of a comma separated list of ping target urls and
    // variant options, where each one is in the form {{pingurl}{option[[,option]...]}}.
    private static final String PINGS_VARIANT_OPTIONS_PROP = "pings.variantOptions";
    // Map of configured ping variants.  Maps a ping target hostname to a set of
    // Strings representing variant options to be used when pinging this target.
    // This was introduced in order to support certain buggy (but popular) ping
    // targets that implement minor variants of the WeblogUpdates.ping call.
    // This is initialized once at startup, and referenced when pings are made.
    private static final Map configuredVariants = new HashMap();
    
    // Pattern used to parse common ping targets as well as ping variants.
    // Each initial commmon ping target is specified in the format {{name}{url}}
    // Ping variants are also specified in a nested brace format {{url}{options}}
    private static final Pattern NESTED_BRACE_PAIR = Pattern.compile("\\{\\{(.*?)\\}\\{(.*?)\\}\\}");
    //#PingConfig.java:106: end of method: org.apache.roller.weblogger.config.PingConfig.org.apache.roller.weblogger.config.PingConfig__static_init


    // Inhibit construction
    private PingConfig() {
    //#PingConfig.java:110: method: void org.apache.roller.weblogger.config.PingConfig.org.apache.roller.weblogger.config.PingConfig()
    }
    //#PingConfig.java:111: end of method: void org.apache.roller.weblogger.config.PingConfig.org.apache.roller.weblogger.config.PingConfig()

    /**
     * Get the maximum number of ping attempts that should be made for each ping queue entry before we give up. If we
     * get apparently transient failures while trying to perform the ping, the entry is requeued for processing on later
     * passes through the queue until this number of attempts has been reached.
     *
     * @return the configured (or default) maximum number of ping attempts
     */
    public static int getMaxPingAttempts() {
        return getIntegerProperty(MAX_PING_ATTEMPTS_PROP, MAX_PING_ATTEMPTS_DEFAULT, MAX_PING_ATTEMPTS_MIN, MAX_PING_ATTEMPTS_MAX);
    //#PingConfig.java:121: method: int org.apache.roller.weblogger.config.PingConfig.getMaxPingAttempts()
    //#input(int getMaxPingAttempts()): "' is not an integer value.  Using default value: "._tainted
    //#input(int getMaxPingAttempts()): "' is not present in the configuration.  Using default value: "._tainted
    //#input(int getMaxPingAttempts()): "' is outside the required range ("._tainted
    //#input(int getMaxPingAttempts()): ").  Using default value: "._tainted
    //#input(int getMaxPingAttempts()): ", "._tainted
    //#input(int getMaxPingAttempts()): "="._tainted
    //#input(int getMaxPingAttempts()): "ERROR: PingConfig property '"._tainted
    //#input(int getMaxPingAttempts()): "Fetching property ["._tainted
    //#input(int getMaxPingAttempts()): "PingConfig property '"._tainted
    //#input(int getMaxPingAttempts()): "]"._tainted
    //#input(int getMaxPingAttempts()): "pings.maxPingAttempts"._tainted
    //#input(int getMaxPingAttempts()): logger
    //#input(int getMaxPingAttempts()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(int getMaxPingAttempts()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#output(int getMaxPingAttempts()): return_value
    //#pre[1] (int getMaxPingAttempts()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[2] (int getMaxPingAttempts()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#post(int getMaxPingAttempts()): init'ed(return_value)
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:org.apache.commons.logging.Log:isDebugEnabled
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(int getMaxPingAttempts()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#PingConfig.java:121: end of method: int org.apache.roller.weblogger.config.PingConfig.getMaxPingAttempts()
    }

    /**
     * Get the ping queue processing interval in minutes.
     *
     * @return the configured (or default) queue processing interval in minutes.
     */
    public static int getQueueProcessingIntervalMins() {
        return getIntegerProperty(QUEUE_PROCESSING_INTERVAL_PROP, QUEUE_PROCESSING_INTERVAL_DEFAULT, QUEUE_PROCESSING_INTERVAL_MIN, QUEUE_PROCESSING_INTERVAL_MAX);
    //#PingConfig.java:130: method: int org.apache.roller.weblogger.config.PingConfig.getQueueProcessingIntervalMins()
    //#input(int getQueueProcessingIntervalMins()): "' is not an integer value.  Using default value: "._tainted
    //#input(int getQueueProcessingIntervalMins()): "' is not present in the configuration.  Using default value: "._tainted
    //#input(int getQueueProcessingIntervalMins()): "' is outside the required range ("._tainted
    //#input(int getQueueProcessingIntervalMins()): ").  Using default value: "._tainted
    //#input(int getQueueProcessingIntervalMins()): ", "._tainted
    //#input(int getQueueProcessingIntervalMins()): "="._tainted
    //#input(int getQueueProcessingIntervalMins()): "ERROR: PingConfig property '"._tainted
    //#input(int getQueueProcessingIntervalMins()): "Fetching property ["._tainted
    //#input(int getQueueProcessingIntervalMins()): "PingConfig property '"._tainted
    //#input(int getQueueProcessingIntervalMins()): "]"._tainted
    //#input(int getQueueProcessingIntervalMins()): "pings.queueProcessingIntervalMins"._tainted
    //#input(int getQueueProcessingIntervalMins()): logger
    //#input(int getQueueProcessingIntervalMins()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(int getQueueProcessingIntervalMins()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#output(int getQueueProcessingIntervalMins()): return_value
    //#pre[1] (int getQueueProcessingIntervalMins()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[2] (int getQueueProcessingIntervalMins()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#post(int getQueueProcessingIntervalMins()): init'ed(return_value)
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:org.apache.commons.logging.Log:isDebugEnabled
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(int getQueueProcessingIntervalMins()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#PingConfig.java:130: end of method: int org.apache.roller.weblogger.config.PingConfig.getQueueProcessingIntervalMins()
    }


    /**
     * Get the logs only setting.  Get configuration value determining whether pings are to be logged only (not sent).
     * This configuration setting is used for development and debugging.
     *
     * @return the configured (or default) value of the logs only setting.
     */
    public static boolean getLogPingsOnly() {
        return getBooleanProperty(PINGS_LOG_ONLY_PROP, PINGS_LOG_ONLY_DEFAULT);
    //#PingConfig.java:141: method: bool org.apache.roller.weblogger.config.PingConfig.getLogPingsOnly()
    //#input(bool getLogPingsOnly()): "' is not present in the configuration.  Using default value: "._tainted
    //#input(bool getLogPingsOnly()): "="._tainted
    //#input(bool getLogPingsOnly()): "Fetching property ["._tainted
    //#input(bool getLogPingsOnly()): "PingConfig property '"._tainted
    //#input(bool getLogPingsOnly()): "]"._tainted
    //#input(bool getLogPingsOnly()): "pings.logOnly"._tainted
    //#input(bool getLogPingsOnly()): logger
    //#input(bool getLogPingsOnly()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(bool getLogPingsOnly()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#output(bool getLogPingsOnly()): return_value
    //#pre[1] (bool getLogPingsOnly()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[2] (bool getLogPingsOnly()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#post(bool getLogPingsOnly()): init'ed(return_value)
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:org.apache.commons.logging.Log:isDebugEnabled
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(bool getLogPingsOnly()): Effects-of-calling:java.lang.Boolean:booleanValue
    //#PingConfig.java:141: end of method: bool org.apache.roller.weblogger.config.PingConfig.getLogPingsOnly()
    }

    /**
     * Determine whether the configuration disallows custom ping targets.  If this is true, users are not allowed to
     * create or edit custom ping targets, and any auto ping configs that use them are ignored.
     *
     * @return the configured (or default) value of the "disallow custom targets" setting.
     */
    public static boolean getDisallowCustomTargets() {
        return getBooleanProperty(PINGS_DISALLOW_CUSTOM_TARGETS_PROP, PINGS_DISALLOW_CUSTOM_TARGETS_DEFAULT);
    //#PingConfig.java:151: method: bool org.apache.roller.weblogger.config.PingConfig.getDisallowCustomTargets()
    //#input(bool getDisallowCustomTargets()): "' is not present in the configuration.  Using default value: "._tainted
    //#input(bool getDisallowCustomTargets()): "="._tainted
    //#input(bool getDisallowCustomTargets()): "Fetching property ["._tainted
    //#input(bool getDisallowCustomTargets()): "PingConfig property '"._tainted
    //#input(bool getDisallowCustomTargets()): "]"._tainted
    //#input(bool getDisallowCustomTargets()): "pings.disallowCustomTargets"._tainted
    //#input(bool getDisallowCustomTargets()): logger
    //#input(bool getDisallowCustomTargets()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(bool getDisallowCustomTargets()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#output(bool getDisallowCustomTargets()): return_value
    //#pre[1] (bool getDisallowCustomTargets()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[2] (bool getDisallowCustomTargets()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#post(bool getDisallowCustomTargets()): init'ed(return_value)
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:org.apache.commons.logging.Log:isDebugEnabled
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(bool getDisallowCustomTargets()): Effects-of-calling:java.lang.Boolean:booleanValue
    //#PingConfig.java:151: end of method: bool org.apache.roller.weblogger.config.PingConfig.getDisallowCustomTargets()
    }

    /**
     * Determine whether the configuration disables ping usage (configuration of auto pings and sending of manual
     * pings).  If this is true, all auto ping configus are removed at startup, the Weblog:Pings UI and the associated
     * actions are disabled.
     *
     * @return the configured (or default) value of the enable ping usage setting.
     */
    public static boolean getDisablePingUsage() {
        return getBooleanProperty(PINGS_DISABLE_PING_USAGE_PROP, PINGS_DISABLE_PING_USAGE_DEFAULT);
    //#PingConfig.java:162: method: bool org.apache.roller.weblogger.config.PingConfig.getDisablePingUsage()
    //#input(bool getDisablePingUsage()): "' is not present in the configuration.  Using default value: "._tainted
    //#input(bool getDisablePingUsage()): "="._tainted
    //#input(bool getDisablePingUsage()): "Fetching property ["._tainted
    //#input(bool getDisablePingUsage()): "PingConfig property '"._tainted
    //#input(bool getDisablePingUsage()): "]"._tainted
    //#input(bool getDisablePingUsage()): "pings.disablePingUsage"._tainted
    //#input(bool getDisablePingUsage()): logger
    //#input(bool getDisablePingUsage()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(bool getDisablePingUsage()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#output(bool getDisablePingUsage()): return_value
    //#pre[1] (bool getDisablePingUsage()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[2] (bool getDisablePingUsage()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#post(bool getDisablePingUsage()): init'ed(return_value)
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:org.apache.commons.logging.Log:isDebugEnabled
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.lang.Boolean:valueOf
    //#unanalyzed(bool getDisablePingUsage()): Effects-of-calling:java.lang.Boolean:booleanValue
    //#PingConfig.java:162: end of method: bool org.apache.roller.weblogger.config.PingConfig.getDisablePingUsage()
    }

    /**
     * Determine whether ping processing is suspended.  If this is true, new auto ping requests are not
     * queued, any existing queued requests are not processed, and sending a manual ping results in a message saying
     * pings have been disabled.
     *
     * @return the configured (or default) value of the suspend ping processing setting.
     */
    public static boolean getSuspendPingProcessing() {
        return WebloggerRuntimeConfig.getBooleanProperty(PINGS_SUSPEND_PING_PROCESSING_PROP);
    //#PingConfig.java:173: method: bool org.apache.roller.weblogger.config.PingConfig.getSuspendPingProcessing()
    //#PingConfig.java:173: Warning: suspicious precondition
    //#    the precondition for org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: bool getSuspendPingProcessing()
    //#    suspicious precondition index: [2]
    //#    Attribs:  Soft
    //#input(bool getSuspendPingProcessing()): "="._tainted
    //#input(bool getSuspendPingProcessing()): "Trouble accessing property: "._tainted
    //#input(bool getSuspendPingProcessing()): "]"._tainted
    //#input(bool getSuspendPingProcessing()): "fetched property ["._tainted
    //#input(bool getSuspendPingProcessing()): "pings.suspendPingProcessing"._tainted
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/GuiceWebloggerProvider.__Dispatch_Table.getWeblogger()Lorg/apache/roller/weblogger/business/Weblogger;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/PropertiesManager.__Descendant_Table[org/apache/roller/weblogger/business/PropertiesManager]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/PropertiesManager.__Descendant_Table[org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/PropertiesManager.__Descendant_Table[others]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/PropertiesManager.__Dispatch_Table.getProperty(Ljava/lang/String;)Lorg/apache/roller/weblogger/pojos/RuntimeConfigProperty;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[org/apache/roller/weblogger/business/WebloggerImpl]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[org/apache/roller/weblogger/business/Weblogger]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[org/apache/roller/weblogger/business/jpa/JPAWebloggerImpl]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[others]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/Weblogger.__Dispatch_Table.getPropertiesManager()Lorg/apache/roller/weblogger/business/PropertiesManager;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.__Tag
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.__Tag
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.propertiesManager
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.propertiesManager.__Tag
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.propertiesManager.strategy
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.propertiesManager.strategy.__Tag
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.propertiesManager.strategy.threadLocalEntityManager
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerImpl.__Dispatch_Table.getPropertiesManager()Lorg/apache/roller/weblogger/business/PropertiesManager;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerProvider.__Descendant_Table[org/apache/roller/weblogger/business/GuiceWebloggerProvider]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerProvider.__Descendant_Table[org/apache/roller/weblogger/business/WebloggerProvider]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerProvider.__Descendant_Table[others]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/WebloggerProvider.__Dispatch_Table.getWeblogger()Lorg/apache/roller/weblogger/business/Weblogger;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Descendant_Table[org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Descendant_Table[others]
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Dispatch_Table.load(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.__Dispatch_Table.getProperty(Ljava/lang/String;)Lorg/apache/roller/weblogger/pojos/RuntimeConfigProperty;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/business/jpa/JPAWebloggerImpl.__Dispatch_Table.getPropertiesManager()Lorg/apache/roller/weblogger/business/PropertiesManager;
    //#input(bool getSuspendPingProcessing()): org/apache/roller/weblogger/config/WebloggerRuntimeConfig.log
    //#output(bool getSuspendPingProcessing()): return_value
    //#pre[11] (bool getSuspendPingProcessing()): org/apache/roller/weblogger/config/WebloggerRuntimeConfig.log != null
    //#pre[1] (bool getSuspendPingProcessing()): (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider != null
    //#pre[2] (bool getSuspendPingProcessing()): (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.__Tag in {org/apache/roller/weblogger/business/GuiceWebloggerProvider, org/apache/roller/weblogger/business/WebloggerProvider}
    //#pre[3] (bool getSuspendPingProcessing()): (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance != null
    //#post(bool getSuspendPingProcessing()): init'ed(return_value)
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.ThreadLocal:get
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:javax.persistence.EntityManagerFactory:createEntityManager
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.ThreadLocal:set
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:javax.persistence.EntityManager:getTransaction
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:javax.persistence.EntityTransaction:isActive
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:javax.persistence.EntityTransaction:begin
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:getWeblogger
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:getPropertiesManager
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:getProperty
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:javax.persistence.EntityManager:find
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:org.apache.roller.weblogger.pojos.RuntimeConfigProperty:getValue
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:org.apache.commons.logging.Log:warn
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.Boolean
    //#unanalyzed(bool getSuspendPingProcessing()): Effects-of-calling:java.lang.Boolean:booleanValue
    //#PingConfig.java:173: end of method: bool org.apache.roller.weblogger.config.PingConfig.getSuspendPingProcessing()
    }

    /**
     * Initialize the common ping targets from the configuration properties. If the current list of common ping targets
     * is empty, and the <code>PINGS_INITIAL_COMMON_TARGETS_PROP</code> property is present in the configuration then,
     * this method will use that value to initialize the common targets.  This is called on each server startup.
     * <p/>
     * Note: this is expected to be called during initialization  with transaction demarcation being handled by the
     * caller.
     *
     * @see org.apache.roller.weblogger.ui.core.RollerContext#contextInitialized(javax.servlet.ServletContextEvent)
     */
    public static void initializeCommonTargets() throws WebloggerException {
        String configuredVal = WebloggerConfig.getProperty(PINGS_INITIAL_COMMON_TARGETS_PROP);
    //#PingConfig.java:187: method: void org.apache.roller.weblogger.config.PingConfig.initializeCommonTargets()
    //#PingConfig.java:187: Warning: suspicious precondition
    //#    the precondition for org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    suspicious precondition index: [2]
    //#    Attribs:  Soft
    //#input(void initializeCommonTargets()): "' from configuration properties."._tainted
    //#input(void initializeCommonTargets()): "'. Skipping this target. Check your setting of the property "._tainted
    //#input(void initializeCommonTargets()): "="._tainted
    //#input(void initializeCommonTargets()): "Creating common ping target '"._tainted
    //#input(void initializeCommonTargets()): "Fetching property ["._tainted
    //#input(void initializeCommonTargets()): "Unable to parse configured initial ping target '"._tainted
    //#input(void initializeCommonTargets()): "]"._tainted
    //#input(void initializeCommonTargets()): "pings.initialCommonTargets"._tainted
    //#input(void initializeCommonTargets()): NESTED_BRACE_PAIR
    //#input(void initializeCommonTargets()): logger
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/GuiceWebloggerProvider.__Dispatch_Table.getWeblogger()Lorg/apache/roller/weblogger/business/Weblogger;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[org/apache/roller/weblogger/business/WebloggerImpl]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[org/apache/roller/weblogger/business/Weblogger]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[org/apache/roller/weblogger/business/jpa/JPAWebloggerImpl]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/Weblogger.__Descendant_Table[others]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/Weblogger.__Dispatch_Table.getPingTargetManager()Lorg/apache/roller/weblogger/business/pings/PingTargetManager;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.__Tag
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.__Tag
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.pingTargetManager
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.pingTargetManager.__Tag
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.pingTargetManager.strategy
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.pingTargetManager.strategy.__Tag
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.pingTargetManager.strategy.emf
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance.pingTargetManager.strategy.threadLocalEntityManager
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerImpl.__Dispatch_Table.getPingTargetManager()Lorg/apache/roller/weblogger/business/pings/PingTargetManager;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerProvider.__Descendant_Table[org/apache/roller/weblogger/business/GuiceWebloggerProvider]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerProvider.__Descendant_Table[org/apache/roller/weblogger/business/WebloggerProvider]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerProvider.__Descendant_Table[others]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/WebloggerProvider.__Dispatch_Table.getWeblogger()Lorg/apache/roller/weblogger/business/Weblogger;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Descendant_Table[org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Descendant_Table[others]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Dispatch_Table.getNamedQuery(Ljava/lang/String;)Ljavax/persistence/Query;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.__Dispatch_Table.store(Ljava/lang/Object;)Ljava/lang/Object;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.javax.persistence.FlushModeType.COMMIT
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.__Dispatch_Table.getCommonPingTargets()Ljava/util/List;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.__Dispatch_Table.savePingTarget(Lorg/apache/roller/weblogger/pojos/PingTarget;)V
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/jpa/JPAWebloggerImpl.__Dispatch_Table.getPingTargetManager()Lorg/apache/roller/weblogger/business/pings/PingTargetManager;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/pings/PingTargetManager.__Descendant_Table[org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/pings/PingTargetManager.__Descendant_Table[org/apache/roller/weblogger/business/pings/PingTargetManager]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/pings/PingTargetManager.__Descendant_Table[others]
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/pings/PingTargetManager.__Dispatch_Table.getCommonPingTargets()Ljava/util/List;
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/business/pings/PingTargetManager.__Dispatch_Table.savePingTarget(Lorg/apache/roller/weblogger/pojos/PingTarget;)V
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(void initializeCommonTargets()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#pre[4] (void initializeCommonTargets()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[5] (void initializeCommonTargets()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#pre[1] (void initializeCommonTargets()): (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider != null
    //#pre[2] (void initializeCommonTargets()): (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.__Tag in {org/apache/roller/weblogger/business/GuiceWebloggerProvider, org/apache/roller/weblogger/business/WebloggerProvider}
    //#pre[3] (void initializeCommonTargets()): (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance != null
    //#presumption(void initializeCommonTargets()): getWeblogger(...).__Tag in {org/apache/roller/weblogger/business/Weblogger, org/apache/roller/weblogger/business/WebloggerImpl, org/apache/roller/weblogger/business/jpa/JPAWebloggerImpl}
    //#presumption(void initializeCommonTargets()): getWeblogger(...).pingTargetManager != null
    //#presumption(void initializeCommonTargets()): getWeblogger(...)@194 init'ed
    //#presumption(void initializeCommonTargets()): javax.persistence.Query:getResultList(...)@177 != null
    //#presumption(void initializeCommonTargets()): org.apache.commons.logging.LogFactory:getLog(...)@44 != null
    //#presumption(void initializeCommonTargets()): pingTargetMgr.__Tag in {org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl, org/apache/roller/weblogger/business/pings/PingTargetManager}
    //#presumption(void initializeCommonTargets()): pingTargetMgr.strategy != null
    //#presumption(void initializeCommonTargets()): pingTargetMgr.strategy.__Tag == org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy
    //#presumption(void initializeCommonTargets()): pingTargetMgr.strategy.emf != null
    //#presumption(void initializeCommonTargets()): pingTargetMgr.strategy.threadLocalEntityManager != null
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.lang.ThreadLocal:get
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityManagerFactory:createEntityManager
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:java.lang.ThreadLocal:set
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityManager:getTransaction
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityTransaction:isActive
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityTransaction:begin
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityManager:createNamedQuery
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.Query:setFlushMode
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.Query:getResultList
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityManager:contains
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:javax.persistence.EntityManager:persist
    //#unanalyzed(void initializeCommonTargets()): Effects-of-calling:getWeblogger
    //#test_vector(void initializeCommonTargets()): java.lang.String:length(...)@188: {1..4_294_967_295}, {0}
    //#test_vector(void initializeCommonTargets()): java.util.List:isEmpty(...)@195: {1}, {0}
    //#test_vector(void initializeCommonTargets()): org.apache.commons.logging.Log:isDebugEnabled(...)@189: {0}, {1}
    //#test_vector(void initializeCommonTargets()): org.apache.commons.logging.Log:isDebugEnabled(...)@196: {0}, {1}
        if (configuredVal == null || configuredVal.trim().length() == 0) {
            if (logger.isDebugEnabled()) {
    //#PingConfig.java:189: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
                logger.debug("No (or empty) value of " + PINGS_INITIAL_COMMON_TARGETS_PROP + " present in the configuration.  Skipping initialization of commmon targets.");
    //#PingConfig.java:190: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            }
            return;
        }
        PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        if (!pingTargetMgr.getCommonPingTargets().isEmpty()) {
            if (logger.isDebugEnabled()) {
    //#PingConfig.java:196: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
                logger.debug("Some common ping targets are present in the database already.  Skipping initialization.");
    //#PingConfig.java:197: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            }
            return;
        }

        String[] configuredTargets = configuredVal.trim().split(",");
        for (int i = 0; i < configuredTargets.length; i++) {
    //#PingConfig.java:203: ?use of default init
    //#    init'ed(configuredTargets.length)
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    basic block: bb_11
    //#    assertion: init'ed(configuredTargets.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#PingConfig.java:203: Warning: test always goes same way
    //#    test predetermined because i == configuredTargets.length
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    from bb: bb_11
    //#    live edge: bb_11-->bb_19
    //#    tested vn: i - undefined
    //#    tested vn values: {0}
    //#PingConfig.java:203: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    dead bb: bb_18
            // Trim space around the target spec
            String thisTarget = configuredTargets[i].trim();
    //#PingConfig.java:205: Warning: dead code
    //#    dead code here because i == configuredTargets.length
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    dead bb: bb_12
            // skip empty ones
            if (thisTarget.length() == 0) continue;
            // parse the ith target and store it
            Matcher m = NESTED_BRACE_PAIR.matcher(thisTarget);
    //#PingConfig.java:209: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    dead bb: bb_14
            if (m.matches() && m.groupCount() == 2) {
    //#PingConfig.java:210: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    dead bb: bb_15
                String name = m.group(1).trim();
    //#PingConfig.java:211: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    dead bb: bb_16
                String url = m.group(2).trim();
                logger.info("Creating common ping target '" + name + "' from configuration properties.");
                PingTarget pingTarget = new PingTarget(null, name, url, null, false);
                pingTargetMgr.savePingTarget(pingTarget);
            } else {
                logger.error("Unable to parse configured initial ping target '" + thisTarget + "'. Skipping this target. Check your setting of the property " + PINGS_INITIAL_COMMON_TARGETS_PROP);
    //#PingConfig.java:217: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializeCommonTargets()
    //#    dead bb: bb_17
            }
        }
    }
    //#PingConfig.java:220: end of method: void org.apache.roller.weblogger.config.PingConfig.initializeCommonTargets()

    /**
     * Initialize known ping variants from the configuration.
     */
    public static void initializePingVariants() {
        String configuredVal = WebloggerConfig.getProperty(PINGS_VARIANT_OPTIONS_PROP);
    //#PingConfig.java:226: method: void org.apache.roller.weblogger.config.PingConfig.initializePingVariants()
    //#input(void initializePingVariants()): "' has an empty variant options list.  Ignored."._tainted
    //#input(void initializePingVariants()): "'. Skipping this variant. Check your setting of the property "._tainted
    //#input(void initializePingVariants()): "="._tainted
    //#input(void initializePingVariants()): "Fetching property ["._tainted
    //#input(void initializePingVariants()): "Ping variant entry for url '"._tainted
    //#input(void initializePingVariants()): "Unable to parse configured ping variant '"._tainted
    //#input(void initializePingVariants()): "]"._tainted
    //#input(void initializePingVariants()): "pings.variantOptions"._tainted
    //#input(void initializePingVariants()): NESTED_BRACE_PAIR
    //#input(void initializePingVariants()): configuredVariants
    //#input(void initializePingVariants()): logger
    //#input(void initializePingVariants()): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(void initializePingVariants()): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#pre[1] (void initializePingVariants()): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[2] (void initializePingVariants()): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#presumption(void initializePingVariants()): org.apache.commons.logging.LogFactory:getLog(...)@44 != null
    //#unanalyzed(void initializePingVariants()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void initializePingVariants()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void initializePingVariants()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void initializePingVariants()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(void initializePingVariants()): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(void initializePingVariants()): Effects-of-calling:java.util.Properties:getProperty
    //#test_vector(void initializePingVariants()): java.lang.String:length(...)@227: {1..4_294_967_295}, {0}
    //#test_vector(void initializePingVariants()): org.apache.commons.logging.Log:isDebugEnabled(...)@228: {0}, {1}
        if (configuredVal == null || configuredVal.trim().length() == 0) {
            if (logger.isDebugEnabled()) {
    //#PingConfig.java:228: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
                logger.debug("No (or empty) value of " + PINGS_VARIANT_OPTIONS_PROP + " present in the configuration.  Skipping initialization of ping variants.");
    //#PingConfig.java:229: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            }
            return;
        }
        String[] variants = configuredVal.trim().split(",");
        for (int i = 0; i < variants.length; i++) {
    //#PingConfig.java:234: ?use of default init
    //#    init'ed(variants.length)
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    basic block: bb_7
    //#    assertion: init'ed(variants.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#PingConfig.java:234: Warning: test always goes same way
    //#    test predetermined because i == variants.length
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    from bb: bb_7
    //#    live edge: bb_7-->bb_23
    //#    tested vn: i - undefined
    //#    tested vn values: {0}
    //#PingConfig.java:234: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_22
            String thisVariant = variants[i].trim();
    //#PingConfig.java:235: Warning: dead code
    //#    dead code here because i == variants.length
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_8
            if (thisVariant.length() == 0) continue;
            Matcher m = NESTED_BRACE_PAIR.matcher(thisVariant);
    //#PingConfig.java:237: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_10
            if (m.matches() && m.groupCount() == 2) {
    //#PingConfig.java:238: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_11
                String url = m.group(1).trim();
    //#PingConfig.java:239: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_12
                String optionsList = m.group(2).trim();
                Set variantOptions = new HashSet();
                String[] options = optionsList.split(",");
                for (int j = 0; j < options.length; j++) {
    //#PingConfig.java:243: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_13
    //#PingConfig.java:243: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_16
                    String option = options[j].trim().toLowerCase();
    //#PingConfig.java:244: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_14
                    if (option.length() > 0) {
                        variantOptions.add(option);
    //#PingConfig.java:246: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_15
                    }
                }
                if (!variantOptions.isEmpty()) {
    //#PingConfig.java:249: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_17
                    configuredVariants.put(url, variantOptions);
    //#PingConfig.java:250: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_18
                } else {
                    logger.warn("Ping variant entry for url '" + url + "' has an empty variant options list.  Ignored.");
    //#PingConfig.java:252: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_19
                }
            } else {
    //#PingConfig.java:254: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_20
                logger.error("Unable to parse configured ping variant '" + thisVariant + "'. Skipping this variant. Check your setting of the property " + PINGS_VARIANT_OPTIONS_PROP);
    //#PingConfig.java:255: Warning: dead code continues
    //#    dead code continues
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: void initializePingVariants()
    //#    dead bb: bb_21
            }
        }
    }
    //#PingConfig.java:258: end of method: void org.apache.roller.weblogger.config.PingConfig.initializePingVariants()

    /**
     * Get the set of variant options configured for the given ping target url.
     *
     * @param pingTargetUrl
     * @return the set of variant options configured for the given ping target url, or
     *         the empty set if there are no variants configured.
     */
    public static Set getVariantOptions(String pingTargetUrl) {
        Set variantOptions = (Set) configuredVariants.get(pingTargetUrl);
    //#PingConfig.java:268: method: Set org.apache.roller.weblogger.config.PingConfig.getVariantOptions(String)
    //#input(Set getVariantOptions(String)): configuredVariants
    //#input(Set getVariantOptions(String)): java.util.Collections.EMPTY_SET
    //#input(Set getVariantOptions(String)): pingTargetUrl
    //#output(Set getVariantOptions(String)): return_value
    //#presumption(Set getVariantOptions(String)): init'ed(java.util.Collections.EMPTY_SET)
    //#post(Set getVariantOptions(String)): init'ed(return_value)
    //#test_vector(Set getVariantOptions(String)): java.util.Map:get(...)@268: Inverse{null}, Addr_Set{null}
        if (variantOptions == null) {
            variantOptions = Collections.EMPTY_SET;
        }
        return variantOptions;
    //#PingConfig.java:272: end of method: Set org.apache.roller.weblogger.config.PingConfig.getVariantOptions(String)
    }


    // TODO: Refactor functionality below to WebloggerConfig?

    /**
     * Get the value of an integer configuration property.
     *
     * @param propName     the property name
     * @param defaultValue the default value if the property is not present
     * @param min          the minimum allowed value
     * @param max          the maximum allowed value
     * @return the value as an integer; the default value if no configured value is present or if the configured value
     *         is out of the specified range.
     */
    private static int getIntegerProperty(String propName, int defaultValue, int min, int max) {
        String configuredVal = WebloggerConfig.getProperty(propName);
    //#PingConfig.java:289: method: int org.apache.roller.weblogger.config.PingConfig.getIntegerProperty(String, int, int, int)
    //#input(int getIntegerProperty(String, int, int, int)): "' is not an integer value.  Using default value: "._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "' is not present in the configuration.  Using default value: "._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "' is outside the required range ("._tainted
    //#input(int getIntegerProperty(String, int, int, int)): ").  Using default value: "._tainted
    //#input(int getIntegerProperty(String, int, int, int)): ", "._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "="._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "ERROR: PingConfig property '"._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "Fetching property ["._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "PingConfig property '"._tainted
    //#input(int getIntegerProperty(String, int, int, int)): "]"._tainted
    //#input(int getIntegerProperty(String, int, int, int)): defaultValue
    //#input(int getIntegerProperty(String, int, int, int)): logger
    //#input(int getIntegerProperty(String, int, int, int)): max
    //#input(int getIntegerProperty(String, int, int, int)): min
    //#input(int getIntegerProperty(String, int, int, int)): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(int getIntegerProperty(String, int, int, int)): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#input(int getIntegerProperty(String, int, int, int)): propName
    //#input(int getIntegerProperty(String, int, int, int)): propName._tainted
    //#output(int getIntegerProperty(String, int, int, int)): return_value
    //#pre[4] (int getIntegerProperty(String, int, int, int)): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[5] (int getIntegerProperty(String, int, int, int)): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#presumption(int getIntegerProperty(String, int, int, int)): org.apache.commons.logging.LogFactory:getLog(...)@44 != null
    //#post(int getIntegerProperty(String, int, int, int)): init'ed(return_value)
    //#unanalyzed(int getIntegerProperty(String, int, int, int)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(int getIntegerProperty(String, int, int, int)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(int getIntegerProperty(String, int, int, int)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(int getIntegerProperty(String, int, int, int)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(int getIntegerProperty(String, int, int, int)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(int getIntegerProperty(String, int, int, int)): Effects-of-calling:java.util.Properties:getProperty
    //#test_vector(int getIntegerProperty(String, int, int, int)): org.apache.commons.logging.Log:isDebugEnabled(...)@291: {0}, {1}
        if (configuredVal == null) {
            if (logger.isDebugEnabled()) {
    //#PingConfig.java:291: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: int getIntegerProperty(String, int, int, int)
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
                logger.debug("PingConfig property '" + propName + "' is not present in the configuration.  Using default value: " + defaultValue);
    //#PingConfig.java:292: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: int getIntegerProperty(String, int, int, int)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            }
            return defaultValue;
        }

        int val;
        try {
            val = Integer.parseInt(configuredVal);
        } catch (NumberFormatException ex) {
            logger.error("ERROR: PingConfig property '" + propName + "' is not an integer value.  Using default value: " + defaultValue);
    //#PingConfig.java:301: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: int getIntegerProperty(String, int, int, int)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object)
            return defaultValue;
        }

        if (val < min || val > max) {
            logger.error("ERROR: PingConfig property '" + propName + "' is outside the required range (" + min + ", " + max + ").  Using default value: " + defaultValue);
    //#PingConfig.java:306: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: int getIntegerProperty(String, int, int, int)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object)
            return defaultValue;
        }

        return val;
    //#PingConfig.java:310: end of method: int org.apache.roller.weblogger.config.PingConfig.getIntegerProperty(String, int, int, int)
    }

    /**
     * Get the value of a boolean property with specified default.
     *
     * @param propName     the property name
     * @param defaultValue the default value if the property is not present
     * @return the configured value or the default if it the configured value is not present.
     */
    private static boolean getBooleanProperty(String propName, boolean defaultValue) {
        String configuredVal = WebloggerConfig.getProperty(propName);
    //#PingConfig.java:321: method: bool org.apache.roller.weblogger.config.PingConfig.getBooleanProperty(String, bool)
    //#input(bool getBooleanProperty(String, bool)): "' is not present in the configuration.  Using default value: "._tainted
    //#input(bool getBooleanProperty(String, bool)): "="._tainted
    //#input(bool getBooleanProperty(String, bool)): "Fetching property ["._tainted
    //#input(bool getBooleanProperty(String, bool)): "PingConfig property '"._tainted
    //#input(bool getBooleanProperty(String, bool)): "]"._tainted
    //#input(bool getBooleanProperty(String, bool)): defaultValue
    //#input(bool getBooleanProperty(String, bool)): logger
    //#input(bool getBooleanProperty(String, bool)): org/apache/roller/weblogger/config/WebloggerConfig.config
    //#input(bool getBooleanProperty(String, bool)): org/apache/roller/weblogger/config/WebloggerConfig.log
    //#input(bool getBooleanProperty(String, bool)): propName
    //#input(bool getBooleanProperty(String, bool)): propName._tainted
    //#output(bool getBooleanProperty(String, bool)): return_value
    //#pre[2] (bool getBooleanProperty(String, bool)): org/apache/roller/weblogger/config/WebloggerConfig.config != null
    //#pre[3] (bool getBooleanProperty(String, bool)): org/apache/roller/weblogger/config/WebloggerConfig.log != null
    //#presumption(bool getBooleanProperty(String, bool)): java.lang.Boolean:valueOf(...)@328 != null
    //#presumption(bool getBooleanProperty(String, bool)): org.apache.commons.logging.LogFactory:getLog(...)@44 != null
    //#post(bool getBooleanProperty(String, bool)): init'ed(return_value)
    //#unanalyzed(bool getBooleanProperty(String, bool)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(bool getBooleanProperty(String, bool)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(bool getBooleanProperty(String, bool)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(bool getBooleanProperty(String, bool)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(bool getBooleanProperty(String, bool)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(bool getBooleanProperty(String, bool)): Effects-of-calling:java.util.Properties:getProperty
    //#test_vector(bool getBooleanProperty(String, bool)): org.apache.commons.logging.Log:isDebugEnabled(...)@323: {0}, {1}
        if (configuredVal == null) {
            if (logger.isDebugEnabled()) {
    //#PingConfig.java:323: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: bool getBooleanProperty(String, bool)
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
                logger.debug("PingConfig property '" + propName + "' is not present in the configuration.  Using default value: " + defaultValue);
    //#PingConfig.java:324: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.config.PingConfig
    //#    method: bool getBooleanProperty(String, bool)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            }
            return defaultValue;
        }
        return Boolean.valueOf(configuredVal).booleanValue();
    //#PingConfig.java:328: end of method: bool org.apache.roller.weblogger.config.PingConfig.getBooleanProperty(String, bool)
    }


}
    //#PingConfig.java:: end of class: org.apache.roller.weblogger.config.PingConfig
