CachedPortletData cachedPortletData = (CachedPortletData) publicCacheElement.getValue();
if(publicCacheElement.isExpired() && StringUtils.isBlank(cachedPortletData.getEtag())) {
<BUG>this.publicScopePortletResourceOutputCache.remove(publicCacheKey);
return null;
}
return cachedPortletData;</BUG>
} else {
<BUG>Serializable privateCacheKey = generatePrivateScopePortletDataCacheKey(httpRequest, portletWindowId, entityId, definitionId, portletWindow.getRenderParameters());
Element privateCacheElement = this.privateScopePortletResourceOutputCache.get(privateCacheKey);</BUG>
if(privateCacheElement != null) {

CachedPortletData cachedPortletData = (CachedPortletData) publicCacheElement.getValue();
if(publicCacheElement.isExpired() && StringUtils.isBlank(cachedPortletData.getEtag())) {
this.publicScopePortletResourceOutputCache.remove(publicCacheKey);
logger.debug("Publicly cached resource output with for key {} is expired", publicCacheKey);
return null;
}
logger.debug("Returning publicly cached resource output with key {} for {}", publicCacheKey, portletWindow);
return cachedPortletData;
} else {
final PrivatePortletCacheKey privateCacheKey = new PrivatePortletCacheKey(httpRequest.getSession().getId(), portletWindowId, entityId, publicCacheKey);
Element privateCacheElement = this.privateScopePortletResourceOutputCache.get(privateCacheKey);
if(privateCacheElement != null) {
