Author: shuber
Date: Thu Oct 18 16:16:39 2007
New Revision: 18931

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18931&repname=
=3Djahia
Log:
Fix ConcurrentModificationException when displaying cache status.

Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ref=
erence/ReferenceCacheImpl.java

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cac=
he/reference/ReferenceCacheImpl.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/cache/reference/ReferenceCacheImpl=
.java&rev=3D18931&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ref=
erence/ReferenceCacheImpl.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ref=
erence/ReferenceCacheImpl.java Thu Oct 18 16:16:39 2007
@@ -1,11 +1,6 @@
 package org.jahia.services.cache.reference;
 =

-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 =

 import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.commons.collections.map.LRUMap;
@@ -179,11 +174,16 @@
 =

     public long getGroupsKeysTotal() {
         long totalSize =3D 0;
-        Iterator groupIterator =3D groups.entrySet().iterator();
-        while (groupIterator.hasNext()) {
-            Map.Entry curEntry =3D (Map.Entry) groupIterator.next();
-            Set keySet =3D (Set) curEntry.getValue();
-            totalSize +=3D keySet.size();
+        try {
+            Iterator groupIterator =3D groups.entrySet().iterator();
+            while (groupIterator.hasNext()) {
+                Map.Entry curEntry =3D (Map.Entry) groupIterator.next();
+                Set keySet =3D (Set) curEntry.getValue();
+                totalSize +=3D keySet.size();
+            }
+        } catch (ConcurrentModificationException cme) {
+            logger.warn("Concurrent modification exception while calculati=
ng total groups keys for cache " + getName() + ", returning -1");
+            totalSize =3D -1;
         }
         return totalSize;
     }

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to