//# 0 errors, 337 messages
//#
/*
    //#ipaddresslistener.java:1:1: class: net.sourceforge.pebble.event.response.IpAddressListener
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.event.response;

import net.sourceforge.pebble.PluginProperties;
import net.sourceforge.pebble.domain.Response;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Checks comment and TrackBack IP address against a whitelist and a blacklist.
 * If in the whitelist, the response is left as-is. If in the blacklist,
 * the response is set to pending and the spam score incremented by 1 point.
 * If in neither, the response is set to pending but the spam score isn't
 * increased. This allows responses from new IP addresses to be manually
 * verified before publication.
 *
 * @author Simon Brown
 */
public class IpAddressListener extends BlogEntryResponseListenerSupport {
    //#ipaddresslistener.java:49: method: void net.sourceforge.pebble.event.response.IpAddressListener.net.sourceforge.pebble.event.response.IpAddressListener()
    //#input(void net.sourceforge.pebble.event.response.IpAddressListener()): this
    //#ipaddresslistener.java:49: end of method: void net.sourceforge.pebble.event.response.IpAddressListener.net.sourceforge.pebble.event.response.IpAddressListener()

  /** the log used by this class */
  private static final Log log = LogFactory.getLog(IpAddressListener.class);
    //#ipaddresslistener.java:52: method: net.sourceforge.pebble.event.response.IpAddressListener.net.sourceforge.pebble.event.response.IpAddressListener__static_init
    //#ipaddresslistener.java:52: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: net.sourceforge.pebble.event.response.IpAddressListener__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener]
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.addIpAddress(Lnet/sourceforge/pebble/domain/Response;Ljava/lang/String;)Ljava/lang/String;
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseAdded(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseApproved(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseRejected(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseRemoved(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentAdded(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentApproved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentRejected(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentRemoved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.isListed(Lnet/sourceforge/pebble/domain/Response;Ljava/lang/String;)Z
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.removeIpAddress(Lnet/sourceforge/pebble/domain/Response;Ljava/lang/String;)Ljava/lang/String;
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackAdded(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackApproved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackRejected(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): log
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): net/sourceforge/pebble/api/event/comment/CommentListener.__Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener]
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener]
    //#output(net.sourceforge.pebble.event.response.IpAddressListener__static_init): net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener]
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): net/sourceforge/pebble/api/event/comment/CommentListener.__Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/response/IpAddressListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.addIpAddress(Lnet/sourceforge/pebble/domain/Response;Ljava/lang/String;)Ljava/lang/String; == &addIpAddress
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseAdded(Lnet/sourceforge/pebble/domain/Response;)V == &blogEntryResponseAdded
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseApproved(Lnet/sourceforge/pebble/domain/Response;)V == &blogEntryResponseApproved
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseRejected(Lnet/sourceforge/pebble/domain/Response;)V == &blogEntryResponseRejected
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.blogEntryResponseRemoved(Lnet/sourceforge/pebble/domain/Response;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.blogEntryResponseRemoved
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentAdded(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.commentAdded
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentApproved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.commentApproved
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentRejected(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.commentRejected
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.commentRemoved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.commentRemoved
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.isListed(Lnet/sourceforge/pebble/domain/Response;Ljava/lang/String;)Z == &isListed
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.removeIpAddress(Lnet/sourceforge/pebble/domain/Response;Ljava/lang/String;)Ljava/lang/String; == &removeIpAddress
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackAdded(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.trackBackAdded
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackApproved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.trackBackApproved
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackRejected(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.trackBackRejected
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.trackBackRemoved
    //#post(net.sourceforge.pebble.event.response.IpAddressListener__static_init): init'ed(log)
    //#ipaddresslistener.java:52: end of method: net.sourceforge.pebble.event.response.IpAddressListener.net.sourceforge.pebble.event.response.IpAddressListener__static_init

  /** the name of the whitelist property */
  public static final String WHITELIST_KEY = "IpAddressListener.whitelist";

  /** the name of the blacklist property */
  public static final String BLACKLIST_KEY = "IpAddressListener.blacklist";

  /**
   * Called when a comment or TrackBack has been added.
   *
   * @param response a Response
   */
  protected void blogEntryResponseAdded(Response response) {
    PluginProperties props = response.getBlogEntry().getBlog().getPluginProperties();
    //#ipaddresslistener.java:66: method: void net.sourceforge.pebble.event.response.IpAddressListener.blogEntryResponseAdded(Response)
    //#ipaddresslistener.java:66: Warning: suspicious precondition
    //#    the precondition for response.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    suspicious precondition index: [7]
    //#    Attribs:  Soft
    //#input(void blogEntryResponseAdded(Response)): log
    //#input(void blogEntryResponseAdded(Response)): net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).__Tag
    //#input(void blogEntryResponseAdded(Response)): net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).__Tag
    //#input(void blogEntryResponseAdded(Response)): net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).__Tag
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[net/sourceforge/pebble/domain/Blog]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[others]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getPluginProperties()Lnet/sourceforge/pebble/PluginProperties;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[others]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Descendant_Table[others]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.areEventsEnabled()Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getState()Lnet/sourceforge/pebble/domain/State;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getTitle()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.incrementSpamScore()V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.isApproved()Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.isRejected()Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.setPending()V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.setState(Lnet/sourceforge/pebble/domain/State;)V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[others]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getState()Lnet/sourceforge/pebble/domain/State;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getTitle()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.incrementSpamScore()V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.setPending()V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.setState(Lnet/sourceforge/pebble/domain/State;)V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.APPROVED
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.PENDING
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.REJECTED
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.__Descendant_Table[net/sourceforge/pebble/domain/State]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.__Descendant_Table[others]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.__Dispatch_Table.equals(Ljava/lang/Object;)Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/State.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Descendant_Table[others]
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.areEventsEnabled()Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getState()Lnet/sourceforge/pebble/domain/State;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getTitle()Ljava/lang/String;
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.incrementSpamScore()V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.isApproved()Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.isRejected()Z
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.setPending()V
    //#input(void blogEntryResponseAdded(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.setState(Lnet/sourceforge/pebble/domain/State;)V
    //#input(void blogEntryResponseAdded(Response)): response
    //#input(void blogEntryResponseAdded(Response)): response.__Tag
    //#input(void blogEntryResponseAdded(Response)): response.blogEntry
    //#input(void blogEntryResponseAdded(Response)): response.blogEntry.__Tag
    //#input(void blogEntryResponseAdded(Response)): response.blogEntry.blog
    //#input(void blogEntryResponseAdded(Response)): response.blogEntry.blog.__Tag
    //#input(void blogEntryResponseAdded(Response)): response.blogEntry.blog.pluginProperties
    //#input(void blogEntryResponseAdded(Response)): response.ipAddress
    //#input(void blogEntryResponseAdded(Response)): response.spamScore
    //#input(void blogEntryResponseAdded(Response)): response.state.__Tag
    //#input(void blogEntryResponseAdded(Response)): response.title
    //#input(void blogEntryResponseAdded(Response)): this
    //#output(void blogEntryResponseAdded(Response)): response.spamScore
    //#output(void blogEntryResponseAdded(Response)): response.state
    //#pre[6] (void blogEntryResponseAdded(Response)): response != null
    //#pre[8] (void blogEntryResponseAdded(Response)): response.blogEntry != null
    //#pre[9] (void blogEntryResponseAdded(Response)): response.blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[10] (void blogEntryResponseAdded(Response)): response.blogEntry.blog != null
    //#pre[11] (void blogEntryResponseAdded(Response)): response.blogEntry.blog.__Tag == net/sourceforge/pebble/domain/Blog
    //#pre[12] (void blogEntryResponseAdded(Response)): response.blogEntry.blog.pluginProperties != null
    //#pre[14] (void blogEntryResponseAdded(Response)): init'ed(response.ipAddress)
    //#pre[4] (void blogEntryResponseAdded(Response)): (soft) response.spamScore <= 4_294_967_294
    //#pre[7] (void blogEntryResponseAdded(Response)): (soft) response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[17] (void blogEntryResponseAdded(Response)): (soft) init'ed(response.title)
    //#presumption(void blogEntryResponseAdded(Response)): org.apache.commons.logging.LogFactory:getLog(...)@52 != null
    //#post(void blogEntryResponseAdded(Response)): response.spamScore == One-of{old response.spamScore + 1, old response.spamScore}
    //#post(void blogEntryResponseAdded(Response)): (soft) init'ed(response.spamScore)
    //#post(void blogEntryResponseAdded(Response)): response.state == One-of{&net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3), old response.state}
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:getBlogEntry
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:getIpAddress
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:setState
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:areEventsEnabled
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:java.util.EventObject
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:net.sourceforge.pebble.api.event.PebbleEvent
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:addEvent
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:getState
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:isApproved
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:isRejected
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:net.sourceforge.pebble.domain.Response:setState

    if (isListed(response, props.getProperty(BLACKLIST_KEY))) {
    //#ipaddresslistener.java:68: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      log.info(response.getTitle() + " marked as pending : IP address " + response.getIpAddress() + " is on blacklist");
    //#ipaddresslistener.java:69: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      response.setPending();
      response.incrementSpamScore();
    } else if (isListed(response, props.getProperty(WHITELIST_KEY))) {
    //#ipaddresslistener.java:72: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      // do nothing
    } else {
      log.info(response.getTitle() + " marked as pending : IP address " + response.getIpAddress() + " not on blacklist or whitelist");
    //#ipaddresslistener.java:75: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      response.setPending();
    }
  }
    //#ipaddresslistener.java:78: end of method: void net.sourceforge.pebble.event.response.IpAddressListener.blogEntryResponseAdded(Response)

  /**
   * Called when a comment or TrackBack has been approved.
   *
   * @param response a Response
   */
  protected void blogEntryResponseApproved(Response response) {
    PluginProperties props = response.getBlogEntry().getBlog().getPluginProperties();
    //#ipaddresslistener.java:86: method: void net.sourceforge.pebble.event.response.IpAddressListener.blogEntryResponseApproved(Response)
    //#ipaddresslistener.java:86: Warning: suspicious precondition
    //#    the precondition for response.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseApproved(Response)
    //#    suspicious precondition index: [2]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[net/sourceforge/pebble/domain/Blog]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[others]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getPluginProperties()Lnet/sourceforge/pebble/PluginProperties;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[others]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[others]
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseApproved(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseApproved(Response)): response
    //#input(void blogEntryResponseApproved(Response)): response.__Tag
    //#input(void blogEntryResponseApproved(Response)): response.blogEntry
    //#input(void blogEntryResponseApproved(Response)): response.blogEntry.__Tag
    //#input(void blogEntryResponseApproved(Response)): response.blogEntry.blog
    //#input(void blogEntryResponseApproved(Response)): response.blogEntry.blog.__Tag
    //#input(void blogEntryResponseApproved(Response)): response.blogEntry.blog.pluginProperties
    //#input(void blogEntryResponseApproved(Response)): response.ipAddress
    //#input(void blogEntryResponseApproved(Response)): this
    //#pre[1] (void blogEntryResponseApproved(Response)): response != null
    //#pre[2] (void blogEntryResponseApproved(Response)): response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[3] (void blogEntryResponseApproved(Response)): response.blogEntry != null
    //#pre[4] (void blogEntryResponseApproved(Response)): response.blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[5] (void blogEntryResponseApproved(Response)): response.blogEntry.blog != null
    //#pre[6] (void blogEntryResponseApproved(Response)): response.blogEntry.blog.__Tag == net/sourceforge/pebble/domain/Blog
    //#pre[8] (void blogEntryResponseApproved(Response)): init'ed(response.ipAddress)
    //#pre[7] (void blogEntryResponseApproved(Response)): (soft) response.blogEntry.blog.pluginProperties != null
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:getIpAddress
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuffer:length
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuffer:append
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuffer:toString
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:isListed
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.String:valueOf
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void blogEntryResponseApproved(Response)): Effects-of-calling:java.lang.StringBuilder:toString
    //#test_vector(void blogEntryResponseApproved(Response)): response.ipAddress: Addr_Set{null}, Inverse{null}
    //#test_vector(void blogEntryResponseApproved(Response)): java.lang.String:length(...)@88: {1..4_294_967_295}, {0}

    if (response.getIpAddress() == null || response.getIpAddress().trim().length() == 0) {
      return;
    }

    synchronized (props) {
      String whitelist = props.getProperty(WHITELIST_KEY);
    //#ipaddresslistener.java:93: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseApproved(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      String blacklist = props.getProperty(BLACKLIST_KEY);
    //#ipaddresslistener.java:94: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseApproved(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      whitelist = addIpAddress(response, whitelist);
      blacklist = removeIpAddress(response, blacklist);
      props.setProperty(WHITELIST_KEY, whitelist);
    //#ipaddresslistener.java:97: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseApproved(Response)
    //#    unanalyzed callee: void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
      props.setProperty(BLACKLIST_KEY, blacklist);
    //#ipaddresslistener.java:98: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseApproved(Response)
    //#    unanalyzed callee: void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
      props.store();
    //#ipaddresslistener.java:99: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.PluginProperties:store()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseApproved(Response)
    //#    unanalyzed callee: void net.sourceforge.pebble.PluginProperties:store()
    }
  }
    //#ipaddresslistener.java:101: end of method: void net.sourceforge.pebble.event.response.IpAddressListener.blogEntryResponseApproved(Response)

  /**
   * Called when a comment or TrackBack has been rejected.
   *
   * @param response a Response
   */
  protected void blogEntryResponseRejected(Response response) {
    PluginProperties props = response.getBlogEntry().getBlog().getPluginProperties();
    //#ipaddresslistener.java:109: method: void net.sourceforge.pebble.event.response.IpAddressListener.blogEntryResponseRejected(Response)
    //#ipaddresslistener.java:109: Warning: suspicious precondition
    //#    the precondition for response.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseRejected(Response)
    //#    suspicious precondition index: [2]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[net/sourceforge/pebble/domain/Blog]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[others]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getPluginProperties()Lnet/sourceforge/pebble/PluginProperties;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[others]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Response.__Descendant_Table[others]
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#input(void blogEntryResponseRejected(Response)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(void blogEntryResponseRejected(Response)): response
    //#input(void blogEntryResponseRejected(Response)): response.__Tag
    //#input(void blogEntryResponseRejected(Response)): response.blogEntry
    //#input(void blogEntryResponseRejected(Response)): response.blogEntry.__Tag
    //#input(void blogEntryResponseRejected(Response)): response.blogEntry.blog
    //#input(void blogEntryResponseRejected(Response)): response.blogEntry.blog.__Tag
    //#input(void blogEntryResponseRejected(Response)): response.blogEntry.blog.pluginProperties
    //#input(void blogEntryResponseRejected(Response)): response.ipAddress
    //#input(void blogEntryResponseRejected(Response)): this
    //#pre[1] (void blogEntryResponseRejected(Response)): response != null
    //#pre[2] (void blogEntryResponseRejected(Response)): response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[3] (void blogEntryResponseRejected(Response)): response.blogEntry != null
    //#pre[4] (void blogEntryResponseRejected(Response)): response.blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[5] (void blogEntryResponseRejected(Response)): response.blogEntry.blog != null
    //#pre[6] (void blogEntryResponseRejected(Response)): response.blogEntry.blog.__Tag == net/sourceforge/pebble/domain/Blog
    //#pre[8] (void blogEntryResponseRejected(Response)): init'ed(response.ipAddress)
    //#pre[7] (void blogEntryResponseRejected(Response)): (soft) response.blogEntry.blog.pluginProperties != null
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:getIpAddress
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuffer:length
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuffer:append
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuffer:toString
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:isListed
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.String:valueOf
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void blogEntryResponseRejected(Response)): Effects-of-calling:java.lang.StringBuilder:toString
    //#test_vector(void blogEntryResponseRejected(Response)): response.ipAddress: Addr_Set{null}, Inverse{null}
    //#test_vector(void blogEntryResponseRejected(Response)): java.lang.String:length(...)@111: {1..4_294_967_295}, {0}

    if (response.getIpAddress() == null || response.getIpAddress().trim().length() == 0) {
      return;
    }

    synchronized (props) {
      String blacklist = props.getProperty(BLACKLIST_KEY);
    //#ipaddresslistener.java:116: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseRejected(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      String whitelist = props.getProperty(WHITELIST_KEY);
    //#ipaddresslistener.java:117: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseRejected(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      blacklist = addIpAddress(response, blacklist);
      whitelist = removeIpAddress(response, whitelist);
      props.setProperty(BLACKLIST_KEY, blacklist);
    //#ipaddresslistener.java:120: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseRejected(Response)
    //#    unanalyzed callee: void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
      props.setProperty(WHITELIST_KEY, whitelist);
    //#ipaddresslistener.java:121: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseRejected(Response)
    //#    unanalyzed callee: void net.sourceforge.pebble.PluginProperties:setProperty(String, String)
      props.store();
    //#ipaddresslistener.java:122: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.PluginProperties:store()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: void blogEntryResponseRejected(Response)
    //#    unanalyzed callee: void net.sourceforge.pebble.PluginProperties:store()
    }
  }
    //#ipaddresslistener.java:124: end of method: void net.sourceforge.pebble.event.response.IpAddressListener.blogEntryResponseRejected(Response)

  /**
   * Determines whether the IP address of the specified response is contained
   * within a given list of IP addresses.
   *
   * @param response    a Response instance
   * @param list        a list of IP addresses, comma separated
   * @return    true if the IP address is contained within the list,
   *            false otherwise
   */
  private boolean isListed(Response response, String list) {
    if (response.getIpAddress() == null) {
    //#ipaddresslistener.java:136: method: bool net.sourceforge.pebble.event.response.IpAddressListener.isListed(Response, String)
    //#ipaddresslistener.java:136: Warning: suspicious precondition
    //#    the precondition for response.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: bool isListed(Response, String)
    //#    suspicious precondition index: [5]
    //#input(bool isListed(Response, String)): list
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[others]
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(bool isListed(Response, String)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(bool isListed(Response, String)): response
    //#input(bool isListed(Response, String)): response.__Tag
    //#input(bool isListed(Response, String)): response.ipAddress
    //#output(bool isListed(Response, String)): return_value
    //#pre[4] (bool isListed(Response, String)): response != null
    //#pre[5] (bool isListed(Response, String)): response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[6] (bool isListed(Response, String)): init'ed(response.ipAddress)
    //#presumption(bool isListed(Response, String)): ipAddresses.length@142 <= 4_294_967_295
    //#post(bool isListed(Response, String)): init'ed(return_value)
    //#test_vector(bool isListed(Response, String)): list: Addr_Set{null}, Inverse{null}
    //#test_vector(bool isListed(Response, String)): response.ipAddress: Inverse{null}, Addr_Set{null}
    //#test_vector(bool isListed(Response, String)): java.lang.String:equals(...)@148: {0}, {1}
      return false;
    }

    String ipAddresses[] = null;
    //#ipaddresslistener.java:140: Warning: unused assignment
    //#    unused assignment into ipAddresses
    //#    severity: LOW
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: bool isListed(Response, String)
    if (list != null) {
      ipAddresses = list.split(",");
    } else {
      ipAddresses = new String[0];
    }

    for (int i = 0; i < ipAddresses.length; i++) {
      if (response.getIpAddress().equals(ipAddresses[i])) {
        return true;
      }
    }

    return false;
    //#ipaddresslistener.java:153: end of method: bool net.sourceforge.pebble.event.response.IpAddressListener.isListed(Response, String)
  }

  /**
   * Adds the IP address of the specified response to the given list.
   *
   * @param response    a Response instance
   * @param list        a list of IP addresses, comma separated
   * @return  an updated list of IP addresses
   */
  private String addIpAddress(Response response, String list) {
    if (list == null || list.trim().length() == 0) {
    //#ipaddresslistener.java:164: method: String net.sourceforge.pebble.event.response.IpAddressListener.addIpAddress(Response, String)
    //#ipaddresslistener.java:164: Warning: suspicious precondition
    //#    the precondition for response.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: String addIpAddress(Response, String)
    //#    suspicious precondition index: [3]
    //#    Attribs:  Soft
    //#input(String addIpAddress(Response, String)): list
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[others]
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(String addIpAddress(Response, String)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(String addIpAddress(Response, String)): response
    //#input(String addIpAddress(Response, String)): response.__Tag
    //#input(String addIpAddress(Response, String)): response.ipAddress
    //#input(String addIpAddress(Response, String)): this
    //#output(String addIpAddress(Response, String)): return_value
    //#pre[2] (String addIpAddress(Response, String)): (soft) response != null
    //#pre[3] (String addIpAddress(Response, String)): (soft) response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[4] (String addIpAddress(Response, String)): (soft) init'ed(response.ipAddress)
    //#post(String addIpAddress(Response, String)): init'ed(return_value)
    //#unanalyzed(String addIpAddress(Response, String)): Effects-of-calling:getIpAddress
    //#unanalyzed(String addIpAddress(Response, String)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(String addIpAddress(Response, String)): Effects-of-calling:java.lang.String:equals
    //#test_vector(String addIpAddress(Response, String)): list: Addr_Set{null}, Inverse{null}
    //#test_vector(String addIpAddress(Response, String)): java.lang.String:length(...)@164: {1..4_294_967_295}, {0}
      return response.getIpAddress();
    } else if (!isListed(response, list)) {
      return list + "," + response.getIpAddress();
    } else {
      return list;
    //#ipaddresslistener.java:169: end of method: String net.sourceforge.pebble.event.response.IpAddressListener.addIpAddress(Response, String)
    }
  }

  /**
   * Removes the IP address of the specified response to the given list.
   *
   * @param response    a Response instance
   * @param list        a list of IP addresses, comma separated
   * @return  an updated list of IP addresses
   */
  private String removeIpAddress(Response response, String list) {
    if (response.getIpAddress() == null) {
    //#ipaddresslistener.java:181: method: String net.sourceforge.pebble.event.response.IpAddressListener.removeIpAddress(Response, String)
    //#ipaddresslistener.java:181: Warning: suspicious precondition
    //#    the precondition for response.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: String removeIpAddress(Response, String)
    //#    suspicious precondition index: [5]
    //#input(String removeIpAddress(Response, String)): list
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/Response]
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[net/sourceforge/pebble/domain/TrackBack]
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Descendant_Table[others]
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/Response.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(String removeIpAddress(Response, String)): net/sourceforge/pebble/domain/TrackBack.__Dispatch_Table.getIpAddress()Ljava/lang/String;
    //#input(String removeIpAddress(Response, String)): response
    //#input(String removeIpAddress(Response, String)): response.__Tag
    //#input(String removeIpAddress(Response, String)): response.ipAddress
    //#output(String removeIpAddress(Response, String)): return_value
    //#pre[4] (String removeIpAddress(Response, String)): response != null
    //#pre[5] (String removeIpAddress(Response, String)): response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[6] (String removeIpAddress(Response, String)): init'ed(response.ipAddress)
    //#presumption(String removeIpAddress(Response, String)): ipAddresses.length@187 <= 4_294_967_295
    //#post(String removeIpAddress(Response, String)): init'ed(return_value)
    //#test_vector(String removeIpAddress(Response, String)): list: Addr_Set{null}, Inverse{null}
    //#test_vector(String removeIpAddress(Response, String)): response.ipAddress: Inverse{null}, Addr_Set{null}
    //#test_vector(String removeIpAddress(Response, String)): java.lang.String:equals(...)@194: {1}, {0}
    //#test_vector(String removeIpAddress(Response, String)): java.lang.StringBuffer:length(...)@195: {-2_147_483_648..0}, {1..4_294_967_295}
      return list;
    }

    String ipAddresses[] = null;
    //#ipaddresslistener.java:185: Warning: unused assignment
    //#    unused assignment into ipAddresses
    //#    severity: LOW
    //#    class: net.sourceforge.pebble.event.response.IpAddressListener
    //#    method: String removeIpAddress(Response, String)
    if (list != null) {
      ipAddresses = list.split(",");
    } else {
      ipAddresses = new String[0];
    }

    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < ipAddresses.length; i++) {
      if (!response.getIpAddress().equals(ipAddresses[i])) {
        if (buf.length() > 0) {
          buf.append(",");
        }
        buf.append(ipAddresses[i]);
      }
    }
    return buf.toString();
    //#ipaddresslistener.java:201: end of method: String net.sourceforge.pebble.event.response.IpAddressListener.removeIpAddress(Response, String)
  }

}
    //#ipaddresslistener.java:: end of class: net.sourceforge.pebble.event.response.IpAddressListener
