jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1487502 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Date Wed, 29 May 2013 14:37:00 GMT
Author: mduerig
Date: Wed May 29 14:37:00 2013
New Revision: 1487502

URL: http://svn.apache.org/r1487502
Log:
OAK-781: Clarify / fix effects of MISSING_NODE as base state of NodeBuilder
Transition back to unconnected on reset and connect again if necessary

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=1487502&r1=1487501&r2=1487502&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
Wed May 29 14:37:00 2013
@@ -473,7 +473,7 @@ public class MemoryNodeBuilder implement
     }
 
     private class ConnectedHead extends Head {
-        protected long revision;
+        protected long revision = rootBuilder.baseRevision;
         protected MutableNodeState state;
 
         public ConnectedHead(MutableNodeState state) {
@@ -483,11 +483,9 @@ public class MemoryNodeBuilder implement
         @Override
         public Head update() {
             if (revision != rootBuilder.baseRevision) {
-                // the root builder's base state has been reset: re-get
-                // state from parent.
-                MutableNodeState parentState = (MutableNodeState) parent.head().getCurrentNodeState();
-                state = parentState.getMutableChildNode(name);
-                revision = rootBuilder.baseRevision;
+                // the root builder's base state has been reset: transition back
+                // to unconnected and connect again if necessary.
+                return new UnconnectedHead().update();
             }
             return this;
         }



Mime
View raw message