jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1309305 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
Date Wed, 04 Apr 2012 09:46:08 GMT
Author: mduerig
Date: Wed Apr  4 09:46:08 2012
New Revision: 1309305

URL: http://svn.apache.org/viewvc?rev=1309305&view=rev
Log:
OAK-9: Internal tree builder
add missing check for null

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java?rev=1309305&r1=1309304&r2=1309305&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
Wed Apr  4 09:46:08 2012
@@ -74,7 +74,7 @@ public class TransientNodeState {
             return state;
         }
 
-        return removedProperties.contains(name)
+        return removedProperties.contains(name) || persistentState == null
             ? null
             : persistentState.getProperty(name);
     }
@@ -102,7 +102,7 @@ public class TransientNodeState {
         added.putAll(addedProperties);
 
         final Iterable<? extends PropertyState>
-                persistedProperties = persistentState.getProperties();
+                persistedProperties = persistentState.getProperties(); // fixme check for
null
 
         return new Iterable<PropertyState>() {
             @Override
@@ -157,7 +157,7 @@ public class TransientNodeState {
         added.putAll(addedNodes);
 
         final Iterable<? extends ChildNodeEntry>
-                persistedNodes = persistentState.getChildNodeEntries(offset, count);
+                persistedNodes = persistentState.getChildNodeEntries(offset, count); // fixme
check for null
 
         return new Iterable<TransientNodeState>() {
             @Override
@@ -255,8 +255,11 @@ public class TransientNodeState {
     }
 
     private TransientNodeState getExistingChildNode(String name) {
-        NodeState state = persistentState.getChildNode(name);
+        if (persistentState == null) {
+            return null;
+        }
 
+        NodeState state = persistentState.getChildNode(name);
         TransientNodeState transientState = existingChildNodes.get(state);
         if (transientState == null) {
             transientState = new TransientNodeState(editor, name, state);



Mime
View raw message