jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1198827 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
Date Mon, 07 Nov 2011 17:31:07 GMT
Author: reschke
Date: Mon Nov  7 17:31:06 2011
New Revision: 1198827

URL: http://svn.apache.org/viewvc?rev=1198827&view=rev
Log:
JCR-3139: missing sync in InternalVersionManagerImpl.externalUpdate can cause ConcurrentModificationException

added synchronization

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java?rev=1198827&r1=1198826&r2=1198827&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
Mon Nov  7 17:31:06 2011
@@ -645,9 +645,12 @@ public class InternalVersionManagerImpl 
 
         Collection<InternalVersionItem> items =
             new ArrayList<InternalVersionItem>();
-        for (Map.Entry<ItemId, InternalVersionItem> entry : versionItems.entrySet())
{
-            if (changes.has(entry.getKey())) {
-                items.add(entry.getValue());
+        synchronized (versionItems) {
+            for (Map.Entry<ItemId, InternalVersionItem> entry : versionItems
+                    .entrySet()) {
+                if (changes.has(entry.getKey())) {
+                    items.add(entry.getValue());
+                }
             }
         }
         itemsUpdated(items);



Mime
View raw message