From bb2d32984ff89a3e92e2b6c7861d9d285d0fcb59 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Wed, 26 May 2010 06:04:45 +0000 Subject: [PATCH] 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 --- .../org/ofbiz/base/util/cache/UtilCache.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) 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) {