//# 2 errors, 115 messages
//#
/*
    //#CommentValidationManager.java:1:1: class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
 * 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.ui.rendering.plugins.comments;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ResourceBundle;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.config.WebloggerConfig;
import org.apache.roller.weblogger.pojos.WeblogEntryComment;
import org.apache.roller.weblogger.ui.rendering.servlets.CommentServlet;
import org.apache.roller.weblogger.util.RollerMessages;
import org.apache.roller.weblogger.util.Utilities;

/**
 * Responsible for loading validators and using them to validate comments.
 */
public class CommentValidationManager {
    private static Log     log = LogFactory.getLog(CommentValidationManager.class);
    //#CommentValidationManager.java:37: method: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init
    //#CommentValidationManager.java:37: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager]
    //#output(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Dispatch_Table.addCommentValidator(Lorg/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator;)V
    //#output(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Dispatch_Table.getValidatorCount()I
    //#output(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Dispatch_Table.validateComment(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#output(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): log
    //#post(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidationManager] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Dispatch_Table.addCommentValidator(Lorg/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator;)V == &addCommentValidator
    //#post(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Dispatch_Table.getValidatorCount()I == &getValidatorCount
    //#post(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): __Dispatch_Table.validateComment(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I == &validateComment
    //#post(org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init): init'ed(log)
    //#CommentValidationManager.java:37: end of method: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager__static_init
    private ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
    private List           validators = new ArrayList();
    
