Inline postRemove, it's only called from one place.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@948331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2010-05-26 06:04:45 +00:00
parent 95e6fc9f7d
commit bb2d32984f
+8 -12
View File
@@ -515,7 +515,14 @@ public class UtilCache<K, V> implements Serializable {
if (oldCacheLine != null) {
cancel(oldCacheLine);
}
return postRemove((K) key, oldValue, countRemove);
if (oldValue != null) {
noteRemoval((K) key, oldValue);
if (countRemove) removeHitCount.incrementAndGet();
return oldValue;
} else {
if (countRemove) removeMissCount.incrementAndGet();
return null;
}
}
protected synchronized void removeInternal(Object key, CacheLine<V> existingCacheLine) {
@@ -535,17 +542,6 @@ public class UtilCache<K, V> implements Serializable {
noteRemoval((K) key, existingCacheLine.getValue());
}
V postRemove(K key, V oldValue, boolean countRemove) {
if (oldValue != null) {
noteRemoval((K) key, oldValue);
if (countRemove) removeHitCount.incrementAndGet();
return oldValue;
} else {
if (countRemove) removeMissCount.incrementAndGet();
return null;
}
}
/** Removes all elements from this cache */
public synchronized void erase() {
if (fileTable != null) {