/** OpenSymphony BEGIN */
if (forcePersist || (!unlimitedDiskCache && !overflowPersistence)) {
persistRemove(e.key);
// If we have a CacheEntry, update the group lookups
if (oldValue instanceof CacheEntry) {
CacheEntry oldEntry = (CacheEntry) oldValue;
removeGroupMappings(oldEntry.getKey(),
oldEntry.getGroups(), true);
}
} else {
// only remove from memory groups
if (oldValue instanceof CacheEntry) {
CacheEntry oldEntry = (CacheEntry) oldValue;
removeGroupMappings(oldEntry.getKey(), oldEntry
.getGroups(), false);
}
}
if (!forcePersist && overflowPersistence && ((size() + 1) >= maxEntries)) {
persistStore(key, oldValue);
// add key to persistent groups but NOT to the memory groups
if (oldValue instanceof CacheEntry) {
CacheEntry oldEntry = (CacheEntry) oldValue;
addGroupMappings(oldEntry.getKey(), oldEntry.getGroups(), true, false);
}
}
if (invokeAlgorithm) {
itemRemoved(key);
}
// introduced to fix bug CACHE-255
if (oldValue instanceof CacheEntry) {
CacheEntry oldEntry = (CacheEntry) oldValue;
oldValue = oldEntry.getContent();
}
/** OpenSymphony END */
Entry head = e.next;