//# 1 errors, 221 messages
//#
/*
    //#WeblogUpdatePinger.java:1:1: class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult
    //#WeblogUpdatePinger.java:1:1: method: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init
    //#WeblogUpdatePinger.java:1:1: class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
 * 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.pings;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.config.PingConfig;
import org.apache.roller.weblogger.pojos.PingTarget;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Utility for sending a weblog update ping.
 *
 * This implements the <code>WeblogUpdates.ping<code> XML-RPC call described at
 * <a href="http://www.xmlrpc.com/weblogsCom">www.xmlrpc.com</a>
 * as well as some variants required to interoperate with certain
 * buggy but popular ping targets.
 *
 *
 * @author <a href="mailto:anil@busybuddha.org">Anil Gangolli</a>
 * @author llavandowska (for code refactored from the now-defunct <code>RollerXmlRpcClient</code>)
 */
public class WeblogUpdatePinger {
    public static final Log logger = LogFactory.getLog(WeblogUpdatePinger.class);
    //#WeblogUpdatePinger.java:52: method: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init
    //#WeblogUpdatePinger.java:52: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init): __Descendant_Table[org/apache/roller/weblogger/business/pings/WeblogUpdatePinger]
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init): logger
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init): __Descendant_Table[org/apache/roller/weblogger/business/pings/WeblogUpdatePinger] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init): init'ed(logger)
    //#WeblogUpdatePinger.java:52: end of method: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger__static_init

    /**
     * Conveys a ping result.
     */
    public static class PingResult {
        boolean error;
        String message;

        public PingResult(Boolean error, String message) {
    //#WeblogUpdatePinger.java:61: method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)
    //#input(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): error
    //#input(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): message
    //#input(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): this
    //#output(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): this.error
    //#output(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): this.message
    //#post(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): init'ed(this.error)
    //#post(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): this.message == One-of{message, &""}
    //#post(void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)): this.message != null
            this.error = error != null ? error.booleanValue() : false;
            this.message = message != null ? message : "";
        }
    //#WeblogUpdatePinger.java:64: end of method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult(Boolean, String)

        public boolean isError() {
            return error;
    //#WeblogUpdatePinger.java:67: method: bool org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.isError()
    //#input(bool isError()): this
    //#input(bool isError()): this.error
    //#output(bool isError()): return_value
    //#pre[2] (bool isError()): init'ed(this.error)
    //#post(bool isError()): return_value == this.error
    //#post(bool isError()): init'ed(return_value)
    //#WeblogUpdatePinger.java:67: end of method: bool org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.isError()
        }

        public void setError(boolean error) {
            this.error = error;
    //#WeblogUpdatePinger.java:71: method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.setError(bool)
    //#input(void setError(bool)): error
    //#input(void setError(bool)): this
    //#output(void setError(bool)): this.error
    //#post(void setError(bool)): this.error == error
    //#post(void setError(bool)): init'ed(this.error)
        }
    //#WeblogUpdatePinger.java:72: end of method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.setError(bool)

        public String getMessage() {
            return message;
    //#WeblogUpdatePinger.java:75: method: String org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.getMessage()
    //#input(String getMessage()): this
    //#input(String getMessage()): this.message
    //#output(String getMessage()): return_value
    //#pre[2] (String getMessage()): init'ed(this.message)
    //#post(String getMessage()): return_value == this.message
    //#post(String getMessage()): init'ed(return_value)
    //#WeblogUpdatePinger.java:75: end of method: String org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.getMessage()
        }

        public void setMessage(String message) {
            this.message = message;
    //#WeblogUpdatePinger.java:79: method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.setMessage(String)
    //#input(void setMessage(String)): message
    //#input(void setMessage(String)): this
    //#output(void setMessage(String)): this.message
    //#post(void setMessage(String)): this.message == message
    //#post(void setMessage(String)): init'ed(this.message)
        }
    //#WeblogUpdatePinger.java:80: end of method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.setMessage(String)

        public String toString() {
            return "PingResult{" + "error=" + error + ", message='" + message + "'" + "}";
    //#WeblogUpdatePinger.java:83: method: String org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.toString()
    //#input(String toString()): "'"._tainted
    //#input(String toString()): ", message='"._tainted
    //#input(String toString()): "PingResult{error="._tainted
    //#input(String toString()): "}"._tainted
    //#input(String toString()): this
    //#input(String toString()): this.error
    //#input(String toString()): this.message
    //#input(String toString()): this.message._tainted
    //#output(String toString()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String toString()): return_value
    //#new obj(String toString()): java.lang.StringBuilder:toString(...)
    //#pre[2] (String toString()): init'ed(this.error)
    //#pre[3] (String toString()): init'ed(this.message)
    //#post(String toString()): init'ed(java.lang.StringBuilder:toString(...)._tainted)
    //#post(String toString()): return_value == &java.lang.StringBuilder:toString(...)
    //#WeblogUpdatePinger.java:83: end of method: String org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.toString()
        }
    }

    // Inhibit construction
    private WeblogUpdatePinger() {
    //#WeblogUpdatePinger.java:88: method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger()
    }
    //#WeblogUpdatePinger.java:89: end of method: void org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger()

    /**
     * Send a weblog update ping.
     *
     * @param pingTarget         the target site to ping
     * @param website            the website that changed (from which the ping originates)
     * @return the result message string sent by the server.
     * @throws IOException if an IOException occurs during the ping
     * @throws XmlRpcException if the XML RPC client throws one
     */
    public static PingResult sendPing(PingTarget pingTarget, Weblog website) throws IOException, XmlRpcException {
        String websiteUrl = website.getAbsoluteURL();
    //#WeblogUpdatePinger.java:101: method: WeblogUpdatePinger$PingResult org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.sendPing(PingTarget, Weblog)
    //#WeblogUpdatePinger.java:101: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getAbsoluteURL()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getAbsoluteURL()
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): " with variant options "._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): ""._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): "' ("._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): "' for website '"._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): ")"._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): "; proceeding with stand-in representative."._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): "Executing ping to '"._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): "Invalid ping result of type: "._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): "Ping result is: "._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): logger
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): org/apache/roller/weblogger/config/PingConfig.configuredVariants
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): org/apache/roller/weblogger/config/PingConfig.java.util.Collections.EMPTY_SET
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): org/apache/roller/weblogger/config/PingConfig.java.util.Collections.EMPTY_SET._tainted
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): pingTarget
    //#input(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): website
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): java.lang.Object:toString(...)._tainted
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1) num objects
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1).__Tag
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1)._tainted
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1).error
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1).message
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2) num objects
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2).__Tag
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2)._tainted
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2).error
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2).message
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4) num objects
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4).__Tag
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4)._tainted
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4).error
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4).message
    //#output(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): return_value
    //#new obj(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): java.lang.Object:toString(...)
    //#new obj(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1)
    //#new obj(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2)
    //#new obj(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4)
    //#pre[1] (WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): pingTarget != null
    //#pre[2] (WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): website != null
    //#presumption(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): org.apache.commons.logging.LogFactory:getLog(...)@52 != null
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): init'ed(java.lang.Object:toString(...)._tainted)
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): return_value == One-of{&new WeblogUpdatePinger$PingResult(parseResult#1), &new WeblogUpdatePinger$PingResult(parseResult#2), &new WeblogUpdatePinger$PingResult(parseResult#4)}
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): return_value in Addr_Set{&new WeblogUpdatePinger$PingResult(parseResult#1),&new WeblogUpdatePinger$PingResult(parseResult#2),&new WeblogUpdatePinger$PingResult(parseResult#4)}
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1) num objects <= 1
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1).__Tag == org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2).__Tag == org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4).__Tag == org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1)._tainted == 0
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2)._tainted == 0
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4)._tainted == 0
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): init'ed(new WeblogUpdatePinger$PingResult(parseResult#1).error)
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#1).message == &""
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2) num objects <= 1
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): init'ed(new WeblogUpdatePinger$PingResult(parseResult#2).error)
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#2).message != null
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4) num objects <= 1
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): init'ed(new WeblogUpdatePinger$PingResult(parseResult#4).error)
    //#post(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): new WeblogUpdatePinger$PingResult(parseResult#4).message == &java.lang.Object:toString(...)
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.Boolean:booleanValue
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:org.apache.commons.logging.Log:isDebugEnabled
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.Class:getName
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): Effects-of-calling:java.lang.Object:toString
    //#test_vector(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): java.util.Set:contains(...)@107: {1}, {0}
    //#test_vector(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): org.apache.commons.logging.Log:isDebugEnabled(...)@112: {0}, {1}
    //#test_vector(WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)): org.apache.commons.logging.Log:isDebugEnabled(...)@123: {0}, {1}
        String pingTargetUrl = pingTarget.getPingUrl();
    //#WeblogUpdatePinger.java:102: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.PingTarget:getPingUrl()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.PingTarget:getPingUrl()
        Set variantOptions = PingConfig.getVariantOptions(pingTargetUrl);

        // Set up the ping parameters.
        List params = new ArrayList();
        if (!variantOptions.contains("noname")) {
    //#WeblogUpdatePinger.java:107: ?null dereference
    //#    variantOptions != null
    //#    severity: MEDIUM
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    basic block: Entry_BB_1
    //#    assertion: variantOptions != null
    //#    VN: getVariantOptions(...)
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
            // ping variant for icerocket and anyone with similar bug, where we must omit the blog name.
            params.add(website.getName());
    //#WeblogUpdatePinger.java:109: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getName()
        }
        params.add(websiteUrl);
        if (logger.isDebugEnabled()) {
    //#WeblogUpdatePinger.java:112: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
            logger.debug("Executing ping to '" + pingTargetUrl + "' for website '" + websiteUrl + "' (" + website.getName() + ")" + (variantOptions.isEmpty() ? "" : " with variant options " + variantOptions));
    //#WeblogUpdatePinger.java:113: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#WeblogUpdatePinger.java:113: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
        }

        // Send the ping.
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    //#WeblogUpdatePinger.java:117: Warning: method not available
    //#    -- call on void org.apache.xmlrpc.client.XmlRpcClientConfigImpl()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: void org.apache.xmlrpc.client.XmlRpcClientConfigImpl()
        config.setServerURL(new URL(pingTargetUrl));
    //#WeblogUpdatePinger.java:118: Warning: method not available
    //#    -- call on void org.apache.xmlrpc.client.XmlRpcClientConfigImpl:setServerURL(URL)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: void org.apache.xmlrpc.client.XmlRpcClientConfigImpl:setServerURL(URL)
        XmlRpcClient client = new XmlRpcClient();
    //#WeblogUpdatePinger.java:119: Warning: method not available
    //#    -- call on void org.apache.xmlrpc.client.XmlRpcClient()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: void org.apache.xmlrpc.client.XmlRpcClient()
        client.setConfig(config);
    //#WeblogUpdatePinger.java:120: Warning: method not available
    //#    -- call on void org.apache.xmlrpc.client.XmlRpcClient:setConfig(XmlRpcClientConfig)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: void org.apache.xmlrpc.client.XmlRpcClient:setConfig(XmlRpcClientConfig)
        PingResult pingResult = parseResult(client.execute("weblogUpdates.ping", params.toArray()));
    //#WeblogUpdatePinger.java:121: Warning: method not available
    //#    -- call on Object org.apache.xmlrpc.client.XmlRpcClient:execute(String, Object[])
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: Object org.apache.xmlrpc.client.XmlRpcClient:execute(String, Object[])

        if (logger.isDebugEnabled()) logger.debug("Ping result is: " + pingResult);
    //#WeblogUpdatePinger.java:123: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
    //#WeblogUpdatePinger.java:123: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult sendPing(PingTarget, Weblog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
        return pingResult;
    //#WeblogUpdatePinger.java:124: end of method: WeblogUpdatePinger$PingResult org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.sendPing(PingTarget, Weblog)
    }

    private static PingResult parseResult(Object obj) {
        // Deal with the fact that some buggy ping targets may not respond with the proper struct type.
        if (obj == null) return new PingResult(null,null);
    //#WeblogUpdatePinger.java:129: method: WeblogUpdatePinger$PingResult org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.parseResult(Object)
    //#input(WeblogUpdatePinger$PingResult parseResult(Object)): "; proceeding with stand-in representative."._tainted
    //#input(WeblogUpdatePinger$PingResult parseResult(Object)): "Invalid ping result of type: "._tainted
    //#input(WeblogUpdatePinger$PingResult parseResult(Object)): logger
    //#input(WeblogUpdatePinger$PingResult parseResult(Object)): obj
    //#input(WeblogUpdatePinger$PingResult parseResult(Object)): obj._tainted
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): java.lang.Object:toString(...)._tainted
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1) num objects
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1).__Tag
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1).error
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1).message
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2) num objects
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2).__Tag
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2).error
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2).message
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4) num objects
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4).__Tag
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4).error
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4).message
    //#output(WeblogUpdatePinger$PingResult parseResult(Object)): return_value
    //#new obj(WeblogUpdatePinger$PingResult parseResult(Object)): java.lang.Object:toString(...)
    //#new obj(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1)
    //#new obj(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2)
    //#new obj(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4)
    //#presumption(WeblogUpdatePinger$PingResult parseResult(Object)): java.lang.Object:getClass(...)@137 != null
    //#presumption(WeblogUpdatePinger$PingResult parseResult(Object)): org.apache.commons.logging.LogFactory:getLog(...)@52 != null
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): init'ed(java.lang.Object:toString(...)._tainted)
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): return_value in Addr_Set{&new WeblogUpdatePinger$PingResult(parseResult#2),&new WeblogUpdatePinger$PingResult(parseResult#4),&new WeblogUpdatePinger$PingResult(parseResult#1)}
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1) num objects <= 1
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1).__Tag == org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): init'ed(new WeblogUpdatePinger$PingResult(parseResult#1).error)
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#1).message == &""
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2) num objects <= 1
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2).__Tag == org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): init'ed(new WeblogUpdatePinger$PingResult(parseResult#2).error)
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#2).message != null
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4) num objects <= 1
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4).__Tag == org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): init'ed(new WeblogUpdatePinger$PingResult(parseResult#4).error)
    //#post(WeblogUpdatePinger$PingResult parseResult(Object)): new WeblogUpdatePinger$PingResult(parseResult#4).message == &java.lang.Object:toString(...)
    //#unanalyzed(WeblogUpdatePinger$PingResult parseResult(Object)): Effects-of-calling:java.lang.Boolean:booleanValue
    //#test_vector(WeblogUpdatePinger$PingResult parseResult(Object)): obj: Inverse{null}, Addr_Set{null}
        try {
            // normal case: response is a struct (represented as a Map) with Boolean flerror and String fields.
            Map result = (Map) obj;
            return new PingResult((Boolean) result.get("flerror"), (String) result.get("message"));
        } catch (Exception ex) {
            // exception case:  The caller responded with an unexpected type, though parsed at the basic XML RPC level.
            // This effectively assumes flerror = false, and sets message = obj.toString();
            if (logger.isDebugEnabled()) logger.debug("Invalid ping result of type: " + obj.getClass().getName() + "; proceeding with stand-in representative.");
    //#WeblogUpdatePinger.java:137: Warning: method not available
    //#    -- call on bool org.apache.commons.logging.Log:isDebugEnabled()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult parseResult(Object)
    //#    unanalyzed callee: bool org.apache.commons.logging.Log:isDebugEnabled()
    //#WeblogUpdatePinger.java:137: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
    //#    method: WeblogUpdatePinger$PingResult parseResult(Object)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            return new PingResult(null,obj.toString());
    //#WeblogUpdatePinger.java:138: end of method: WeblogUpdatePinger$PingResult org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.parseResult(Object)
        }
    }

    /**
     * Decide if the given exception appears to warrant later retrial attempts.
     *
     * @param ex an exception thrown by the <coce>sendPing</code> operation
     * @return true if the error warrants retrial
     */
    public static boolean shouldRetry(Exception ex) {
        // Determine if error appears transient (warranting retrial)
        // We give most errors the "benefit of the doubt" by considering them transient
        // This picks out a few that we consider non-transient
        if (ex instanceof UnknownHostException) {
    //#WeblogUpdatePinger.java:152: method: bool org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.shouldRetry(Exception)
    //#input(bool shouldRetry(Exception)): ex
    //#output(bool shouldRetry(Exception)): return_value
    //#post(bool shouldRetry(Exception)): init'ed(return_value)
            // User probably mistyped the url in the custom target.
            return false;
        } else if (ex instanceof MalformedURLException) {
            // This should never happen due to validations but if we get here, retrial won't fix it.
            return false;
        }
        return true;
    //#WeblogUpdatePinger.java:159: end of method: bool org.apache.roller.weblogger.business.pings.WeblogUpdatePinger.shouldRetry(Exception)
    }

}
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Descendant_Table[org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult]
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.getMessage()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.isError()Z
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.setError(Z)V
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.setMessage(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.toString()Ljava/lang/String;
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Descendant_Table[org/apache/roller/weblogger/business/pings/WeblogUpdatePinger$PingResult] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.getMessage()Ljava/lang/String; == &getMessage
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.isError()Z == &isError
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.setError(Z)V == &setError
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.setMessage(Ljava/lang/String;)V == &setMessage
    //#post(org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init): __Dispatch_Table.toString()Ljava/lang/String; == &toString
    //#WeblogUpdatePinger.java:: end of method: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult.org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult__static_init
    //#WeblogUpdatePinger.java:: end of class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger$PingResult
    //#WeblogUpdatePinger.java:: end of class: org.apache.roller.weblogger.business.pings.WeblogUpdatePinger
