//# 1 errors, 502 messages
//#
/*
    //#SiteWideCache.java:1:1: class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
 * 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.util.cache;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.config.WebloggerConfig;
import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
import org.apache.roller.weblogger.pojos.WeblogBookmark;
import org.apache.roller.weblogger.pojos.WeblogEntryComment;
import org.apache.roller.weblogger.pojos.WeblogBookmarkFolder;
import org.apache.roller.weblogger.pojos.WeblogReferrer;
import org.apache.roller.weblogger.pojos.User;
import org.apache.roller.weblogger.pojos.WeblogCategory;
import org.apache.roller.weblogger.pojos.WeblogEntry;
import org.apache.roller.weblogger.pojos.WeblogTemplate;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.weblogger.ui.rendering.util.WeblogFeedRequest;
import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
import org.apache.roller.weblogger.util.Utilities;
import org.apache.roller.weblogger.util.cache.Cache;
import org.apache.roller.weblogger.util.cache.CacheHandler;
import org.apache.roller.weblogger.util.cache.CacheManager;
import org.apache.roller.weblogger.util.cache.ExpiringCacheEntry;


/**
 * Cache for site-wide weblog content.
 */
public class SiteWideCache implements CacheHandler {
    
    private static Log log = LogFactory.getLog(SiteWideCache.class);
    //#SiteWideCache.java:57: method: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init
    //#SiteWideCache.java:57: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache]
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.clear()V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.generateKey(Lorg/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.generateKey(Lorg/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object;
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.getLastModified()Ljava/util/Date;
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/User;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogBookmark;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogEntry;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogReferrer;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogTemplate;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.paramsToString(Ljava/util/Map;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.put(Ljava/lang/String;Ljava/lang/Object;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.remove(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): log
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): new SiteWideCache(SiteWideCache__static_init#1) num objects
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.__Tag
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.cacheEnabled
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.contentCache
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.lastUpdateTime
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.timeout
    //#output(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance
    //#new obj(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): new SiteWideCache(SiteWideCache__static_init#1)
    //#presumption(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): org.apache.commons.logging.LogFactory:getLog(...)@57 != null
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.clear()V == &clear
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.generateKey(Lorg/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest;)Ljava/lang/String; == &generateKey
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.generateKey(Lorg/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest;)Ljava/lang/String; == &generateKey
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object; == &get
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.getLastModified()Ljava/util/Date; == &getLastModified
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/User;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogBookmark;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogEntry;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogEntryComment;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogReferrer;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/WeblogTemplate;)V == &invalidate
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.paramsToString(Ljava/util/Map;)Ljava/lang/String; == &paramsToString
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.put(Ljava/lang/String;Ljava/lang/Object;)V == &put
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): __Dispatch_Table.remove(Ljava/lang/String;)V == &remove
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): (soft) log != null
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance == &new SiteWideCache(SiteWideCache__static_init#1)
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): new SiteWideCache(SiteWideCache__static_init#1) num objects == 1
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.__Tag == org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): init'ed(singletonInstance.cacheEnabled)
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): init'ed(singletonInstance.contentCache)
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.lastUpdateTime == null
    //#post(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): singletonInstance.timeout == 900_000
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.util.HashMap
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.util.Map:put
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:keys
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.util.Enumeration:hasMoreElements
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.util.Enumeration:nextElement
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.lang.String:length
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getProperty
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:org.apache.roller.weblogger.util.cache.CacheManager:constructCache
    //#unanalyzed(org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init): Effects-of-calling:org.apache.commons.logging.Log:warn
    
    // a unique identifier for this cache, this is used as the prefix for
    // roller config properties that apply to this cache
    public static final String CACHE_ID = "cache.sitewide";
    
    // keep cached content
    private boolean cacheEnabled = true;
    private Cache contentCache = null;
    
    // keep a cached version of last expired time
    private ExpiringCacheEntry lastUpdateTime = null;
    private long timeout = 15 * 60 * 1000;
    
