//# 3 errors, 252 messages
//#
/*
    //#CommentsPager.java:1:1: class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
 * 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.pagers;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.business.URLStrategy;
import org.apache.roller.weblogger.business.Weblogger;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.business.WeblogManager;
import org.apache.roller.weblogger.pojos.WeblogEntryComment;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryCommentWrapper;


/**
 * Paging through a collection of comments.
 */
public class CommentsPager extends AbstractPager {
    
    private static Log log = LogFactory.getLog(CommentsPager.class);
    //#CommentsPager.java:43: method: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init
    //#CommentsPager.java:43: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager]
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.createURL(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getHomeLink()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getHomeName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getItems()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getLastUpdated()Ljava/util/Date;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getNextLink()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getNextName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getPage()I
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getPrevLink()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getPrevName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getUrl()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.hasMoreItems()Z
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.setPage(I)V
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.setUrl(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): log
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager]
    //#output(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): org/apache/roller/weblogger/ui/rendering/pagers/Pager.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager]
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): org/apache/roller/weblogger/ui/rendering/pagers/Pager.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.createURL(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.createURL
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getHomeLink()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getHomeLink
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getHomeName()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getHomeName
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getItems()Ljava/util/List; == &getItems
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getLastUpdated()Ljava/util/Date; == &getLastUpdated
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getNextLink()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getNextLink
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getNextName()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getNextName
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getPage()I == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getPage
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getPrevLink()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getPrevLink
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getPrevName()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getPrevName
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.getUrl()Ljava/lang/String; == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.getUrl
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.hasMoreItems()Z == &hasMoreItems
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.setPage(I)V == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.setPage
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): __Dispatch_Table.setUrl(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.setUrl
    //#post(org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init): init'ed(log)
    //#CommentsPager.java:43: end of method: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager__static_init
    
    private Weblog weblog = null;
    private String locale = null;
    private int sinceDays = -1;
    private int length = 0;
    
    // the collection for the pager
    private List comments = null;
    
    // are there more items?
    private boolean more = false;
    
    // most recent update time of current set of entries
    private Date lastUpdated = null;        
    
    public CommentsPager(
            URLStrategy    strat,
            String         baseUrl,
            Weblog         weblog,
            String         locale,
            int            sinceDays,
            int            page,
            int            length) {
        
        super(strat, baseUrl, page);
    //#CommentsPager.java:68: method: void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)
    //#CommentsPager.java:68: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)
    //#    suspicious precondition index: [5]
    //#    Attribs:  Soft
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager]
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager]
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): __Descendant_Table[others]
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): __Dispatch_Table.getItems()Ljava/util/List;
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): __Dispatch_Table.getPage()I
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): baseUrl
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): length
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): locale
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): log
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager.__Dispatch_Table.getItems()Ljava/util/List;
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager.__Dispatch_Table.getPage()I
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): page
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): sinceDays
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): strat
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.__Tag
    //#input(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): weblog
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): new ArrayList(getItems#1) num objects
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.__Tag
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.comments
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.lastUpdated
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.length
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.locale
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.more
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.page
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.sinceDays
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.url
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.urlStrategy
    //#output(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.weblog
    //#new obj(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): new ArrayList(getItems#1)
    //#pre[2] (void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) length <= 4_294_967_294
    //#pre[4] (void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) log != null
    //#pre[5] (void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) this.__Tag in {org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager, org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager}
    //#pre[7] (void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) sinceDays <= 2_147_483_648
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.__Tag == old this.__Tag
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) this.__Tag in {org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager, org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager}
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.comments == &new ArrayList(getItems#1)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): init'ed(this.lastUpdated)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.length == length
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) this.length <= 4_294_967_294
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.locale == locale
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): init'ed(this.locale)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): init'ed(this.more)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.page == One-of{0, page}
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.page >= 0
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.sinceDays == sinceDays
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) this.sinceDays <= 2_147_483_648
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.url == baseUrl
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): init'ed(this.url)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.urlStrategy == strat
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): init'ed(this.urlStrategy)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): this.weblog == weblog
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): init'ed(this.weblog)
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): new ArrayList(getItems#1) num objects == 1
    //#post(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): (soft) length*this.page in -2_147_483_648..4_294_967_295
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Date
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:getPage
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Calendar:getInstance
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Calendar:setTime
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Calendar:add
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.Calendar:getTime
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:org.apache.roller.weblogger.business.Weblogger:getWeblogManager
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:org.apache.roller.weblogger.business.WeblogManager:getComments
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.util.List:add
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)): Effects-of-calling:org.apache.commons.logging.Log:error
        
        this.weblog = weblog;
        this.locale = locale;
        this.sinceDays = sinceDays;
        this.length = length;
        
        // initialize the collection
        getItems();
    //#CommentsPager.java:76: ?precondition failure
    //#    org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.getItems: (soft) this.length*this.page in -2_147_483_648..4_294_967_295
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)
    //#    basic block: Entry_BB_1
    //#    assertion: (soft) length*this.page in -2_147_483_648..4_294_967_295
    //#    callee: List org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.getItems()
    //#    callee assertion: (soft) this.length*this.page in -2_147_483_648..4_294_967_295
    //#    callee file: CommentsPager.java
    //#    callee precondition index: [9]
    //#    callee srcpos: 82
    //#    VN: length*this.page
    //#    Expected: {-2_147_483_648..4_294_967_295}
    //#    Bad: {-9_223_372_034_707_292_160..-2_147_483_649, 4_294_967_296..18_446_744_060_824_649_730}
    //#    Attribs:  Int  Soft  Bad < Exp  Bad > Exp
    }
    //#CommentsPager.java:77: end of method: void org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager(URLStrategy, String, Weblog, String, int, int, int)
    
    
    public List getItems() {
        
        if (comments == null) {
    //#CommentsPager.java:82: method: List org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.getItems()
    //#CommentsPager.java:82: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: List getItems()
    //#    suspicious precondition index: [7]
    //#    Attribs:  Soft
    //#input(List getItems()): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager]
    //#input(List getItems()): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager]
    //#input(List getItems()): __Descendant_Table[others]
    //#input(List getItems()): __Dispatch_Table.getPage()I
    //#input(List getItems()): log
    //#input(List getItems()): org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager.__Dispatch_Table.getPage()I
    //#input(List getItems()): this
    //#input(List getItems()): this.__Tag
    //#input(List getItems()): this.comments
    //#input(List getItems()): this.length
    //#input(List getItems()): this.page
    //#input(List getItems()): this.sinceDays
    //#input(List getItems()): this.urlStrategy
    //#input(List getItems()): this.weblog
    //#output(List getItems()): new ArrayList(getItems#1) num objects
    //#output(List getItems()): return_value
    //#output(List getItems()): this.comments
    //#output(List getItems()): this.more
    //#new obj(List getItems()): new ArrayList(getItems#1)
    //#pre[2] (List getItems()): init'ed(this.comments)
    //#pre[1] (List getItems()): (soft) log != null
    //#pre[7] (List getItems()): (soft) this.__Tag in {org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager, org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager}
    //#pre[8] (List getItems()): (soft) this.length <= 4_294_967_294
    //#pre[9] (List getItems()): (soft) this.length*this.page in -2_147_483_648..4_294_967_295
    //#pre[10] (List getItems()): (soft) init'ed(this.page)
    //#pre[11] (List getItems()): (soft) this.sinceDays <= 2_147_483_648
    //#pre[13] (List getItems()): (soft) init'ed(this.weblog)
    //#presumption(List getItems()): java.util.Calendar:getInstance(...)@90 != null
    //#presumption(List getItems()): org.apache.roller.weblogger.business.WeblogManager:getComments(...)@99 != null
    //#presumption(List getItems()): org.apache.roller.weblogger.business.Weblogger:getWeblogManager(...)@98 != null
    //#presumption(List getItems()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@97 != null
    //#post(List getItems()): return_value == One-of{old this.comments, &new ArrayList(getItems#1)}
    //#post(List getItems()): return_value != null
    //#post(List getItems()): this.comments == return_value
    //#post(List getItems()): possibly_updated(this.more)
    //#post(List getItems()): new ArrayList(getItems#1) num objects <= 1
    //#test_vector(List getItems()): this.comments: Inverse{null}, Addr_Set{null}
    //#test_vector(List getItems()): this.sinceDays: {-2_147_483_648..0}, {1..2_147_483_648}
            // calculate offset
            int offset = getPage() * length;
            
            List results = new ArrayList();
            
            Date startDate = null;
            if(sinceDays > 0) {
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                cal.add(Calendar.DATE, -1 * sinceDays);
                startDate = cal.getTime();
            }
            
            try {
                Weblogger roller = WebloggerFactory.getWeblogger();
    //#CommentsPager.java:97: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: List getItems()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
                WeblogManager wmgr = roller.getWeblogManager();
    //#CommentsPager.java:98: Warning: method not available
    //#    -- call on WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: List getItems()
    //#    unanalyzed callee: WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
                List entries = wmgr.getComments(
    //#CommentsPager.java:99: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.WeblogManager:getComments(Weblog, WeblogEntry, String, Date, Date, String, bool, int, int)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: List getItems()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.WeblogManager:getComments(Weblog, WeblogEntry, String, Date, Date, String, bool, int, int)
                        weblog, null, null, startDate, null, WeblogEntryComment.APPROVED, true, offset, length + 1);
                
                // wrap the results
                int count = 0;
                for (Iterator it = entries.iterator(); it.hasNext();) {
                    WeblogEntryComment comment = (WeblogEntryComment) it.next();
                    if (count++ < length) {
    //#CommentsPager.java:106: ?overflow
    //#    count in -2_147_483_649..4_294_967_294
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: List getItems()
    //#    basic block: bb_7
    //#    assertion: count in -2_147_483_649..4_294_967_294
    //#    VN: count + 1
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {4_294_967_296}
    //#    Attribs:  Int  Bad singleton  Bad > Exp
                        results.add(WeblogEntryCommentWrapper.wrap(comment, urlStrategy));
                    } else {
                        more = true;
                    }
                }
                
            } catch (Exception e) {
                log.error("ERROR: fetching comment list", e);
    //#CommentsPager.java:114: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: List getItems()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            }
            
            comments = results;
        }
        
        return comments;
    //#CommentsPager.java:120: end of method: List org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.getItems()
    }
    
    
    public boolean hasMoreItems() {
        return more;
    //#CommentsPager.java:125: method: bool org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.hasMoreItems()
    //#input(bool hasMoreItems()): this
    //#input(bool hasMoreItems()): this.more
    //#output(bool hasMoreItems()): return_value
    //#pre[2] (bool hasMoreItems()): init'ed(this.more)
    //#post(bool hasMoreItems()): return_value == this.more
    //#post(bool hasMoreItems()): init'ed(return_value)
    //#CommentsPager.java:125: end of method: bool org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.hasMoreItems()
    }
    
    /** Get last updated time from items in pager */
    public Date getLastUpdated() {
        if (lastUpdated == null) {
    //#CommentsPager.java:130: method: Date org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.getLastUpdated()
    //#CommentsPager.java:130: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: Date getLastUpdated()
    //#    suspicious precondition index: [6]
    //#    Attribs:  Soft
    //#input(Date getLastUpdated()): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager]
    //#input(Date getLastUpdated()): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager]
    //#input(Date getLastUpdated()): __Descendant_Table[others]
    //#input(Date getLastUpdated()): __Dispatch_Table.getItems()Ljava/util/List;
    //#input(Date getLastUpdated()): __Dispatch_Table.getPage()I
    //#input(Date getLastUpdated()): log
    //#input(Date getLastUpdated()): org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.__Descendant_Table[org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper]
    //#input(Date getLastUpdated()): org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.__Descendant_Table[others]
    //#input(Date getLastUpdated()): org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.__Dispatch_Table.getPostTime()Ljava/sql/Timestamp;
    //#input(Date getLastUpdated()): org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager.__Dispatch_Table.getItems()Ljava/util/List;
    //#input(Date getLastUpdated()): org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager.__Dispatch_Table.getPage()I
    //#input(Date getLastUpdated()): this
    //#input(Date getLastUpdated()): this.__Tag
    //#input(Date getLastUpdated()): this.comments
    //#input(Date getLastUpdated()): this.lastUpdated
    //#input(Date getLastUpdated()): this.length
    //#input(Date getLastUpdated()): this.page
    //#input(Date getLastUpdated()): this.sinceDays
    //#input(Date getLastUpdated()): this.urlStrategy
    //#input(Date getLastUpdated()): this.weblog
    //#output(Date getLastUpdated()): new ArrayList(getItems#1) num objects
    //#output(Date getLastUpdated()): new Date(getLastUpdated#1) num objects
    //#output(Date getLastUpdated()): new Date(getLastUpdated#2) num objects
    //#output(Date getLastUpdated()): return_value
    //#output(Date getLastUpdated()): this.comments
    //#output(Date getLastUpdated()): this.lastUpdated
    //#output(Date getLastUpdated()): this.more
    //#new obj(Date getLastUpdated()): new ArrayList(getItems#1)
    //#new obj(Date getLastUpdated()): new Date(getLastUpdated#1)
    //#new obj(Date getLastUpdated()): new Date(getLastUpdated#2)
    //#pre[3] (Date getLastUpdated()): init'ed(this.lastUpdated)
    //#pre[1] (Date getLastUpdated()): (soft) log != null
    //#pre[2] (Date getLastUpdated()): (soft) init'ed(this.comments)
    //#pre[6] (Date getLastUpdated()): (soft) this.__Tag in {org/apache/roller/weblogger/ui/rendering/model/FeedModel$FeedCommentsPager, org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager}
    //#pre[7] (Date getLastUpdated()): (soft) this.length <= 4_294_967_294
    //#pre[8] (Date getLastUpdated()): (soft) this.length*this.page in -2_147_483_648..4_294_967_295
    //#pre[9] (Date getLastUpdated()): (soft) init'ed(this.page)
    //#pre[10] (Date getLastUpdated()): (soft) this.sinceDays <= 2_147_483_648
    //#pre[12] (Date getLastUpdated()): (soft) init'ed(this.weblog)
    //#presumption(Date getLastUpdated()): c.pojo@135 != null
    //#presumption(Date getLastUpdated()): java.util.Iterator:next(...).__Tag@135 == org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper
    //#presumption(Date getLastUpdated()): java.util.Iterator:next(...)@135 != null
    //#presumption(Date getLastUpdated()): java.util.List:get(...).__Tag@134 == org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper
    //#presumption(Date getLastUpdated()): java.util.List:get(...).pojo@134 != null
    //#presumption(Date getLastUpdated()): java.util.List:get(...)@134 != null
    //#presumption(Date getLastUpdated()): org.apache.roller.weblogger.pojos.WeblogEntryComment:getPostTime(...)@128 != null
    //#presumption(Date getLastUpdated()): org.apache.roller.weblogger.pojos.WeblogEntryComment:getPostTime(...)@128 != null
    //#post(Date getLastUpdated()): return_value == One-of{old this.lastUpdated, &new Date(getLastUpdated#1), &new Date(getLastUpdated#2)}
    //#post(Date getLastUpdated()): return_value != null
    //#post(Date getLastUpdated()): this.lastUpdated == return_value
    //#post(Date getLastUpdated()): this.comments == One-of{old this.comments, &new ArrayList(getItems#1)}
    //#post(Date getLastUpdated()): (soft) init'ed(this.comments)
    //#post(Date getLastUpdated()): possibly_updated(this.more)
    //#post(Date getLastUpdated()): new ArrayList(getItems#1) num objects <= 1
    //#post(Date getLastUpdated()): new Date(getLastUpdated#1) num objects <= 1
    //#post(Date getLastUpdated()): new Date(getLastUpdated#2) num objects <= 1
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogEntryComment:getPostTime
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Date
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:getPage
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Calendar:getInstance
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Calendar:setTime
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Calendar:add
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.Calendar:getTime
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:org.apache.roller.weblogger.business.Weblogger:getWeblogManager
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:org.apache.roller.weblogger.business.WeblogManager:getComments
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.util.List:add
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(Date getLastUpdated()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#test_vector(Date getLastUpdated()): this.lastUpdated: Inverse{null}, Addr_Set{null}
    //#test_vector(Date getLastUpdated()): java.sql.Timestamp:after(...)@136: {0}, {1}
    //#test_vector(Date getLastUpdated()): java.util.Iterator:hasNext(...)@135: {0}, {1}
    //#test_vector(Date getLastUpdated()): java.util.List:size(...)@133: {-2_147_483_648..0}, {1..4_294_967_295}
            // feeds are sorted by pubtime, so first might not be last updated
            List<WeblogEntryCommentWrapper> items = (List<WeblogEntryCommentWrapper>)getItems();
            if (getItems() != null && getItems().size() > 0) {
    //#CommentsPager.java:133: Warning: test always goes same way
    //#    test predetermined because getItems(...) != null
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: Date getLastUpdated()
    //#    from bb: bb_2
    //#    live edge: bb_2-->bb_3
    //#    tested vn: 0
    //#    tested vn values: {0}
                Timestamp newest = ((WeblogEntryCommentWrapper)getItems().get(0)).getPostTime();
                for (WeblogEntryCommentWrapper c : items) {
                    if (c.getPostTime().after(newest)) {
                        newest = c.getPostTime();
                    }
                }
                lastUpdated = new Date(newest.getTime());
    //#CommentsPager.java:140: ?null dereference
    //#    newest != null
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
    //#    method: Date getLastUpdated()
    //#    basic block: bb_9
    //#    assertion: newest != null
    //#    VN: newest
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad  Uncertain
            } else {
                // no update so we assume it's brand new
                lastUpdated = new Date();
            }
        }
        return lastUpdated;
    //#CommentsPager.java:146: end of method: Date org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager.getLastUpdated()
    }
}

    //#CommentsPager.java:: end of class: org.apache.roller.weblogger.ui.rendering.pagers.CommentsPager
