//# 0 errors, 133 messages
//#
/*
    //#spamscorelistener.java:1:1: class: net.sourceforge.pebble.event.response.SpamScoreListener
 * 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.Comment;
import net.sourceforge.pebble.domain.Response;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Checks the spam score of comments and TrackBacks and if greater than the
 * threshold, marks them as rejected.
 *
 * @author Simon Brown
 */
public class SpamScoreListener extends BlogEntryResponseListenerSupport {
    //#spamscorelistener.java:46: method: void net.sourceforge.pebble.event.response.SpamScoreListener.net.sourceforge.pebble.event.response.SpamScoreListener()
    //#input(void net.sourceforge.pebble.event.response.SpamScoreListener()): this
    //#spamscorelistener.java:46: end of method: void net.sourceforge.pebble.event.response.SpamScoreListener.net.sourceforge.pebble.event.response.SpamScoreListener()

  /** the log used by this class */
  private static final Log log = LogFactory.getLog(SpamScoreListener.class);
    //#spamscorelistener.java:49: method: net.sourceforge.pebble.event.response.SpamScoreListener.net.sourceforge.pebble.event.response.SpamScoreListener__static_init
    //#spamscorelistener.java:49: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.SpamScoreListener
    //#    method: net.sourceforge.pebble.event.response.SpamScoreListener__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener]
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseAdded(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseApproved(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseRejected(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseRemoved(Lnet/sourceforge/pebble/domain/Response;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.commentAdded(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.commentApproved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.commentRejected(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.commentRemoved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.trackBackAdded(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.trackBackApproved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.trackBackRejected(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): log
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): net/sourceforge/pebble/api/event/comment/CommentListener.__Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener]
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener]
    //#output(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener]
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): net/sourceforge/pebble/api/event/comment/CommentListener.__Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/response/SpamScoreListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseAdded(Lnet/sourceforge/pebble/domain/Response;)V == &blogEntryResponseAdded
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseApproved(Lnet/sourceforge/pebble/domain/Response;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.blogEntryResponseApproved
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseRejected(Lnet/sourceforge/pebble/domain/Response;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.blogEntryResponseRejected
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__static_init): __Dispatch_Table.blogEntryResponseRemoved(Lnet/sourceforge/pebble/domain/Response;)V == &net/sourceforge/pebble/event/response/BlogEntryResponseListenerSupport.blogEntryResponseRemoved
    //#post(net.sourceforge.pebble.event.response.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__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.SpamScoreListener__static_init): init'ed(log)
    //#spamscorelistener.java:49: end of method: net.sourceforge.pebble.event.response.SpamScoreListener.net.sourceforge.pebble.event.response.SpamScoreListener__static_init

  /** the default threshold for the spam score */
  public static final int DEFAULT_THRESHOLD = 1;

  /** the name of the threshold property for comments */
  public static final String COMMENT_THRESHOLD_KEY = "SpamScoreListener.commentThreshold";

  /** the name of the threshold property for TrackBacks */
  public static final String TRACKBACK_THRESHOLD_KEY = "SpamScoreListener.trackbackThreshold";

  /**
   * Called when a comment or TrackBack has been added.
   *
   * @param response a Response
   */
  protected void blogEntryResponseAdded(Response response) {
    PluginProperties props = response.getBlogEntry().getBlog().getPluginProperties();
    //#spamscorelistener.java:66: method: void net.sourceforge.pebble.event.response.SpamScoreListener.blogEntryResponseAdded(Response)
    //#spamscorelistener.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.SpamScoreListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    suspicious precondition index: [5]
    //#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/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.getSpamScore()I
    //#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.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.setRejected()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.getSpamScore()I
    //#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.setRejected()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.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.getSpamScore()I
    //#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.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.setRejected()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.spamScore
    //#input(void blogEntryResponseAdded(Response)): response.state.__Tag
    //#input(void blogEntryResponseAdded(Response)): response.title
    //#output(void blogEntryResponseAdded(Response)): response.state
    //#pre[4] (void blogEntryResponseAdded(Response)): response != null
    //#pre[5] (void blogEntryResponseAdded(Response)): response.__Tag in {net/sourceforge/pebble/domain/Comment, net/sourceforge/pebble/domain/Response, net/sourceforge/pebble/domain/TrackBack}
    //#pre[6] (void blogEntryResponseAdded(Response)): response.blogEntry != null
    //#pre[7] (void blogEntryResponseAdded(Response)): response.blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[8] (void blogEntryResponseAdded(Response)): response.blogEntry.blog != null
    //#pre[9] (void blogEntryResponseAdded(Response)): response.blogEntry.blog.__Tag == net/sourceforge/pebble/domain/Blog
    //#pre[10] (void blogEntryResponseAdded(Response)): response.blogEntry.blog.pluginProperties != null
    //#pre[12] (void blogEntryResponseAdded(Response)): init'ed(response.spamScore)
    //#pre[15] (void blogEntryResponseAdded(Response)): (soft) init'ed(response.title)
    //#presumption(void blogEntryResponseAdded(Response)): org.apache.commons.logging.LogFactory:getLog(...)@49 != null
    //#post(void blogEntryResponseAdded(Response)): response.state == One-of{old response.state, &net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2)}
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:getBlogEntry
    //#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:java.lang.String:equals
    //#unanalyzed(void blogEntryResponseAdded(Response)): Effects-of-calling:net.sourceforge.pebble.domain.Response:setState
    //#test_vector(void blogEntryResponseAdded(Response)): response.__Tag: {800_768, 804_352}, {793_344}
    //#test_vector(void blogEntryResponseAdded(Response)): net.sourceforge.pebble.PluginProperties:hasProperty(...)@74: {0}, {1}
    String propertyName = "";
    //#spamscorelistener.java:67: Warning: unused assignment
    //#    unused assignment into propertyName
    //#    severity: LOW
    //#    class: net.sourceforge.pebble.event.response.SpamScoreListener
    //#    method: void blogEntryResponseAdded(Response)
    if (response instanceof Comment) {
      propertyName = COMMENT_THRESHOLD_KEY;
    } else {
      propertyName = TRACKBACK_THRESHOLD_KEY;
    }
    int threshold = DEFAULT_THRESHOLD;
    if (props.hasProperty(propertyName)) {
    //#spamscorelistener.java:74: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.PluginProperties:hasProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.SpamScoreListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: bool net.sourceforge.pebble.PluginProperties:hasProperty(String)
      try {
        threshold = Integer.parseInt(props.getProperty(propertyName));
    //#spamscorelistener.java:76: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.PluginProperties:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.SpamScoreListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: String net.sourceforge.pebble.PluginProperties:getProperty(String)
      } catch (NumberFormatException nfe) {
        log.error(nfe.getMessage());
    //#spamscorelistener.java:78: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.SpamScoreListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object)
        // do nothing, the value has already been defaulted
      }
    }

    if (response.getSpamScore() > threshold) {
      log.info(response.getTitle() + " rejected : spam score is " + response.getSpamScore() + ", threshold is " + threshold);
    //#spamscorelistener.java:84: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.response.SpamScoreListener
    //#    method: void blogEntryResponseAdded(Response)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      response.setRejected();
    }
  }
    //#spamscorelistener.java:87: end of method: void net.sourceforge.pebble.event.response.SpamScoreListener.blogEntryResponseAdded(Response)

}
    //#spamscorelistener.java:: end of class: net.sourceforge.pebble.event.response.SpamScoreListener