    public CommentValidationManager() {
    //#CommentValidationManager.java:41: method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): " . "._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): " CommentValidators"._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): "Configured "._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): "Configured CommentValidator: "._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): "Error accessing comment validator: "._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): "Error finding comment validator: "._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): "Error insantiating comment validator: "._tainted
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): log
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[others]
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): this
    //#output(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): new ArrayList(CommentValidationManager#1) num objects
    //#output(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): this.bundle
    //#output(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): this.validators
    //#new obj(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): new ArrayList(CommentValidationManager#1)
    //#pre[1] (void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): log != null
    //#presumption(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): java.lang.Class:forName(...)@49 != null
    //#presumption(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): java.lang.Class:newInstance(...).__Tag@50 in {org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator}
    //#post(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): init'ed(this.bundle)
    //#post(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): this.validators == &new ArrayList(CommentValidationManager#1)
    //#post(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): new ArrayList(CommentValidationManager#1) num objects == 1
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): Effects-of-calling:java.util.ResourceBundle:getString
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): Effects-of-calling:java.util.StringTokenizer
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): Effects-of-calling:java.util.StringTokenizer:countTokens
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): Effects-of-calling:java.util.StringTokenizer:hasMoreTokens
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()): Effects-of-calling:java.util.StringTokenizer:nextToken
        
        // instantiate the validators that are configured
        try {
            String vals = WebloggerConfig.getProperty("comment.validator.classnames");
    //#CommentValidationManager.java:45: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
            String[] valsarray = Utilities.stringToStringArray(vals, ",");
            for(int i=0; i < valsarray.length; i++) {
                try {
                    Class valClass = Class.forName(valsarray[i]);
                    CommentValidator val = (CommentValidator)valClass.newInstance();
                    validators.add(val);
                    log.info("Configured CommentValidator: " + val.getName() + " / " + valClass.getName());
    //#CommentValidationManager.java:52: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
                } catch (ClassNotFoundException cnfe) {
                    log.warn("Error finding comment validator: " + valsarray[i]);
    //#CommentValidationManager.java:54: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object)
                } catch (InstantiationException ie) {
                    log.warn("Error insantiating comment validator: " + valsarray[i]);
    //#CommentValidationManager.java:56: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object)
                } catch (IllegalAccessException iae) {
                    log.warn("Error accessing comment validator: " + valsarray[i]);
    //#CommentValidationManager.java:58: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object)
                }
            }
                        
        } catch (Exception e) {
            log.error("Error instantiating comment validators");
    //#CommentValidationManager.java:63: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object)
        }
        log.info("Configured " + validators.size() + " CommentValidators");
    //#CommentValidationManager.java:65: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    }
    //#CommentValidationManager.java:66: end of method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager()
    
    /**
     * Add validator to those managed by this manager (testing purposes).
     */
    public void addCommentValidator(CommentValidator val) {
        validators.add(val);
    //#CommentValidationManager.java:72: method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.addCommentValidator(CommentValidator)
    //#input(void addCommentValidator(CommentValidator)): this
    //#input(void addCommentValidator(CommentValidator)): this.validators
    //#input(void addCommentValidator(CommentValidator)): val
    //#pre[2] (void addCommentValidator(CommentValidator)): this.validators != null
    }
    //#CommentValidationManager.java:73: end of method: void org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.addCommentValidator(CommentValidator)
    
    /**
     * Return total number of validators (for teasting purposes).
     */
    public int getValidatorCount() {
        return validators.size();
    //#CommentValidationManager.java:79: method: int org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.getValidatorCount()
    //#input(int getValidatorCount()): this
    //#input(int getValidatorCount()): this.validators
    //#output(int getValidatorCount()): return_value
    //#pre[2] (int getValidatorCount()): this.validators != null
    //#post(int getValidatorCount()): init'ed(return_value)
    //#CommentValidationManager.java:79: end of method: int org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.getValidatorCount()
    }
    
    /**
     * @param comment Comment to be validated
     * @param messages Messages object to which errors will be added
     * @return Number indicating confidence that comment is valid (100 meaning 100%)
     */
    public int validateComment(WeblogEntryComment comment, RollerMessages messages) {
        int total = 0;
    //#CommentValidationManager.java:88: method: int org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.validateComment(WeblogEntryComment, RollerMessages)
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): "Invoking comment validator "._tainted
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): comment
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): log
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): messages
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator.__Dispatch_Table.validate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator.__Dispatch_Table.validate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Descendant_Table[others]
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator.__Dispatch_Table.validate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator.__Dispatch_Table.validate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator.__Dispatch_Table.validate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator.__Dispatch_Table.validate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;Lorg/apache/roller/weblogger/util/RollerMessages;)I
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): this
    //#input(int validateComment(WeblogEntryComment, RollerMessages)): this.validators
    //#output(int validateComment(WeblogEntryComment, RollerMessages)): return_value
    //#pre[5] (int validateComment(WeblogEntryComment, RollerMessages)): this.validators != null
    //#pre[2] (int validateComment(WeblogEntryComment, RollerMessages)): (soft) log != null
    //#presumption(int validateComment(WeblogEntryComment, RollerMessages)): java.util.Iterator:next(...).__Tag@91 in {org/apache/roller/weblogger/ui/rendering/plugins/comments/AkismetCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/BlacklistCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/CommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessLinksCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/ExcessSizeCommentValidator, org/apache/roller/weblogger/ui/rendering/plugins/comments/TrackbackLinkbackCommentValidator}
    //#presumption(int validateComment(WeblogEntryComment, RollerMessages)): java.util.Iterator:next(...)@91 != null
    //#presumption(int validateComment(WeblogEntryComment, RollerMessages)): java.util.List:size(...)@95 != 0
    //#post(int validateComment(WeblogEntryComment, RollerMessages)): init'ed(return_value)
    //#unanalyzed(int validateComment(WeblogEntryComment, RollerMessages)): Effects-of-calling:java.util.ResourceBundle:getString
    //#test_vector(int validateComment(WeblogEntryComment, RollerMessages)): java.util.Iterator:hasNext(...)@90: {0}, {1}
    //#test_vector(int validateComment(WeblogEntryComment, RollerMessages)): java.util.List:size(...)@89: {-2_147_483_648..0}, {1..4_294_967_295}
        if (validators.size() > 0) {
            for (Iterator it = validators.iterator(); it.hasNext();) {
                CommentValidator val = (CommentValidator) it.next();
                log.debug("Invoking comment validator "+val.getName());
    //#CommentValidationManager.java:92: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: int validateComment(WeblogEntryComment, RollerMessages)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
                total += val.validate(comment, messages);
    //#CommentValidationManager.java:93: Warning: call too complex - analysis skipped
    //#    -- call on int validate(WeblogEntryComment, RollerMessages)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: int validateComment(WeblogEntryComment, RollerMessages)
    //#    unanalyzed callee: int validate(WeblogEntryComment, RollerMessages)
    //#CommentValidationManager.java:93: ?overflow
    //#    total + validate(...) in -2_147_483_648..4_294_967_295
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: int validateComment(WeblogEntryComment, RollerMessages)
    //#    basic block: bb_8
    //#    assertion: total + validate(...) in -2_147_483_648..4_294_967_295
    //#    VN: validate(...)@93 + total
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {-4_294_967_296..-2_147_483_649, 4_294_967_296..8_589_934_590}
    //#    Attribs:  Int  Bad < Exp  Bad > Exp
            }
            total = total / validators.size();
    //#CommentValidationManager.java:95: ?overflow
    //#    total/java/util/List:size(...) in -2_147_483_648..4_294_967_295
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
    //#    method: int validateComment(WeblogEntryComment, RollerMessages)
    //#    basic block: bb_5
    //#    assertion: total/java/util/List:size(...) in -2_147_483_648..4_294_967_295
    //#    VN: total/java.util.List:size(...)@95
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {-4_294_967_295..-2_147_483_649}
    //#    Attribs:  Int  Bad < Exp
        } else {
            // When no validators: consider all comments valid
            total = 100;
        }
        return total;
    //#CommentValidationManager.java:100: end of method: int org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager.validateComment(WeblogEntryComment, RollerMessages)
    }
    
}
    //#CommentValidationManager.java:: end of class: org.apache.roller.weblogger.ui.rendering.plugins.comments.CommentValidationManager
