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:
+8
-12
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user