diff --git a/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java b/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java index 706b636276..35b25cd4e0 100644 --- a/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java +++ b/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java @@ -515,7 +515,14 @@ public class UtilCache 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 existingCacheLine) { @@ -535,17 +542,6 @@ public class UtilCache 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) {