jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1409885 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Date Thu, 15 Nov 2012 17:07:41 GMT
Author: jukka
Date: Thu Nov 15 17:07:40 2012
New Revision: 1409885

URL: http://svn.apache.org/viewvc?rev=1409885&view=rev
Log:
OAK-447: Adding a node with the name of a removed node can lead to an inconsistent hierarchy
of node builders

If a node was previously removed, then writeState.base is null and no child accesses should
be treated as read-only operations.

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.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=1409885&r1=1409884&r2=1409885&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
Thu Nov 15 17:07:40 2012
@@ -422,7 +422,9 @@ public class MemoryNodeBuilder implement
         read(); // shortcut when dealing with a read-only child node
         if (baseState != null
                 && baseState.hasChildNode(name)
-                && (writeState == null || !writeState.nodes.containsKey(name))) {
+                && (writeState == null
+                    || (writeState.base == baseState
+                        && !writeState.nodes.containsKey(name)))) {
             return createChildBuilder(name);
         }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java?rev=1409885&r1=1409884&r2=1409885&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
Thu Nov 15 17:07:40 2012
@@ -120,7 +120,6 @@ public class MemoryNodeBuilderTest {
     }
 
     @Test
-    @Ignore("OAK-447")  // FIXME OAK-447
     public void testAddRemovedNodeAgain() {
         NodeBuilder root = new MemoryNodeBuilder(BASE);
 



Mime
View raw message