jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1333470 - in /jackrabbit/oak/trunk: oak-it/jcr/pom.xml oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
Date Thu, 03 May 2012 14:19:09 GMT
Author: reschke
Date: Thu May  3 14:19:08 2012
New Revision: 1333470

URL: http://svn.apache.org/viewvc?rev=1333470&view=rev
Log:
OAK-6: avoid NPE in NodeDelegate, update test exclusions

Modified:
    jackrabbit/oak/trunk/oak-it/jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java

Modified: jackrabbit/oak/trunk/oak-it/jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/jcr/pom.xml?rev=1333470&r1=1333469&r2=1333470&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-it/jcr/pom.xml Thu May  3 14:19:08 2012
@@ -92,7 +92,8 @@ org.apache.jackrabbit.test.api.CheckPerm
 org.apache.jackrabbit.test.api.DocumentViewImportTest
 org.apache.jackrabbit.test.api.SerializationTest
 org.apache.jackrabbit.test.api.GetWeakReferencesTest
-org.apache.jackrabbit.test.api.SessionRemoveItemTest
+org.apache.jackrabbit.test.api.SessionRemoveItemTest#testRemoveItem3
+org.apache.jackrabbit.test.api.SessionRemoveItemTest#testRemoveItem4
 org.apache.jackrabbit.test.api.HasPermissionTest
 org.apache.jackrabbit.test.api.WorkspaceTest
 org.apache.jackrabbit.test.api.ShareableNodeTest

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java?rev=1333470&r1=1333469&r2=1333470&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
Thu May  3 14:19:08 2012
@@ -24,6 +24,7 @@ import org.apache.jackrabbit.oak.commons
 import org.apache.jackrabbit.oak.util.Function1;
 import org.apache.jackrabbit.oak.util.Iterators;
 
+import javax.jcr.InvalidItemStateException;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
@@ -92,7 +93,7 @@ public class NodeDelegate extends ItemDe
     }
 
     NodeDelegate getParent() throws RepositoryException {
-        if (getTree().getParent() == null) {
+        if (check(getTree()).getParent() == null) {
             throw new ItemNotFoundException("Root has no parent");
         }
 
@@ -161,6 +162,13 @@ public class NodeDelegate extends ItemDe
         return tree;
     }
 
+    private Tree check(Tree t) throws InvalidItemStateException {
+        if (t == null) {
+            throw new InvalidItemStateException();
+        }
+        return t;
+    }
+    
     private synchronized Tree getTree() {
         return tree = sessionContext.getTree(tree.getPath());
     }



Mime
View raw message