//# 1 errors, 109 messages
//#
/*
    //#WebloggerRomeFeedFetcher.java:1:1: class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
 * 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.planet.business;

import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.planet.business.fetcher.FetcherException;
import org.apache.roller.planet.business.fetcher.RomeFeedFetcher;
import org.apache.roller.planet.pojos.Subscription;
import org.apache.roller.planet.pojos.SubscriptionEntry;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.plugins.PluginManager;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.business.UserManager;
import org.apache.roller.weblogger.business.WeblogManager;
import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
import org.apache.roller.weblogger.pojos.WeblogEntry;
import org.apache.roller.weblogger.pojos.Weblog;


/**
 * Extends Roller Planet's feed fetcher to fetch local feeds directly from 
 * Weblogger so we don't waste time with lots of feed processing.
 *
 * We expect local feeds to have urls of the style ... weblogger:<blog handle>
 */
public class WebloggerRomeFeedFetcher extends RomeFeedFetcher {
    
    private static Log log = LogFactory.getLog(WebloggerRomeFeedFetcher.class); 
    //#WebloggerRomeFeedFetcher.java:49: method: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher.org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init
    //#WebloggerRomeFeedFetcher.java:49: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init): __Descendant_Table[org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher]
    //#output(org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init): __Dispatch_Table.fetchSubscription(Ljava/lang/String;Ljava/util/Date;)Lorg/apache/roller/planet/pojos/Subscription;
    //#output(org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init): log
    //#post(org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init): __Descendant_Table[org/apache/roller/weblogger/planet/business/WebloggerRomeFeedFetcher] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init): __Dispatch_Table.fetchSubscription(Ljava/lang/String;Ljava/util/Date;)Lorg/apache/roller/planet/pojos/Subscription; == &fetchSubscription
    //#post(org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init): init'ed(log)
    //#WebloggerRomeFeedFetcher.java:49: end of method: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher.org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher__static_init
    
    
    /**
     * Creates a new instance of WebloggerRomeFeedFetcher
     */
    public WebloggerRomeFeedFetcher() {
        super();
    //#WebloggerRomeFeedFetcher.java:56: method: void org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher.org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher()
    //#WebloggerRomeFeedFetcher.java:56: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.fetcher.RomeFeedFetcher()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: void org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher()
    //#    unanalyzed callee: void org.apache.roller.planet.business.fetcher.RomeFeedFetcher()
    //#input(void org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher()): this
    }
    //#WebloggerRomeFeedFetcher.java:57: end of method: void org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher.org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher()
    
    
    @Override
    public Subscription fetchSubscription(String feedURL, Date lastModified)
            throws FetcherException {
        
        if(feedURL == null) {
    //#WebloggerRomeFeedFetcher.java:64: method: Subscription org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher.fetchSubscription(String, Date)
    //#input(Subscription fetchSubscription(String, Date)): " no longer exists in weblogger"._tainted
    //#input(Subscription fetchSubscription(String, Date)): "Error processing entries for local weblog - "._tainted
    //#input(Subscription fetchSubscription(String, Date)): "Feed is remote, letting parent handle it - "._tainted
    //#input(Subscription fetchSubscription(String, Date)): "Handling LOCAL feed - "._tainted
    //#input(Subscription fetchSubscription(String, Date)): "Local feed - "._tainted
    //#input(Subscription fetchSubscription(String, Date)): "Problem looking up local weblog - "._tainted
    //#input(Subscription fetchSubscription(String, Date)): feedURL
    //#input(Subscription fetchSubscription(String, Date)): feedURL._tainted
    //#input(Subscription fetchSubscription(String, Date)): lastModified
    //#input(Subscription fetchSubscription(String, Date)): log
    //#input(Subscription fetchSubscription(String, Date)): this
    //#output(Subscription fetchSubscription(String, Date)): new Subscription(fetchSubscription#7) num objects
    //#output(Subscription fetchSubscription(String, Date)): return_value
    //#new obj(Subscription fetchSubscription(String, Date)): new Subscription(fetchSubscription#7)
    //#pre[1] (Subscription fetchSubscription(String, Date)): feedURL != null
    //#pre[4] (Subscription fetchSubscription(String, Date)): log != null
    //#presumption(Subscription fetchSubscription(String, Date)): java.util.Iterator:next(...)@138 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle(...)@87 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.WeblogManager:getWeblogEntries(...)@121 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.Weblogger:getPluginManager(...)@136 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.Weblogger:getUrlStrategy(...)@105 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@86 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.Weblogger:getWeblogManager(...)@120 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@105 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@120 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@136 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@86 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.pojos.Weblog:getLastModified(...)@97 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.pojos.WeblogEntry:getCategory(...)@153 != null
    //#presumption(Subscription fetchSubscription(String, Date)): org.apache.roller.weblogger.pojos.WeblogEntry:getCreator(...)@148 != null
    //#post(Subscription fetchSubscription(String, Date)): init'ed(return_value)
    //#post(Subscription fetchSubscription(String, Date)): new Subscription(fetchSubscription#7) num objects <= 1
    //#test_vector(Subscription fetchSubscription(String, Date)): lastModified: Addr_Set{null}, Inverse{null}
    //#test_vector(Subscription fetchSubscription(String, Date)): java.lang.String:startsWith(...)@70: {1}, {0}
    //#test_vector(Subscription fetchSubscription(String, Date)): java.util.Date:after(...)@97: {1}, {0}
    //#test_vector(Subscription fetchSubscription(String, Date)): java.util.Iterator:hasNext(...)@138: {0}, {1}
    //#test_vector(Subscription fetchSubscription(String, Date)): org.apache.commons.lang.StringUtils:isEmpty(...)@141: {1}, {0}
    //#test_vector(Subscription fetchSubscription(String, Date)): org.apache.roller.planet.pojos.Subscription:getLastUpdated(...)@111: Inverse{null}, Addr_Set{null}
            throw new IllegalArgumentException("feed url cannot be null");
        }
        
        // we handle special weblogger planet integrated subscriptions which have
        // feedURLs defined as ... weblogger:<blog handle>
        if(!feedURL.startsWith("weblogger:")) {
            log.debug("Feed is remote, letting parent handle it - "+feedURL);            
    //#WebloggerRomeFeedFetcher.java:71: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            return super.fetchSubscription(feedURL, lastModified);
    //#WebloggerRomeFeedFetcher.java:72: Warning: method not available
    //#    -- call on Subscription org.apache.roller.planet.business.fetcher.RomeFeedFetcher:fetchSubscription(String, Date)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Subscription org.apache.roller.planet.business.fetcher.RomeFeedFetcher:fetchSubscription(String, Date)
        }
        
        // extract blog handle from our special feed url
        String weblogHandle = null;
        String[] items = feedURL.split(":", 2);
        if(items != null && items.length > 1) {
    //#WebloggerRomeFeedFetcher.java:78: Warning: test always goes same way
    //#    test predetermined because items != null
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    from bb: bb_3
    //#    live edge: bb_3-->bb_4
    //#    tested vn: 0
    //#    tested vn values: {0}
    //#WebloggerRomeFeedFetcher.java:78: ?use of default init
    //#    init'ed(items.length)
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    basic block: bb_4
    //#    assertion: init'ed(items.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#WebloggerRomeFeedFetcher.java:78: Warning: test always goes same way
    //#    test predetermined because items.length == 0
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    from bb: bb_4
    //#    live edge: bb_4-->bb_6
    //#    tested vn: undefined - 1
    //#    tested vn values: {-1}
            weblogHandle = items[1];
    //#WebloggerRomeFeedFetcher.java:79: Warning: dead code
    //#    dead code here because items.length == 0
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    dead bb: bb_5
        }
        
        log.debug("Handling LOCAL feed - "+feedURL);
    //#WebloggerRomeFeedFetcher.java:82: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
        
        Weblog localWeblog;
        try {
            UserManager usermgr = WebloggerFactory.getWeblogger().getUserManager();
    //#WebloggerRomeFeedFetcher.java:86: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#WebloggerRomeFeedFetcher.java:86: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
            localWeblog = usermgr.getWebsiteByHandle(weblogHandle);
    //#WebloggerRomeFeedFetcher.java:87: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle(String)
            if (localWeblog == null) {
                throw new FetcherException("Local feed - "+feedURL+" no longer exists in weblogger");
            }
            
        } catch (WebloggerException ex) {
            throw new FetcherException("Problem looking up local weblog - "+weblogHandle, ex);
        }
        
        // if weblog hasn't changed since last fetch then bail
        if(lastModified != null && !localWeblog.getLastModified().after(lastModified)) {
    //#WebloggerRomeFeedFetcher.java:97: Warning: method not available
    //#    -- call on Date org.apache.roller.weblogger.pojos.Weblog:getLastModified()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Date org.apache.roller.weblogger.pojos.Weblog:getLastModified()
            log.debug("Skipping unmodified LOCAL weblog");
    //#WebloggerRomeFeedFetcher.java:98: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            return null;
        }
        
        // build planet subscription from weblog
        Subscription newSub = new Subscription();
    //#WebloggerRomeFeedFetcher.java:103: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription()
        newSub.setFeedURL(feedURL);
    //#WebloggerRomeFeedFetcher.java:104: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:setFeedURL(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:setFeedURL(String)
        newSub.setSiteURL(WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogURL(localWeblog, null, true));
    //#WebloggerRomeFeedFetcher.java:105: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#WebloggerRomeFeedFetcher.java:105: Warning: method not available
    //#    -- call on URLStrategy org.apache.roller.weblogger.business.Weblogger:getUrlStrategy()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: URLStrategy org.apache.roller.weblogger.business.Weblogger:getUrlStrategy()
    //#WebloggerRomeFeedFetcher.java:105: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.business.URLStrategy:getWeblogURL(Weblog, String, bool)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.business.URLStrategy:getWeblogURL(Weblog, String, bool)
    //#WebloggerRomeFeedFetcher.java:105: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:setSiteURL(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:setSiteURL(String)
        newSub.setTitle(localWeblog.getName());
    //#WebloggerRomeFeedFetcher.java:106: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#WebloggerRomeFeedFetcher.java:106: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:setTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:setTitle(String)
        newSub.setAuthor(localWeblog.getName());
    //#WebloggerRomeFeedFetcher.java:107: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getName()
    //#WebloggerRomeFeedFetcher.java:107: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:setAuthor(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:setAuthor(String)
        newSub.setLastUpdated(localWeblog.getLastModified());
    //#WebloggerRomeFeedFetcher.java:108: Warning: method not available
    //#    -- call on Date org.apache.roller.weblogger.pojos.Weblog:getLastModified()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Date org.apache.roller.weblogger.pojos.Weblog:getLastModified()
    //#WebloggerRomeFeedFetcher.java:108: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:setLastUpdated(Date)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:setLastUpdated(Date)
        
        // must have a last updated time
        if(newSub.getLastUpdated() == null) {
    //#WebloggerRomeFeedFetcher.java:111: Warning: method not available
    //#    -- call on Date org.apache.roller.planet.pojos.Subscription:getLastUpdated()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Date org.apache.roller.planet.pojos.Subscription:getLastUpdated()
            newSub.setLastUpdated(new Date());
    //#WebloggerRomeFeedFetcher.java:112: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:setLastUpdated(Date)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:setLastUpdated(Date)
        }
        
        // lookup recent entries from weblog and add them to the subscription
        try {
            int entryCount = WebloggerRuntimeConfig.getIntProperty("site.newsfeeds.defaultEntries");
    //#WebloggerRomeFeedFetcher.java:117: Warning: method not available
    //#    -- call on int org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getIntProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: int org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getIntProperty(String)
            
            // grab recent entries for this weblog
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
    //#WebloggerRomeFeedFetcher.java:120: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#WebloggerRomeFeedFetcher.java:120: Warning: method not available
    //#    -- call on WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
            List<WeblogEntry> entries = wmgr.getWeblogEntries(
    //#WebloggerRomeFeedFetcher.java:121: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.WeblogManager:getWeblogEntries(Weblog, User, Date, Date, String, List, String, String, String, String, String, int, int)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.WeblogManager:getWeblogEntries(Weblog, User, Date, Date, String, List, String, String, String, String, String, int, int)
                    localWeblog,
                    null,
                    null,                        // startDate
                    null,                        // endDate
                    null,                        // catName
                    null,WeblogEntry.PUBLISHED,   // status
                    null,                        // text
                    null,                        // sortby (null means pubTime)
                    null,
                    null,                        // locale
                    0,                           // offset
                    entryCount);
            
            // Populate subscription object with new entries
            PluginManager ppmgr = WebloggerFactory.getWeblogger().getPluginManager();
    //#WebloggerRomeFeedFetcher.java:136: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#WebloggerRomeFeedFetcher.java:136: Warning: method not available
    //#    -- call on PluginManager org.apache.roller.weblogger.business.Weblogger:getPluginManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: PluginManager org.apache.roller.weblogger.business.Weblogger:getPluginManager()
            Map pagePlugins = ppmgr.getWeblogEntryPlugins(localWeblog);
    //#WebloggerRomeFeedFetcher.java:137: Warning: method not available
    //#    -- call on Map org.apache.roller.weblogger.business.plugins.PluginManager:getWeblogEntryPlugins(Weblog)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Map org.apache.roller.weblogger.business.plugins.PluginManager:getWeblogEntryPlugins(Weblog)
            for ( WeblogEntry rollerEntry : entries ) {
                SubscriptionEntry entry = new SubscriptionEntry();
    //#WebloggerRomeFeedFetcher.java:139: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry()
                String content = "";
    //#WebloggerRomeFeedFetcher.java:140: Warning: unused assignment
    //#    unused assignment into content
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
                if (!StringUtils.isEmpty(rollerEntry.getText())) {
    //#WebloggerRomeFeedFetcher.java:141: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogEntry:getText()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogEntry:getText()
    //#WebloggerRomeFeedFetcher.java:141: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isEmpty(String)
                    content = rollerEntry.getText();
    //#WebloggerRomeFeedFetcher.java:142: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogEntry:getText()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogEntry:getText()
                } else {
                    content = rollerEntry.getSummary();
    //#WebloggerRomeFeedFetcher.java:144: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogEntry:getSummary()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogEntry:getSummary()
                }
                content = ppmgr.applyWeblogEntryPlugins(pagePlugins, rollerEntry, content);
    //#WebloggerRomeFeedFetcher.java:146: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.business.plugins.PluginManager:applyWeblogEntryPlugins(Map, WeblogEntry, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.business.plugins.PluginManager:applyWeblogEntryPlugins(Map, WeblogEntry, String)
                
                entry.setAuthor(rollerEntry.getCreator().getScreenName());
    //#WebloggerRomeFeedFetcher.java:148: Warning: method not available
    //#    -- call on User org.apache.roller.weblogger.pojos.WeblogEntry:getCreator()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: User org.apache.roller.weblogger.pojos.WeblogEntry:getCreator()
    //#WebloggerRomeFeedFetcher.java:148: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.User:getScreenName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.User:getScreenName()
    //#WebloggerRomeFeedFetcher.java:148: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry:setAuthor(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry:setAuthor(String)
                entry.setTitle(rollerEntry.getTitle());
    //#WebloggerRomeFeedFetcher.java:149: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogEntry:getTitle()
    //#WebloggerRomeFeedFetcher.java:149: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry:setTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry:setTitle(String)
                entry.setPubTime(rollerEntry.getPubTime());
    //#WebloggerRomeFeedFetcher.java:150: Warning: method not available
    //#    -- call on Timestamp org.apache.roller.weblogger.pojos.WeblogEntry:getPubTime()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: Timestamp org.apache.roller.weblogger.pojos.WeblogEntry:getPubTime()
    //#WebloggerRomeFeedFetcher.java:150: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry:setPubTime(Timestamp)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry:setPubTime(Timestamp)
                entry.setText(content);
    //#WebloggerRomeFeedFetcher.java:151: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry:setText(String)
                entry.setPermalink(rollerEntry.getPermalink());
    //#WebloggerRomeFeedFetcher.java:152: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogEntry:getPermalink()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogEntry:getPermalink()
    //#WebloggerRomeFeedFetcher.java:152: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry:setPermalink(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry:setPermalink(String)
                entry.setCategoriesString(rollerEntry.getCategory().getPath());
    //#WebloggerRomeFeedFetcher.java:153: Warning: method not available
    //#    -- call on WeblogCategory org.apache.roller.weblogger.pojos.WeblogEntry:getCategory()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: WeblogCategory org.apache.roller.weblogger.pojos.WeblogEntry:getCategory()
    //#WebloggerRomeFeedFetcher.java:153: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogCategory:getPath()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogCategory:getPath()
    //#WebloggerRomeFeedFetcher.java:153: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.SubscriptionEntry:setCategoriesString(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.SubscriptionEntry:setCategoriesString(String)
                
                newSub.addEntry(entry);
    //#WebloggerRomeFeedFetcher.java:155: Warning: method not available
    //#    -- call on void org.apache.roller.planet.pojos.Subscription:addEntry(SubscriptionEntry)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
    //#    method: Subscription fetchSubscription(String, Date)
    //#    unanalyzed callee: void org.apache.roller.planet.pojos.Subscription:addEntry(SubscriptionEntry)
            }
            
        } catch (WebloggerException ex) {
            throw new FetcherException("Error processing entries for local weblog - "+weblogHandle, ex);
        }
        
        // all done
        return newSub;
    //#WebloggerRomeFeedFetcher.java:163: end of method: Subscription org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher.fetchSubscription(String, Date)
    }
        
}
    //#WebloggerRomeFeedFetcher.java:: end of class: org.apache.roller.weblogger.planet.business.WebloggerRomeFeedFetcher
