jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1226863 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/CacheManager.java
Date Tue, 03 Jan 2012 16:55:19 GMT
Author: stefan
Date: Tue Jan  3 16:55:19 2012
New Revision: 1226863

URL: http://svn.apache.org/viewvc?rev=1226863&view=rev
Log:
JCR-3194: ConcurrentModificationException in CacheManager.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/CacheManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/CacheManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/CacheManager.java?rev=1226863&r1=1226862&r2=1226863&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/CacheManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/CacheManager.java
Tue Jan  3 16:55:19 2012
@@ -161,7 +161,12 @@ public class CacheManager implements Cac
             if (now < nextLogStats) {
                 return;
             }
-            for (Cache cache : caches.keySet()) {
+            // JCR-3194 avoid ConcurrentModificationException
+            List<Cache> list = new ArrayList<Cache>();
+            synchronized (caches) {
+                list.addAll(caches.keySet());
+            }
+            for (Cache cache : list) {
                 log.debug(cache.getCacheInfoAsString());
             }
             nextLogStats = now + minLogStatsInterval;



Mime
View raw message