jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1000806 - /jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/MultiStatus.java
Date Fri, 24 Sep 2010 11:08:12 GMT
Author: jukka
Date: Fri Sep 24 11:08:12 2010
New Revision: 1000806

URL: http://svn.apache.org/viewvc?rev=1000806&view=rev
Log:
JCR-2755: ConcurrentModificationException in WebDAV UPDATE

Use synchronization to prevent the ConcurrentModificatinException

Modified:
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/MultiStatus.java

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/MultiStatus.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/MultiStatus.java?rev=1000806&r1=1000805&r2=1000806&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/MultiStatus.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/MultiStatus.java
Fri Sep 24 11:08:12 2010
@@ -34,7 +34,7 @@ public class MultiStatus implements DavC
 
     /**
      * Map collecting the responses for this multistatus, where every href must
-     * only occure one single time.
+     * only occur one single time.
      */
     private Map<String, MultiStatusResponse> responses = new LinkedHashMap<String,
MultiStatusResponse>();
 
@@ -105,20 +105,26 @@ public class MultiStatus implements DavC
 
     /**
      * Add a <code>MultiStatusResponse</code> element to this <code>MultiStatus</code>
+     * <p>
+     * This method is synchronized to avoid the problem described in
+     * <a href="https://issues.apache.org/jira/browse/JCR-2755">JCR-2755</a>.
      *
      * @param response
      */
-    public void addResponse(MultiStatusResponse response) {
+    public synchronized void addResponse(MultiStatusResponse response) {
         responses.put(response.getHref(), response);
     }
 
     /**
      * Returns the multistatus responses present as array.
+     * <p>
+     * This method is synchronized to avoid the problem described in
+     * <a href="https://issues.apache.org/jira/browse/JCR-2755">JCR-2755</a>.
      *
      * @return array of all {@link MultiStatusResponse responses} present in this
      * multistatus.
      */
-    public MultiStatusResponse[] getResponses() {
+    public synchronized MultiStatusResponse[] getResponses() {
         return responses.values().toArray(new MultiStatusResponse[responses.size()]);
     }
 



Mime
View raw message