jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1407423 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Date Fri, 09 Nov 2012 11:24:29 GMT
Author: mduerig
Date: Fri Nov  9 11:24:28 2012
New Revision: 1407423

URL: http://svn.apache.org/viewvc?rev=1407423&view=rev
Log:
OAK-417: Refactor/reimplement TreeImpl.getStatus and TreeImpl.getPropertyStatus to take advantage
of the underlying NodeBuilder
null checks

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=1407423&r1=1407422&r2=1407423&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
Fri Nov  9 11:24:28 2012
@@ -272,11 +272,12 @@ public class MemoryNodeBuilder implement
             return false;
         }
         else {
+            NodeState baseState = getBaseState();
             for (Entry<String, MutableNodeState> n : writeState.nodes.entrySet()) {
                 if (n.getValue() == null) {
                     return true;
                 }
-                if (!getBaseState().hasChildNode(n.getKey())) {
+                if (baseState != null && !baseState.hasChildNode(n.getKey())) {
                     return true;
                 }
             }
@@ -285,7 +286,7 @@ public class MemoryNodeBuilder implement
                 if (pState == null) {
                     return true;
                 }
-                if (!pState.equals(getBaseState().getProperty(p.getKey()))) {
+                if (baseState != null && !pState.equals(baseState.getProperty(p.getKey())))
{
                     return true;
                 }
             }



Mime
View raw message