jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1471494 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MutableNodeState.java
Date Wed, 24 Apr 2013 15:53:14 GMT
Author: mduerig
Date: Wed Apr 24 15:53:13 2013
New Revision: 1471494

URL: http://svn.apache.org/r1471494
Log:
OAK-781: Clarify / fix effects of MISSING_NODE as base state of NodeBuilder
Better implementation for MutableNodeState#setChildNode

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MutableNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MutableNodeState.java?rev=1471494&r1=1471493&r2=1471494&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MutableNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MutableNodeState.java
Wed Apr 24 15:53:13 2013
@@ -251,9 +251,14 @@ class MutableNodeState extends AbstractN
      */
     @Nonnull
     MutableNodeState setChildNode(String name, NodeState state) {
-        // FIXME better implementation, which doesn't set the base state twice
-        MutableNodeState child = getChildNode(name, true);
-        child.reset(state);
+        assert base != null;
+        MutableNodeState child = nodes.get(name);
+        if (child == null) {
+            child = new MutableNodeState(state);
+            nodes.put(name, child);
+        } else {
+            child.reset(state);
+        }
         return child;
     }
 



Mime
View raw message