jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1430761 - in /jackrabbit/oak/trunk/oak-mk/src: main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
Date Wed, 09 Jan 2013 10:06:24 GMT
Author: stefan
Date: Wed Jan  9 10:06:24 2013
New Revision: 1430761

URL: http://svn.apache.org/viewvc?rev=1430761&view=rev
Log:
OAK-543: PutTokenImpl not thread safe

committed patch

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java?rev=1430761&r1=1430760&r2=1430761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
Wed Jan  9 10:06:24 2013
@@ -223,12 +223,12 @@ public class DefaultRevisionStore extend
      */
     static class PutTokenImpl extends PutToken {
 
-        private static int idCounter;
+        private static final AtomicInteger ID_COUNTER = new AtomicInteger();
         private int id;
         private StoredNode lastModifiedNode;
 
         public PutTokenImpl() {
-            this.id = ++idCounter;
+            this.id = ID_COUNTER.incrementAndGet();
         }
 
         @Override

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java?rev=1430761&r1=1430760&r2=1430761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
Wed Jan  9 10:06:24 2013
@@ -200,7 +200,6 @@ public class DefaultRevisionStoreTest {
     }
 
     @Test
-    @Ignore
     public void putTokenImpl() throws InterruptedException, ExecutionException {
         final Set<PutToken> tokens = Collections.synchronizedSet(new HashSet<PutToken>());
         Set<Future<?>> results = new HashSet<Future<?>>();



Mime
View raw message