    // reference to our singleton instance
    private static SiteWideCache singletonInstance = new SiteWideCache();
    //#SiteWideCache.java:72: end of method: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache__static_init
    
    
    private SiteWideCache() {
    //#SiteWideCache.java:75: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#input(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): log
    //#input(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this
    //#output(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this.cacheEnabled
    //#output(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this.contentCache
    //#output(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this.lastUpdateTime
    //#output(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this.timeout
    //#pre[1] (void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): log != null
    //#presumption(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): java.lang.String:length(...)@88 <= 4_294_967_294
    //#presumption(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): java.util.Enumeration:nextElement(...)@84 != null
    //#presumption(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): org.apache.roller.weblogger.config.WebloggerConfig:keys(...)@81 != null
    //#post(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): init'ed(this.cacheEnabled)
    //#post(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): init'ed(this.contentCache)
    //#post(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this.lastUpdateTime == null
    //#post(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): this.timeout == 900_000
    //#test_vector(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): java.lang.String:startsWith(...)@87: {0}, {1}
    //#test_vector(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): java.util.Enumeration:hasMoreElements(...)@83: {0}, {1}
    //#test_vector(void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()): org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(...)@77: {0}, {1}
        
        cacheEnabled = WebloggerConfig.getBooleanProperty(CACHE_ID+".enabled");
    //#SiteWideCache.java:77: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
        
        Map cacheProps = new HashMap();
        cacheProps.put("id", CACHE_ID);
        Enumeration allProps = WebloggerConfig.keys();
    //#SiteWideCache.java:81: Warning: method not available
    //#    -- call on Enumeration org.apache.roller.weblogger.config.WebloggerConfig:keys()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#    unanalyzed callee: Enumeration org.apache.roller.weblogger.config.WebloggerConfig:keys()
        String prop = null;
        while(allProps.hasMoreElements()) {
            prop = (String) allProps.nextElement();
            
            // we are only interested in props for this cache
            if(prop.startsWith(CACHE_ID+".")) {
                cacheProps.put(prop.substring(CACHE_ID.length()+1), 
    //#SiteWideCache.java:88: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
                        WebloggerConfig.getProperty(prop));
            }
        }
        
        log.info(cacheProps);
    //#SiteWideCache.java:93: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
        
        if(cacheEnabled) {
            contentCache = CacheManager.constructCache(this, cacheProps);
    //#SiteWideCache.java:96: Warning: method not available
    //#    -- call on Cache org.apache.roller.weblogger.util.cache.CacheManager:constructCache(CacheHandler, Map)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#    unanalyzed callee: Cache org.apache.roller.weblogger.util.cache.CacheManager:constructCache(CacheHandler, Map)
        } else {
            log.warn("Caching has been DISABLED");
    //#SiteWideCache.java:98: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:warn(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:warn(Object)
        }
    }
    //#SiteWideCache.java:100: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache()
    
    
    public static SiteWideCache getInstance() {
        return singletonInstance;
    //#SiteWideCache.java:104: method: SiteWideCache org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.getInstance()
    //#input(SiteWideCache getInstance()): singletonInstance
    //#output(SiteWideCache getInstance()): return_value
    //#pre[1] (SiteWideCache getInstance()): init'ed(singletonInstance)
    //#post(SiteWideCache getInstance()): return_value == singletonInstance
    //#post(SiteWideCache getInstance()): init'ed(return_value)
    //#SiteWideCache.java:104: end of method: SiteWideCache org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.getInstance()
    }
    
    
    public Object get(String key) {
        
        if(!cacheEnabled)
    //#SiteWideCache.java:110: method: Object org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.get(String)
    //#input(Object get(String)): "HIT "._tainted
    //#input(Object get(String)): "MISS "._tainted
    //#input(Object get(String)): key
    //#input(Object get(String)): key._tainted
    //#input(Object get(String)): log
    //#input(Object get(String)): this
    //#input(Object get(String)): this.cacheEnabled
    //#input(Object get(String)): this.contentCache
    //#output(Object get(String)): return_value
    //#pre[5] (Object get(String)): init'ed(this.cacheEnabled)
    //#pre[3] (Object get(String)): (soft) log != null
    //#pre[6] (Object get(String)): (soft) this.contentCache != null
    //#post(Object get(String)): init'ed(return_value)
    //#test_vector(Object get(String)): this.cacheEnabled: {1}, {0}
    //#test_vector(Object get(String)): org.apache.roller.weblogger.util.cache.Cache:get(...)@113: Inverse{null}, Addr_Set{null}
            return null;
        
        Object entry = contentCache.get(key);
    //#SiteWideCache.java:113: Warning: method not available
    //#    -- call on Object org.apache.roller.weblogger.util.cache.Cache:get(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: Object get(String)
    //#    unanalyzed callee: Object org.apache.roller.weblogger.util.cache.Cache:get(String)
        
        if(entry == null) {
            log.debug("MISS "+key);
    //#SiteWideCache.java:116: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: Object get(String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
        } else {
            log.debug("HIT "+key);
    //#SiteWideCache.java:118: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: Object get(String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
        }
        
        return entry;
    //#SiteWideCache.java:121: end of method: Object org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.get(String)
    }
    
    
    public void put(String key, Object value) {
        
        if(!cacheEnabled)
    //#SiteWideCache.java:127: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.put(String, Object)
    //#input(void put(String, Object)): "PUT "._tainted
    //#input(void put(String, Object)): key
    //#input(void put(String, Object)): key._tainted
    //#input(void put(String, Object)): log
    //#input(void put(String, Object)): this
    //#input(void put(String, Object)): this.cacheEnabled
    //#input(void put(String, Object)): this.contentCache
    //#input(void put(String, Object)): value
    //#pre[5] (void put(String, Object)): init'ed(this.cacheEnabled)
    //#pre[3] (void put(String, Object)): (soft) log != null
    //#pre[6] (void put(String, Object)): (soft) this.contentCache != null
    //#test_vector(void put(String, Object)): this.cacheEnabled: {1}, {0}
            return;
        
        contentCache.put(key, value);
    //#SiteWideCache.java:130: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.Cache:put(String, Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void put(String, Object)
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.Cache:put(String, Object)
        log.debug("PUT "+key);
    //#SiteWideCache.java:131: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void put(String, Object)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    }
    //#SiteWideCache.java:132: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.put(String, Object)

    
    public void remove(String key) {
        
        if(!cacheEnabled)
    //#SiteWideCache.java:137: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.remove(String)
    //#input(void remove(String)): "REMOVE "._tainted
    //#input(void remove(String)): key
    //#input(void remove(String)): key._tainted
    //#input(void remove(String)): log
    //#input(void remove(String)): this
    //#input(void remove(String)): this.cacheEnabled
    //#input(void remove(String)): this.contentCache
    //#pre[5] (void remove(String)): init'ed(this.cacheEnabled)
    //#pre[3] (void remove(String)): (soft) log != null
    //#pre[6] (void remove(String)): (soft) this.contentCache != null
    //#test_vector(void remove(String)): this.cacheEnabled: {1}, {0}
            return;
        
        contentCache.remove(key);
    //#SiteWideCache.java:140: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.Cache:remove(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void remove(String)
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.Cache:remove(String)
        log.debug("REMOVE "+key);
    //#SiteWideCache.java:141: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void remove(String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    }
    //#SiteWideCache.java:142: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.remove(String)
    
    
    public void clear() {
        
        if(!cacheEnabled)
    //#SiteWideCache.java:147: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.clear()
    //#input(void clear()): log
    //#input(void clear()): this
    //#input(void clear()): this.cacheEnabled
    //#input(void clear()): this.contentCache
    //#output(void clear()): this.lastUpdateTime
    //#pre[4] (void clear()): init'ed(this.cacheEnabled)
    //#pre[1] (void clear()): (soft) log != null
    //#pre[5] (void clear()): (soft) this.contentCache != null
    //#post(void clear()): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#test_vector(void clear()): this.cacheEnabled: {1}, {0}
            return;
        
        contentCache.clear();
    //#SiteWideCache.java:150: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.Cache:clear()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void clear()
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.Cache:clear()
        this.lastUpdateTime = null;
        log.debug("CLEAR");
    //#SiteWideCache.java:152: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void clear()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    }
    //#SiteWideCache.java:153: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.clear()
    
    
    public Date getLastModified() {
        
        Date lastModified = null;
    //#SiteWideCache.java:158: method: Date org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.getLastModified()
    //#input(Date getLastModified()): this
    //#input(Date getLastModified()): this.lastUpdateTime
    //#input(Date getLastModified()): this.timeout
    //#output(Date getLastModified()): new Date(getLastModified#1) num objects
    //#output(Date getLastModified()): new ExpiringCacheEntry(getLastModified#2) num objects
    //#output(Date getLastModified()): return_value
    //#output(Date getLastModified()): this.lastUpdateTime
    //#new obj(Date getLastModified()): new Date(getLastModified#1)
    //#new obj(Date getLastModified()): new ExpiringCacheEntry(getLastModified#2)
    //#pre[1] (Date getLastModified()): init'ed(this.lastUpdateTime)
    //#pre[3] (Date getLastModified()): (soft) init'ed(this.timeout)
    //#post(Date getLastModified()): return_value != null
    //#post(Date getLastModified()): this.lastUpdateTime == One-of{old this.lastUpdateTime, &new ExpiringCacheEntry(getLastModified#2)}
    //#post(Date getLastModified()): this.lastUpdateTime != null
    //#post(Date getLastModified()): new Date(getLastModified#1) num objects <= 1
    //#post(Date getLastModified()): new ExpiringCacheEntry(getLastModified#2) num objects <= 1
    //#test_vector(Date getLastModified()): this.lastUpdateTime: Addr_Set{null}, Inverse{null}
        
        // first try our cached version
        if(this.lastUpdateTime != null) {
            lastModified = (Date) this.lastUpdateTime.getValue();
    //#SiteWideCache.java:162: Warning: method not available
    //#    -- call on Object org.apache.roller.weblogger.util.cache.ExpiringCacheEntry:getValue()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: Date getLastModified()
    //#    unanalyzed callee: Object org.apache.roller.weblogger.util.cache.ExpiringCacheEntry:getValue()
        }
        
        // still null, we need to get a fresh value
        if(lastModified == null) {
            lastModified = new Date();
            this.lastUpdateTime = new ExpiringCacheEntry(lastModified, this.timeout);
    //#SiteWideCache.java:168: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.ExpiringCacheEntry(Object, long)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: Date getLastModified()
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.ExpiringCacheEntry(Object, long)
        }
        
        return lastModified;
    //#SiteWideCache.java:171: end of method: Date org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.getLastModified()
    }
    
    
    /**
     * Generate a cache key from a parsed weblog page request.
     * This generates a key of the form ...
     *
     * <handle>/<ctx>[/anchor][/language][/user]
     *   or
     * <handle>/<ctx>[/weblogPage][/date][/category][/tags][/language][/user]
     *
     *
     * examples ...
     *
     * foo/en
     * foo/entry_anchor
     * foo/20051110/en
     * foo/MyCategory/en/user=myname
     *
     */
    public String generateKey(WeblogPageRequest pageRequest) {
        
        StringBuffer key = new StringBuffer();
    //#SiteWideCache.java:194: method: String org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.generateKey(WeblogPageRequest)
    //#SiteWideCache.java:194: Warning: suspicious precondition
    //#    the precondition for pageRequest.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String generateKey(WeblogPageRequest)
    //#    suspicious precondition index: [5]
    //#input(String generateKey(WeblogPageRequest)): ","._tainted
    //#input(String generateKey(WeblogPageRequest)): "."._tainted
    //#input(String generateKey(WeblogPageRequest)): ".entry."._tainted
    //#input(String generateKey(WeblogPageRequest)): ".page."._tainted
    //#input(String generateKey(WeblogPageRequest)): ".page="._tainted
    //#input(String generateKey(WeblogPageRequest)): ".qp="._tainted
    //#input(String generateKey(WeblogPageRequest)): ".tags."._tainted
    //#input(String generateKey(WeblogPageRequest)): ".user="._tainted
    //#input(String generateKey(WeblogPageRequest)): ":"._tainted
    //#input(String generateKey(WeblogPageRequest)): "="._tainted
    //#input(String generateKey(WeblogPageRequest)): "cache.sitewide"._tainted
    //#input(String generateKey(WeblogPageRequest)): "page."._tainted
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest]
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest]
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Descendant_Table[others]
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getAuthenticUser()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getContext()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getCustomParams()Ljava/util/Map;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getLocale()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getPageNum()I
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getTags()Ljava/util/List;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getWeblogAnchor()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getWeblogCategoryName()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getWeblogDate()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getWeblogHandle()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest.__Dispatch_Table.getWeblogPageName()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getAuthenticUser()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getContext()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getCustomParams()Ljava/util/Map;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getLocale()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getPageNum()I
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getTags()Ljava/util/List;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getWeblogAnchor()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getWeblogCategoryName()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getWeblogDate()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getWeblogHandle()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest.__Dispatch_Table.getWeblogPageName()Ljava/lang/String;
    //#input(String generateKey(WeblogPageRequest)): pageRequest
    //#input(String generateKey(WeblogPageRequest)): pageRequest.__Tag
    //#input(String generateKey(WeblogPageRequest)): pageRequest.authenticUser
    //#input(String generateKey(WeblogPageRequest)): pageRequest.authenticUser._tainted
    //#input(String generateKey(WeblogPageRequest)): pageRequest.context
    //#input(String generateKey(WeblogPageRequest)): pageRequest.customParams
    //#input(String generateKey(WeblogPageRequest)): pageRequest.locale
    //#input(String generateKey(WeblogPageRequest)): pageRequest.locale._tainted
    //#input(String generateKey(WeblogPageRequest)): pageRequest.pageNum
    //#input(String generateKey(WeblogPageRequest)): pageRequest.tags
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogAnchor
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogCategoryName
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogDate
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogDate._tainted
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogHandle
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogHandle._tainted
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogPageName
    //#input(String generateKey(WeblogPageRequest)): pageRequest.weblogPageName._tainted
    //#input(String generateKey(WeblogPageRequest)): this
    //#output(String generateKey(WeblogPageRequest)): java.lang.StringBuffer:toString(...)._tainted
    //#output(String generateKey(WeblogPageRequest)): return_value
    //#new obj(String generateKey(WeblogPageRequest)): java.lang.StringBuffer:toString(...)
    //#pre[4] (String generateKey(WeblogPageRequest)): pageRequest != null
    //#pre[5] (String generateKey(WeblogPageRequest)): pageRequest.__Tag in {org/apache/roller/weblogger/ui/rendering/util/WeblogPageRequest, org/apache/roller/weblogger/ui/rendering/util/WeblogPreviewRequest}
    //#pre[9] (String generateKey(WeblogPageRequest)): pageRequest.customParams != null
    //#pre[10] (String generateKey(WeblogPageRequest)): init'ed(pageRequest.locale)
    //#pre[14] (String generateKey(WeblogPageRequest)): init'ed(pageRequest.weblogAnchor)
    //#pre[21] (String generateKey(WeblogPageRequest)): init'ed(pageRequest.weblogHandle)
    //#pre[6] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.authenticUser)
    //#pre[8] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.context)
    //#pre[12] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.pageNum)
    //#pre[13] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.tags)
    //#pre[18] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.weblogCategoryName)
    //#pre[19] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.weblogDate)
    //#pre[24] (String generateKey(WeblogPageRequest)): (soft) init'ed(pageRequest.weblogPageName)
    //#presumption(String generateKey(WeblogPageRequest)): java.util.Set:size(...)@236 >= 0
    //#post(String generateKey(WeblogPageRequest)): init'ed(java.lang.StringBuffer:toString(...)._tainted)
    //#post(String generateKey(WeblogPageRequest)): return_value == &java.lang.StringBuffer:toString(...)
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.util.Map:keySet
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.lang.StringBuffer:append
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.lang.StringBuffer:toString
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:java.lang.String:getBytes
    //#unanalyzed(String generateKey(WeblogPageRequest)): Effects-of-calling:org.apache.roller.weblogger.util.Utilities:toBase64
    //#test_vector(String generateKey(WeblogPageRequest)): pageRequest.locale: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogPageRequest)): pageRequest.tags: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogPageRequest)): pageRequest.weblogAnchor: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogPageRequest)): pageRequest.weblogCategoryName: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogPageRequest)): pageRequest.weblogDate: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogPageRequest)): pageRequest.weblogPageName: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogPageRequest)): java.lang.String:equals(...)@232: {0}, {1}
    //#test_vector(String generateKey(WeblogPageRequest)): java.util.List:size(...)@234: {-2_147_483_648..0}, {1..4_294_967_295}
    //#test_vector(String generateKey(WeblogPageRequest)): java.util.Map:size(...)@257: {-2_147_483_648..0}, {1..4_294_967_295}
        
        key.append(this.CACHE_ID).append(":");
        key.append("page/");
        key.append(pageRequest.getWeblogHandle());
        
        if(pageRequest.getWeblogAnchor() != null) {
            String anchor = null;
            try {
                // may contain spaces or other bad chars
                anchor = URLEncoder.encode(pageRequest.getWeblogAnchor(), "UTF-8");
            } catch(UnsupportedEncodingException ex) {
                // ignored
            }
            
            key.append("/entry/").append(anchor);
        } else {
            
            if(pageRequest.getWeblogPageName() != null) {
                key.append("/page/").append(pageRequest.getWeblogPageName());
            }
            
            if(pageRequest.getWeblogDate() != null) {
                key.append("/").append(pageRequest.getWeblogDate());
            }
            
            if(pageRequest.getWeblogCategoryName() != null) {
                String cat = null;
                try {
                    // may contain spaces or other bad chars
                    cat = URLEncoder.encode(pageRequest.getWeblogCategoryName(), "UTF-8");
                } catch(UnsupportedEncodingException ex) {
                    // ignored
                }
                
                key.append("/").append(cat);
            }
            
            if("tags".equals(pageRequest.getContext())) {
                key.append("/tags/");
                if(pageRequest.getTags() != null && pageRequest.getTags().size() > 0) {
                    Set ordered = new TreeSet(pageRequest.getTags());
                    String[] tags = (String[]) ordered.toArray(new String[ordered.size()]);
                    key.append(Utilities.stringArrayToString(tags,"+"));
    //#SiteWideCache.java:237: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.util.Utilities:stringArrayToString(String[], String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String generateKey(WeblogPageRequest)
    //#    unanalyzed callee: String org.apache.roller.weblogger.util.Utilities:stringArrayToString(String[], String)
                }
            }
        }
        
        if(pageRequest.getLocale() != null) {
            key.append("/").append(pageRequest.getLocale());
        }
        
        // add page number when applicable
        if(pageRequest.getWeblogAnchor() == null) {
            key.append("/page=").append(pageRequest.getPageNum());
        }
        
        // add login state
        if(pageRequest.getAuthenticUser() != null) {
            key.append("/user=").append(pageRequest.getAuthenticUser());
        }
        
        // we allow for arbitrary query params for custom pages
        if(pageRequest.getCustomParams().size() > 0) {
            String queryString = paramsToString(pageRequest.getCustomParams());
            
            key.append("/qp=").append(queryString);
        }

        return key.toString();
    //#SiteWideCache.java:263: end of method: String org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.generateKey(WeblogPageRequest)
    }
    
    
    /**
     * Generate a cache key from a parsed weblog feed request.
     * This generates a key of the form ...
     *
     * <handle>/<type>/<format>/[/category][/language][/excerpts]
     *
     * examples ...
     *
     * foo/entries/rss/en
     * foo/comments/rss/MyCategory/en
     * foo/entries/atom/en/excerpts
     *
     */
    public String generateKey(WeblogFeedRequest feedRequest) {
        
        StringBuffer key = new StringBuffer();
    //#SiteWideCache.java:282: method: String org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.generateKey(WeblogFeedRequest)
    //#input(String generateKey(WeblogFeedRequest)): "."._tainted
    //#input(String generateKey(WeblogFeedRequest)): ".excerpts"._tainted
    //#input(String generateKey(WeblogFeedRequest)): ".tags."._tainted
    //#input(String generateKey(WeblogFeedRequest)): ":"._tainted
    //#input(String generateKey(WeblogFeedRequest)): "cache.sitewide"._tainted
    //#input(String generateKey(WeblogFeedRequest)): "feed."._tainted
    //#input(String generateKey(WeblogFeedRequest)): feedRequest
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.__Tag
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.excerpts
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.format
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.format._tainted
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.locale
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.locale._tainted
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.tags
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.type
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.type._tainted
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.weblogCategoryName
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.weblogCategoryName._tainted
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.weblogHandle
    //#input(String generateKey(WeblogFeedRequest)): feedRequest.weblogHandle._tainted
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest]
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Descendant_Table[others]
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.getFormat()Ljava/lang/String;
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.getLocale()Ljava/lang/String;
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.getTags()Ljava/util/List;
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.getType()Ljava/lang/String;
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.getWeblogCategoryName()Ljava/lang/String;
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.getWeblogHandle()Ljava/lang/String;
    //#input(String generateKey(WeblogFeedRequest)): org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest.__Dispatch_Table.isExcerpts()Z
    //#output(String generateKey(WeblogFeedRequest)): java.lang.StringBuffer:toString(...)._tainted
    //#output(String generateKey(WeblogFeedRequest)): return_value
    //#new obj(String generateKey(WeblogFeedRequest)): java.lang.StringBuffer:toString(...)
    //#pre[1] (String generateKey(WeblogFeedRequest)): feedRequest != null
    //#pre[2] (String generateKey(WeblogFeedRequest)): feedRequest.__Tag == org/apache/roller/weblogger/ui/rendering/util/WeblogFeedRequest
    //#pre[3] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.excerpts)
    //#pre[4] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.format)
    //#pre[7] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.locale)
    //#pre[9] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.tags)
    //#pre[10] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.type)
    //#pre[12] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.weblogCategoryName)
    //#pre[14] (String generateKey(WeblogFeedRequest)): init'ed(feedRequest.weblogHandle)
    //#presumption(String generateKey(WeblogFeedRequest)): java.util.List:size(...)@311 >= 0
    //#post(String generateKey(WeblogFeedRequest)): init'ed(java.lang.StringBuffer:toString(...)._tainted)
    //#post(String generateKey(WeblogFeedRequest)): return_value == &java.lang.StringBuffer:toString(...)
    //#test_vector(String generateKey(WeblogFeedRequest)): feedRequest.excerpts: {0}, {1}
    //#test_vector(String generateKey(WeblogFeedRequest)): feedRequest.locale: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogFeedRequest)): feedRequest.tags: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogFeedRequest)): feedRequest.weblogCategoryName: Addr_Set{null}, Inverse{null}
    //#test_vector(String generateKey(WeblogFeedRequest)): java.util.List:size(...)@310: {-2_147_483_648..0}, {1..4_294_967_295}
        
        key.append(this.CACHE_ID).append(":");
        key.append("feed/");
        key.append(feedRequest.getWeblogHandle());
        
        key.append("/").append(feedRequest.getType());
        key.append("/").append(feedRequest.getFormat());
        
        if(feedRequest.getWeblogCategoryName() != null) {
            String cat = feedRequest.getWeblogCategoryName();
            try {
                cat = URLEncoder.encode(cat, "UTF-8");
            } catch (UnsupportedEncodingException ex) {
                // should never happen, utf-8 is always supported
            }
            
            key.append("/").append(cat);
        }
        
        if(feedRequest.getLocale() != null) {
            key.append("/").append(feedRequest.getLocale());
        }
        
        if(feedRequest.isExcerpts()) {
            key.append("/excerpts");
        }
        
        if(feedRequest.getTags() != null && feedRequest.getTags().size() > 0) {
          String[] tags = new String[feedRequest.getTags().size()];
          new TreeSet(feedRequest.getTags()).toArray(tags);
          key.append("/tags/").append(Utilities.stringArrayToString(tags,"+"));
    //#SiteWideCache.java:313: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.util.Utilities:stringArrayToString(String[], String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String generateKey(WeblogFeedRequest)
    //#    unanalyzed callee: String org.apache.roller.weblogger.util.Utilities:stringArrayToString(String[], String)
        }       
        
        return key.toString();
    //#SiteWideCache.java:316: end of method: String org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.generateKey(WeblogFeedRequest)
    }
    
    
    /**
     * A weblog entry has changed.
     */
    public void invalidate(WeblogEntry entry) {
        
        if(!cacheEnabled)
    //#SiteWideCache.java:325: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogEntry)
    //#input(void invalidate(WeblogEntry)): this
    //#input(void invalidate(WeblogEntry)): this.cacheEnabled
    //#input(void invalidate(WeblogEntry)): this.contentCache
    //#output(void invalidate(WeblogEntry)): this.lastUpdateTime
    //#pre[3] (void invalidate(WeblogEntry)): init'ed(this.cacheEnabled)
    //#pre[4] (void invalidate(WeblogEntry)): (soft) this.contentCache != null
    //#post(void invalidate(WeblogEntry)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#test_vector(void invalidate(WeblogEntry)): this.cacheEnabled: {1}, {0}
            return;
        
        this.contentCache.clear();
    //#SiteWideCache.java:328: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.Cache:clear()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntry)
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.Cache:clear()
        this.lastUpdateTime = null;
    }
    //#SiteWideCache.java:330: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogEntry)
    
    
    /**
     * A weblog has changed.
     */
    public void invalidate(Weblog website) {
        
        if(!cacheEnabled)
    //#SiteWideCache.java:338: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(Weblog)
    //#input(void invalidate(Weblog)): this
    //#input(void invalidate(Weblog)): this.cacheEnabled
    //#input(void invalidate(Weblog)): this.contentCache
    //#output(void invalidate(Weblog)): this.lastUpdateTime
    //#pre[3] (void invalidate(Weblog)): init'ed(this.cacheEnabled)
    //#pre[4] (void invalidate(Weblog)): (soft) this.contentCache != null
    //#post(void invalidate(Weblog)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#test_vector(void invalidate(Weblog)): this.cacheEnabled: {1}, {0}
            return;
        
        this.contentCache.clear();
    //#SiteWideCache.java:341: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.Cache:clear()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(Weblog)
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.Cache:clear()
        this.lastUpdateTime = null;
    }
    //#SiteWideCache.java:343: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(Weblog)
    
    
    /**
     * A bookmark has changed.
     */
    public void invalidate(WeblogBookmark bookmark) {
        if(WebloggerRuntimeConfig.isSiteWideWeblog(bookmark.getWebsite().getHandle())) {
    //#SiteWideCache.java:350: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogBookmark)
    //#SiteWideCache.java:350: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogBookmark:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmark)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogBookmark:getWebsite()
    //#SiteWideCache.java:350: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmark)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#SiteWideCache.java:350: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmark)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#input(void invalidate(WeblogBookmark)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache]
    //#input(void invalidate(WeblogBookmark)): __Descendant_Table[others]
    //#input(void invalidate(WeblogBookmark)): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#input(void invalidate(WeblogBookmark)): bookmark
    //#input(void invalidate(WeblogBookmark)): this
    //#input(void invalidate(WeblogBookmark)): this.__Tag
    //#input(void invalidate(WeblogBookmark)): this.cacheEnabled
    //#input(void invalidate(WeblogBookmark)): this.contentCache
    //#output(void invalidate(WeblogBookmark)): this.lastUpdateTime
    //#pre[1] (void invalidate(WeblogBookmark)): bookmark != null
    //#pre[4] (void invalidate(WeblogBookmark)): (soft) this.__Tag == org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache
    //#pre[5] (void invalidate(WeblogBookmark)): (soft) init'ed(this.cacheEnabled)
    //#pre[6] (void invalidate(WeblogBookmark)): (soft) this.contentCache != null
    //#presumption(void invalidate(WeblogBookmark)): org.apache.roller.weblogger.pojos.WeblogBookmark:getWebsite(...)@350 != null
    //#post(void invalidate(WeblogBookmark)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#unanalyzed(void invalidate(WeblogBookmark)): Effects-of-calling:org.apache.roller.weblogger.util.cache.Cache:clear
    //#test_vector(void invalidate(WeblogBookmark)): org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(...)@350: {0}, {1}
            invalidate(bookmark.getWebsite());
    //#SiteWideCache.java:351: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogBookmark:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmark)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogBookmark:getWebsite()
        }
    }
    //#SiteWideCache.java:353: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogBookmark)
    
    
    /**
     * A folder has changed.
     */
    public void invalidate(WeblogBookmarkFolder folder) {
        if(WebloggerRuntimeConfig.isSiteWideWeblog(folder.getWebsite().getHandle())) {
    //#SiteWideCache.java:360: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogBookmarkFolder)
    //#SiteWideCache.java:360: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogBookmarkFolder:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmarkFolder)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogBookmarkFolder:getWebsite()
    //#SiteWideCache.java:360: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmarkFolder)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#SiteWideCache.java:360: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmarkFolder)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#input(void invalidate(WeblogBookmarkFolder)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache]
    //#input(void invalidate(WeblogBookmarkFolder)): __Descendant_Table[others]
    //#input(void invalidate(WeblogBookmarkFolder)): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#input(void invalidate(WeblogBookmarkFolder)): folder
    //#input(void invalidate(WeblogBookmarkFolder)): this
    //#input(void invalidate(WeblogBookmarkFolder)): this.__Tag
    //#input(void invalidate(WeblogBookmarkFolder)): this.cacheEnabled
    //#input(void invalidate(WeblogBookmarkFolder)): this.contentCache
    //#output(void invalidate(WeblogBookmarkFolder)): this.lastUpdateTime
    //#pre[1] (void invalidate(WeblogBookmarkFolder)): folder != null
    //#pre[4] (void invalidate(WeblogBookmarkFolder)): (soft) this.__Tag == org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache
    //#pre[5] (void invalidate(WeblogBookmarkFolder)): (soft) init'ed(this.cacheEnabled)
    //#pre[6] (void invalidate(WeblogBookmarkFolder)): (soft) this.contentCache != null
    //#presumption(void invalidate(WeblogBookmarkFolder)): org.apache.roller.weblogger.pojos.WeblogBookmarkFolder:getWebsite(...)@360 != null
    //#post(void invalidate(WeblogBookmarkFolder)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#unanalyzed(void invalidate(WeblogBookmarkFolder)): Effects-of-calling:org.apache.roller.weblogger.util.cache.Cache:clear
    //#test_vector(void invalidate(WeblogBookmarkFolder)): org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(...)@360: {0}, {1}
            invalidate(folder.getWebsite());
    //#SiteWideCache.java:361: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogBookmarkFolder:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogBookmarkFolder)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogBookmarkFolder:getWebsite()
        }
    }
    //#SiteWideCache.java:363: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogBookmarkFolder)
    
    
    /**
     * A comment has changed.
     */
    public void invalidate(WeblogEntryComment comment) {
        if(WebloggerRuntimeConfig.isSiteWideWeblog(comment.getWeblogEntry().getWebsite().getHandle())) {
    //#SiteWideCache.java:370: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogEntryComment)
    //#SiteWideCache.java:370: Warning: method not available
    //#    -- call on WeblogEntry org.apache.roller.weblogger.pojos.WeblogEntryComment:getWeblogEntry()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntryComment)
    //#    unanalyzed callee: WeblogEntry org.apache.roller.weblogger.pojos.WeblogEntryComment:getWeblogEntry()
    //#SiteWideCache.java:370: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogEntry:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntryComment)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogEntry:getWebsite()
    //#SiteWideCache.java:370: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntryComment)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#SiteWideCache.java:370: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntryComment)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#input(void invalidate(WeblogEntryComment)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache]
    //#input(void invalidate(WeblogEntryComment)): __Descendant_Table[others]
    //#input(void invalidate(WeblogEntryComment)): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#input(void invalidate(WeblogEntryComment)): comment
    //#input(void invalidate(WeblogEntryComment)): this
    //#input(void invalidate(WeblogEntryComment)): this.__Tag
    //#input(void invalidate(WeblogEntryComment)): this.cacheEnabled
    //#input(void invalidate(WeblogEntryComment)): this.contentCache
    //#output(void invalidate(WeblogEntryComment)): this.lastUpdateTime
    //#pre[1] (void invalidate(WeblogEntryComment)): comment != null
    //#pre[4] (void invalidate(WeblogEntryComment)): (soft) this.__Tag == org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache
    //#pre[5] (void invalidate(WeblogEntryComment)): (soft) init'ed(this.cacheEnabled)
    //#pre[6] (void invalidate(WeblogEntryComment)): (soft) this.contentCache != null
    //#presumption(void invalidate(WeblogEntryComment)): org.apache.roller.weblogger.pojos.WeblogEntry:getWebsite(...)@370 != null
    //#presumption(void invalidate(WeblogEntryComment)): org.apache.roller.weblogger.pojos.WeblogEntryComment:getWeblogEntry(...)@370 != null
    //#presumption(void invalidate(WeblogEntryComment)): org.apache.roller.weblogger.pojos.WeblogEntryComment:getWeblogEntry(...)@371 != null
    //#post(void invalidate(WeblogEntryComment)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#unanalyzed(void invalidate(WeblogEntryComment)): Effects-of-calling:org.apache.roller.weblogger.util.cache.Cache:clear
    //#test_vector(void invalidate(WeblogEntryComment)): org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(...)@370: {0}, {1}
            invalidate(comment.getWeblogEntry().getWebsite());
    //#SiteWideCache.java:371: Warning: method not available
    //#    -- call on WeblogEntry org.apache.roller.weblogger.pojos.WeblogEntryComment:getWeblogEntry()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntryComment)
    //#    unanalyzed callee: WeblogEntry org.apache.roller.weblogger.pojos.WeblogEntryComment:getWeblogEntry()
    //#SiteWideCache.java:371: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogEntry:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogEntryComment)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogEntry:getWebsite()
        }
    }
    //#SiteWideCache.java:373: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogEntryComment)
    
    
    /**
     * A referer has changed.
     */
    public void invalidate(WeblogReferrer referer) {
        // ignored
    }
    //#SiteWideCache.java:381: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogReferrer)
    //#SiteWideCache.java:381: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogReferrer)
    
    
    /**
     * A user profile has changed.
     */
    public void invalidate(User user) {
        // ignored
    }
    //#SiteWideCache.java:389: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(User)
    //#SiteWideCache.java:389: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(User)
    
    
    /**
     * A category has changed.
     */
    public void invalidate(WeblogCategory category) {
        if(WebloggerRuntimeConfig.isSiteWideWeblog(category.getWebsite().getHandle())) {
    //#SiteWideCache.java:396: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogCategory)
    //#SiteWideCache.java:396: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogCategory:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogCategory)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogCategory:getWebsite()
    //#SiteWideCache.java:396: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogCategory)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#SiteWideCache.java:396: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogCategory)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#input(void invalidate(WeblogCategory)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache]
    //#input(void invalidate(WeblogCategory)): __Descendant_Table[others]
    //#input(void invalidate(WeblogCategory)): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#input(void invalidate(WeblogCategory)): category
    //#input(void invalidate(WeblogCategory)): this
    //#input(void invalidate(WeblogCategory)): this.__Tag
    //#input(void invalidate(WeblogCategory)): this.cacheEnabled
    //#input(void invalidate(WeblogCategory)): this.contentCache
    //#output(void invalidate(WeblogCategory)): this.lastUpdateTime
    //#pre[1] (void invalidate(WeblogCategory)): category != null
    //#pre[4] (void invalidate(WeblogCategory)): (soft) this.__Tag == org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache
    //#pre[5] (void invalidate(WeblogCategory)): (soft) init'ed(this.cacheEnabled)
    //#pre[6] (void invalidate(WeblogCategory)): (soft) this.contentCache != null
    //#presumption(void invalidate(WeblogCategory)): org.apache.roller.weblogger.pojos.WeblogCategory:getWebsite(...)@396 != null
    //#post(void invalidate(WeblogCategory)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#unanalyzed(void invalidate(WeblogCategory)): Effects-of-calling:org.apache.roller.weblogger.util.cache.Cache:clear
    //#test_vector(void invalidate(WeblogCategory)): org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(...)@396: {0}, {1}
            invalidate(category.getWebsite());
    //#SiteWideCache.java:397: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogCategory:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogCategory)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogCategory:getWebsite()
        }
    }
    //#SiteWideCache.java:399: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogCategory)
    
    
    /**
     * A weblog template has changed.
     */
    public void invalidate(WeblogTemplate template) {
        if(WebloggerRuntimeConfig.isSiteWideWeblog(template.getWebsite().getHandle())) {
    //#SiteWideCache.java:406: method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogTemplate)
    //#SiteWideCache.java:406: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogTemplate:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogTemplate)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogTemplate:getWebsite()
    //#SiteWideCache.java:406: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogTemplate)
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#SiteWideCache.java:406: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogTemplate)
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(String)
    //#input(void invalidate(WeblogTemplate)): __Descendant_Table[org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache]
    //#input(void invalidate(WeblogTemplate)): __Descendant_Table[others]
    //#input(void invalidate(WeblogTemplate)): __Dispatch_Table.invalidate(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#input(void invalidate(WeblogTemplate)): template
    //#input(void invalidate(WeblogTemplate)): this
    //#input(void invalidate(WeblogTemplate)): this.__Tag
    //#input(void invalidate(WeblogTemplate)): this.cacheEnabled
    //#input(void invalidate(WeblogTemplate)): this.contentCache
    //#output(void invalidate(WeblogTemplate)): this.lastUpdateTime
    //#pre[2] (void invalidate(WeblogTemplate)): template != null
    //#pre[4] (void invalidate(WeblogTemplate)): (soft) this.__Tag == org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache
    //#pre[5] (void invalidate(WeblogTemplate)): (soft) init'ed(this.cacheEnabled)
    //#pre[6] (void invalidate(WeblogTemplate)): (soft) this.contentCache != null
    //#presumption(void invalidate(WeblogTemplate)): org.apache.roller.weblogger.pojos.WeblogTemplate:getWebsite(...)@406 != null
    //#post(void invalidate(WeblogTemplate)): this.lastUpdateTime == One-of{old this.lastUpdateTime, null}
    //#unanalyzed(void invalidate(WeblogTemplate)): Effects-of-calling:org.apache.roller.weblogger.util.cache.Cache:clear
    //#test_vector(void invalidate(WeblogTemplate)): org.apache.roller.weblogger.config.WebloggerRuntimeConfig:isSiteWideWeblog(...)@406: {0}, {1}
            invalidate(template.getWebsite());
    //#SiteWideCache.java:407: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogTemplate:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: void invalidate(WeblogTemplate)
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogTemplate:getWebsite()
        }
    }
    //#SiteWideCache.java:409: end of method: void org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.invalidate(WeblogTemplate)
    
    
    private String paramsToString(Map map) {
        
        if(map == null) {
    //#SiteWideCache.java:414: method: String org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.paramsToString(Map)
    //#input(String paramsToString(Map)): ","._tainted
    //#input(String paramsToString(Map)): "="._tainted
    //#input(String paramsToString(Map)): map
    //#output(String paramsToString(Map)): return_value
    //#presumption(String paramsToString(Map)): java.util.Map:keySet(...)@422 != null
    //#presumption(String paramsToString(Map)): value.length@425 >= 1
    //#post(String paramsToString(Map)): init'ed(return_value)
    //#test_vector(String paramsToString(Map)): map: Inverse{null}, Addr_Set{null}
    //#test_vector(String paramsToString(Map)): java.util.Iterator:hasNext(...)@423: {0}, {1}
    //#test_vector(String paramsToString(Map)): java.util.Map:get(...)@425: Addr_Set{null}, Inverse{null}
            return null;
        }
        
        StringBuffer string = new StringBuffer();
        
        String key = null;
    //#SiteWideCache.java:420: Warning: unused assignment
    //#    unused assignment into key
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String paramsToString(Map)
    //#    Attribs:  Uncertain
        String[] value = null;
    //#SiteWideCache.java:421: Warning: unused assignment
    //#    unused assignment into value
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String paramsToString(Map)
    //#    Attribs:  Uncertain
        Iterator keys = map.keySet().iterator();
        while(keys.hasNext()) {
            key = (String) keys.next();
            value = (String[]) map.get(key);
            
            if(value != null) {
                string.append(",").append(key).append("=").append(value[0]);
    //#SiteWideCache.java:428: ?use of default init
    //#    init'ed(value[0])
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String paramsToString(Map)
    //#    basic block: bb_6
    //#    assertion: init'ed(value[0])
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
            }
        }
        
        return Utilities.toBase64(string.toString().substring(1).getBytes());
    //#SiteWideCache.java:432: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.util.Utilities:toBase64(byte[])
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
    //#    method: String paramsToString(Map)
    //#    unanalyzed callee: String org.apache.roller.weblogger.util.Utilities:toBase64(byte[])
    //#SiteWideCache.java:432: end of method: String org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache.paramsToString(Map)
    }
    
}
    //#SiteWideCache.java:: end of class: org.apache.roller.weblogger.ui.rendering.util.cache.SiteWideCache
