You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2010/05/26 08:04:46 UTC
svn commit: r948331 -
/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
Author: doogie
Date: Wed May 26 06:04:45 2010
New Revision: 948331
URL: http://svn.apache.org/viewvc?rev=948331&view=rev
Log:
Inline postRemove, it's only called from one place.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java?rev=948331&r1=948330&r2=948331&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java Wed May 26 06:04:45 2010
@@ -515,7 +515,14 @@ public class UtilCache<K, V> implements
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
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) {