jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1406185 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Date Tue, 06 Nov 2012 15:37:22 GMT
Author: mduerig
Date: Tue Nov  6 15:37:22 2012
New Revision: 1406185

URL: http://svn.apache.org/viewvc?rev=1406185&view=rev
Log:
OAK-421: NodeBuilder.reset might lead to inconsistent builder

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java?rev=1406185&r1=1406184&r2=1406185&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Tue Nov  6 15:37:22 2012
@@ -209,6 +209,9 @@ public class MemoryNodeBuilder implement
                     parent.writeState.nodes.put(name, writeState);
                 }
             }
+        } else if (parent != null) {
+            // make sure that all revision numbers up to the root gets updated
+            parent.write(newRevision);
         }
         revision = newRevision;
         return writeState;
@@ -266,7 +269,7 @@ public class MemoryNodeBuilder implement
         if (this == root) {
             baseState = checkNotNull(newBase);
             writeState = new MutableNodeState(baseState);
-            revision += 2;  // Make sure we are ahead of the revisions of all other builders
root at this builder
+            revision++;
         } else {
             throw new IllegalStateException("Cannot reset a non-root builder");
         }



Mime
View raw message