Author: doogie
Date: Wed Nov 25 19:46:05 2009
New Revision: 884237
URL:
http://svn.apache.org/viewvc?rev=884237&view=revLog:
Remove all remaining synchronized protection against utilCacheTable.
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=884237&r1=884236&r2=884237&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 Nov 25 19:46:05 2009
@@ -352,17 +352,13 @@
*/
private static List<UtilCache<?, ?>> getUtilCacheTableValuesImage() {
List<UtilCache<?, ?>> list = new ArrayList<UtilCache<?, ?>>(utilCacheTable.size());
- synchronized (utilCacheTable) {
- list.addAll(utilCacheTable.values());
- }
+ list.addAll(utilCacheTable.values());
return list;
}
public static Set<String> getUtilCacheTableKeySet() {
Set<String> set = new HashSet<String>(utilCacheTable.size());
- synchronized (utilCacheTable) {
- set.addAll(utilCacheTable.keySet());
- }
+ set.addAll(utilCacheTable.keySet());
return set;
}
@@ -613,21 +609,12 @@
}
public static void clearCachesThatStartWith(String startsWith) {
- synchronized (utilCacheTable) {
- List<UtilCache<?, ?>> cachesToClear = FastList.newInstance();
- synchronized (utilCacheTable) {
- for (Map.Entry<String, UtilCache<?, ?>> entry: utilCacheTable.entrySet()) {
- String name = entry.getKey();
- if (name.startsWith(startsWith)) {
- UtilCache<?, ?> cache = entry.getValue();
- cachesToClear.add(cache);
- }
- }
- }
- for (UtilCache<?,?> cache : cachesToClear) {
+ for (Map.Entry<String, UtilCache<?, ?>> entry: utilCacheTable.entrySet()) {
+ String name = entry.getKey();
+ if (name.startsWith(startsWith)) {
+ UtilCache<?, ?> cache = entry.getValue();
cache.clear();
}
- cachesToClear.clear();
}
}