jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1477009 [3/3] - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/ oak-core/src/main/java/or...
Date Mon, 29 Apr 2013 12:42:01 GMT
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/EffectivePolicyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/EffectivePolicyTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/EffectivePolicyTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/EffectivePolicyTest.java Mon Apr 29 12:41:59 2013
@@ -63,7 +63,7 @@ public class EffectivePolicyTest extends
         super.before();
 
         // create some nodes below the test root in order to apply ac-stuff
-        NodeUtil rootNode = new NodeUtil(root.getTree("/"));
+        NodeUtil rootNode = new NodeUtil(root.getTreeOrNull("/"));
         NodeUtil testRootNode = rootNode.getOrAddChild("testRoot", JcrConstants.NT_UNSTRUCTURED);
         NodeUtil testNode = testRootNode.addChild("testNode", JcrConstants.NT_UNSTRUCTURED);
         NodeUtil cn1 = testNode.addChild("child1", JcrConstants.NT_UNSTRUCTURED);
@@ -93,7 +93,7 @@ public class EffectivePolicyTest extends
                 testSession.close();
             }
 
-            root.getTree(path).remove();
+            root.getTreeOrNull(path).remove();
             root.commit();
         } finally {
             super.after();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/AbstractOakCoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/AbstractOakCoreTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/AbstractOakCoreTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/AbstractOakCoreTest.java Mon Apr 29 12:41:59 2013
@@ -50,7 +50,7 @@ public abstract class AbstractOakCoreTes
 
         testPrincipal = getTestUser().getPrincipal();
 
-        NodeUtil rootNode = new NodeUtil(root.getTree("/"));
+        NodeUtil rootNode = new NodeUtil(root.getTreeOrNull("/"));
         NodeUtil a = rootNode.addChild("a", NT_UNSTRUCTURED);
         a.setString("aProp", "aValue");
 
@@ -77,7 +77,7 @@ public abstract class AbstractOakCoreTes
             }
 
             // remove all test content
-            root.getTree("/a").remove();
+            root.getTreeOrNull("/a").remove();
             root.commit();
 
             // release test session

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java Mon Apr 29 12:41:59 2013
@@ -43,20 +43,20 @@ public class ChildOrderPropertyTest exte
     public void before() throws Exception {
         super.before();
 
-        Tree a = root.getTree("/a");
+        Tree a = root.getTreeOrNull("/a");
         a.setOrderableChildren(true);
         root.commit();
     }
 
     @Test
     public void testHasProperty() {
-        Tree a = root.getTree("/a");
+        Tree a = root.getTreeOrNull("/a");
         assertFalse(a.hasProperty(TreeImpl.OAK_CHILD_ORDER));
     }
 
     @Test
     public void testGetProperty() {
-        Tree a = root.getTree("/a");
+        Tree a = root.getTreeOrNull("/a");
         assertNull(a.getProperty(TreeImpl.OAK_CHILD_ORDER));
     }
 
@@ -64,7 +64,7 @@ public class ChildOrderPropertyTest exte
     public void testGetProperties() {
         Set<String> propertyNames = Sets.newHashSet(JcrConstants.JCR_PRIMARYTYPE, "aProp");
 
-        Tree a = root.getTree("/a");
+        Tree a = root.getTreeOrNull("/a");
         for (PropertyState prop : a.getProperties()) {
             assertTrue(propertyNames.remove(prop.getName()));
         }
@@ -73,13 +73,13 @@ public class ChildOrderPropertyTest exte
 
     @Test
     public void testGetPropertyCount() {
-        Tree a = root.getTree("/a");
+        Tree a = root.getTreeOrNull("/a");
         assertEquals(2, a.getPropertyCount());
     }
 
     @Test
     public void testGetPropertyStatus() {
-        Tree a = root.getTree("/a");
+        Tree a = root.getTreeOrNull("/a");
         assertNull(a.getPropertyStatus(TreeImpl.OAK_CHILD_ORDER));
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java Mon Apr 29 12:41:59 2013
@@ -43,7 +43,7 @@ public class HiddenTreeTest extends Abst
     public void before() throws Exception {
         super.before();
 
-        parent = root.getTree(hiddenParentPath);
+        parent = root.getTreeOrNull(hiddenParentPath);
         assertNotNull(parent);
     }
 
@@ -56,7 +56,7 @@ public class HiddenTreeTest extends Abst
     @Ignore("OAK-753") // FIXME
     @Test
     public void testGetHiddenTree() {
-        assertNull(parent.getChild(hiddenName));
+        assertNull(parent.getChildOrNull(hiddenName));
     }
 
     @Ignore("OAK-753") // FIXME

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/RootTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/RootTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/RootTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/RootTest.java Mon Apr 29 12:41:59 2013
@@ -46,10 +46,10 @@ public class RootTest extends AbstractOa
 
         List<String> accessible = ImmutableList.of("/", "/a", "/a/b", "/a/b/c");
         for (String path : accessible) {
-            assertNotNull(testRoot.getTree(path));
+            assertNotNull(testRoot.getTreeOrNull(path));
         }
 
-        assertNull(testRoot.getTree("/a/bb"));
+        assertNull(testRoot.getTreeOrNull("/a/bb"));
     }
 
     @Test
@@ -62,12 +62,12 @@ public class RootTest extends AbstractOa
 
         List<String> notAccessible = ImmutableList.of("/", "/a/b");
         for (String path : notAccessible) {
-            assertNull(path, testRoot.getTree(path));
+            assertNull(path, testRoot.getTreeOrNull(path));
         }
 
         List<String> accessible = ImmutableList.of("/a", "/a/bb", "/a/b/c");
         for (String path : accessible) {
-            assertNotNull(path, testRoot.getTree(path));
+            assertNotNull(path, testRoot.getTreeOrNull(path));
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ShadowInvisibleContentTest.java Mon Apr 29 12:41:59 2013
@@ -40,7 +40,7 @@ public class ShadowInvisibleContentTest 
         setupPermission("/a/b/c", testPrincipal, true, PrivilegeConstants.JCR_ALL);
 
         Root testRoot = getTestRoot();
-        Tree a = testRoot.getTree("/a");
+        Tree a = testRoot.getTreeOrNull("/a");
 
         // /b not visible to this session
         assertFalse(a.hasChild("b"));
@@ -65,7 +65,7 @@ public class ShadowInvisibleContentTest 
         setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES);
 
         Root testRoot = getTestRoot();
-        Tree a = testRoot.getTree("/a");
+        Tree a = testRoot.getTreeOrNull("/a");
 
         // /a/x not visible to this session
         assertNull(a.getProperty("x"));
@@ -89,7 +89,7 @@ public class ShadowInvisibleContentTest 
         setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES);
 
         Root testRoot = getTestRoot();
-        Tree a = testRoot.getTree("/a");
+        Tree a = testRoot.getTreeOrNull("/a");
 
         // /a/x not visible to this session
         assertNull(a.getProperty("x"));

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/TreeTest.java Mon Apr 29 12:41:59 2013
@@ -51,60 +51,60 @@ public class TreeTest extends AbstractOa
 
     @Test
     public void testHasChild() throws Exception {
-        Tree rootTree = testRoot.getTree("/");
+        Tree rootTree = testRoot.getTreeOrNull("/");
 
         assertTrue(rootTree.hasChild("a"));
         assertFalse(rootTree.hasChild(AccessControlConstants.REP_POLICY));
 
-        Tree a = rootTree.getChild("a");
+        Tree a = rootTree.getChildOrNull("a");
         assertTrue(a.hasChild("b"));
         assertFalse(a.hasChild("bb"));
 
-        Tree b = a.getChild("b");
+        Tree b = a.getChildOrNull("b");
         assertTrue(b.hasChild("c"));
     }
 
     @Test
     public void testGetChild() throws Exception {
-        Tree rootTree = testRoot.getTree("/");
+        Tree rootTree = testRoot.getTreeOrNull("/");
         assertNotNull(rootTree);
 
-        Tree a = rootTree.getChild("a");
+        Tree a = rootTree.getChildOrNull("a");
         assertNotNull(a);
 
-        Tree b = a.getChild("b");
+        Tree b = a.getChildOrNull("b");
         assertNotNull(b);
-        assertNotNull(b.getChild("c"));
+        assertNotNull(b.getChildOrNull("c"));
 
-        assertNull(a.getChild("bb"));
+        assertNull(a.getChildOrNull("bb"));
     }
 
     @Test
     public void testPolicyChild() throws Exception {
-        assertNotNull(root.getTree('/' + AccessControlConstants.REP_POLICY));
+        assertNotNull(root.getTreeOrNull('/' + AccessControlConstants.REP_POLICY));
 
         // 'testUser' must not have access to the policy node
-        Tree rootTree = testRoot.getTree("/");
+        Tree rootTree = testRoot.getTreeOrNull("/");
 
         assertFalse(rootTree.hasChild(AccessControlConstants.REP_POLICY));
-        assertNull(rootTree.getChild(AccessControlConstants.REP_POLICY));
+        assertNull(rootTree.getChildOrNull(AccessControlConstants.REP_POLICY));
     }
 
     @Test
 	public void testGetChildrenCount() throws Exception {
-        long cntRoot = root.getTree("/").getChildrenCount();
-        long cntA = root.getTree("/a").getChildrenCount();
+        long cntRoot = root.getTreeOrNull("/").getChildrenCount();
+        long cntA = root.getTreeOrNull("/a").getChildrenCount();
 
         // 'testUser' may only see 'regular' child nodes -> count must be adjusted.
-        assertEquals(cntRoot-1, testRoot.getTree("/").getChildrenCount());
-        assertEquals(cntA - 1, testRoot.getTree("/a").getChildrenCount());
+        assertEquals(cntRoot-1, testRoot.getTreeOrNull("/").getChildrenCount());
+        assertEquals(cntA - 1, testRoot.getTreeOrNull("/a").getChildrenCount());
 
         // for the following nodes the cnt must not differ
         List<String> paths = ImmutableList.of("/a/b", "/a/b/c");
         for (String path : paths) {
             assertEquals(
-                    root.getTree(path).getChildrenCount(),
-                    testRoot.getTree(path).getChildrenCount());
+                    root.getTreeOrNull(path).getChildrenCount(),
+                    testRoot.getTreeOrNull(path).getChildrenCount());
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/AllPermissionsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/AllPermissionsTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/AllPermissionsTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/AllPermissionsTest.java Mon Apr 29 12:41:59 2013
@@ -52,7 +52,7 @@ public class AllPermissionsTest extends 
     @Test
     public void testGetReadStatus() {
         for (String path : paths) {
-            Tree tree = root.getTree(path);
+            Tree tree = root.getTreeOrNull(path);
             assertNotNull(tree);
 
             assertSame(ReadStatus.ALLOW_ALL, all.getReadStatus(tree, null));
@@ -70,7 +70,7 @@ public class AllPermissionsTest extends 
         assertTrue(all.isGranted(Permissions.ALL));
 
         for (String path : paths) {
-            Tree tree = root.getTree(path);
+            Tree tree = root.getTreeOrNull(path);
             assertNotNull(tree);
 
             assertTrue(all.isGranted(tree, null, Permissions.ALL));

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImplTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImplTest.java Mon Apr 29 12:41:59 2013
@@ -92,7 +92,7 @@ public class CompiledPermissionImplTest 
         pbp = new PrivilegeBitsProvider(root);
         rp = new RestrictionProviderImpl(NamePathMapper.DEFAULT);
 
-        NodeUtil rootNode = new NodeUtil(root.getTree("/"));
+        NodeUtil rootNode = new NodeUtil(root.getTreeOrNull("/"));
         NodeUtil system = rootNode.getChild("jcr:system");
         NodeUtil perms = system.addChild(REP_PERMISSION_STORE, NT_REP_PERMISSION_STORE);
         perms.addChild(userPrincipal.getName(), NT_REP_PERMISSION_STORE);
@@ -112,7 +112,7 @@ public class CompiledPermissionImplTest 
 
     @Override
     public void after() throws Exception {
-        root.getTree(PERMISSIONS_STORE_PATH).remove();
+        root.getTreeOrNull(PERMISSIONS_STORE_PATH).remove();
         root.commit();
 
         super.after();
@@ -338,7 +338,7 @@ public class CompiledPermissionImplTest 
     // TODO: tests for path base evaluation
 
     private CompiledPermissionImpl createPermissions(Set<Principal> principals) {
-        ImmutableTree permissionsTree = new ImmutableRoot(root, TreeTypeProvider.EMPTY).getTree(PERMISSIONS_STORE_PATH);
+        ImmutableTree permissionsTree = new ImmutableRoot(root, TreeTypeProvider.EMPTY).getTreeOrNull(PERMISSIONS_STORE_PATH);
         return new CompiledPermissionImpl(principals, permissionsTree, pbp, rp);
     }
 
@@ -354,7 +354,7 @@ public class CompiledPermissionImplTest 
                                  int index, String[] privilegeName, Set<Restriction> restrictions) throws CommitFailedException {
         PrivilegeBits pb = pbp.getBits(privilegeName);
         String name = ((isAllow) ? PREFIX_ALLOW : PREFIX_DENY) + "-" + Objects.hashCode(path, principal, index, pb, isAllow, restrictions);
-        Tree principalRoot = root.getTree(PERMISSIONS_STORE_PATH + '/' + principal.getName());
+        Tree principalRoot = root.getTreeOrNull(PERMISSIONS_STORE_PATH + '/' + principal.getName());
         Tree entry = principalRoot.addChild(name);
         entry.setProperty(JCR_PRIMARYTYPE, NT_REP_PERMISSIONS);
         entry.setProperty(REP_ACCESS_CONTROLLED_PATH, path);
@@ -383,7 +383,7 @@ public class CompiledPermissionImplTest 
                                   CompiledPermissions cp,
                                   List<String> treePaths) {
         for (String path : treePaths) {
-            Tree node = root.getTree(path);
+            Tree node = root.getTreeOrNull(path);
             assertSame("Tree " + path, expectedTrees, cp.getReadStatus(node, null));
             assertSame("Property jcr:primaryType " + path, expectedProperties, cp.getReadStatus(node, node.getProperty(JCR_PRIMARYTYPE)));
         }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java Mon Apr 29 12:41:59 2013
@@ -64,7 +64,7 @@ public class PermissionHookTest extends 
         super.before();
 
         Principal testPrincipal = getTestPrincipal();
-        NodeUtil rootNode = new NodeUtil(root.getTree("/"), namePathMapper);
+        NodeUtil rootNode = new NodeUtil(root.getTreeOrNull("/"), namePathMapper);
         rootNode.addChild("testPath", JcrConstants.NT_UNSTRUCTURED);
 
         AccessControlManager acMgr = getAccessControlManager(root);
@@ -82,7 +82,7 @@ public class PermissionHookTest extends 
     public void after() throws Exception {
         try {
             root.refresh();
-            Tree test = root.getTree(testPath);
+            Tree test = root.getTreeOrNull(testPath);
             if (test != null) {
                 test.remove();
             }
@@ -97,7 +97,7 @@ public class PermissionHookTest extends 
     }
 
     private Tree getPrincipalRoot(String principalName) {
-        return root.getTree(PERMISSIONS_STORE_PATH).getChild(adminSession.getWorkspaceName()).getChild(principalName);
+        return root.getTreeOrNull(PERMISSIONS_STORE_PATH).getChildOrNull(adminSession.getWorkspaceName()).getChildOrNull(principalName);
     }
 
     private Tree getEntry(String principalName, String accessControlledPath) throws Exception {
@@ -123,7 +123,7 @@ public class PermissionHookTest extends 
     @Test
     public void testDuplicateAce() throws Exception {
         // add duplicate policy on OAK-API
-        NodeUtil policy = new NodeUtil(root.getTree(testPath + "/rep:policy"));
+        NodeUtil policy = new NodeUtil(root.getTreeOrNull(testPath + "/rep:policy"));
         NodeUtil ace = policy.addChild("duplicateAce", NT_REP_GRANT_ACE);
         ace.setString(REP_PRINCIPAL_NAME, testPrincipalName);
         ace.setStrings(REP_PRIVILEGES, PrivilegeConstants.JCR_ADD_CHILD_NODES);
@@ -141,7 +141,7 @@ public class PermissionHookTest extends 
         assertEquals(ImmutableSet.of(0, 2), index);
 
         // remove duplicate policy entry again
-        root.getTree(testPath + "/rep:policy/duplicateAce").remove();
+        root.getTreeOrNull(testPath + "/rep:policy/duplicateAce").remove();
         root.commit();
 
         assertEquals(1, getPrincipalRoot(testPrincipalName).getChildrenCount());
@@ -149,7 +149,7 @@ public class PermissionHookTest extends 
 
     @Test
     public void testModifyRestrictions() throws Exception {
-        Tree testAce = root.getTree(testPath + "/rep:policy").getChildren().iterator().next();
+        Tree testAce = root.getTreeOrNull(testPath + "/rep:policy").getChildren().iterator().next();
         assertEquals(testPrincipalName, testAce.getProperty(REP_PRINCIPAL_NAME).getValue(Type.STRING));
 
         // add a new restriction node through the OAK API instead of access control manager
@@ -164,7 +164,7 @@ public class PermissionHookTest extends 
         assertEquals("*", principalRoot.getChildren().iterator().next().getProperty(REP_GLOB).getValue(Type.STRING));
 
         // modify the restrictions node
-        Tree restrictionsNode = root.getTree(restritionsPath);
+        Tree restrictionsNode = root.getTreeOrNull(restritionsPath);
         restrictionsNode.setProperty(REP_GLOB, "/*/jcr:content/*");
         root.commit();
 
@@ -173,7 +173,7 @@ public class PermissionHookTest extends 
         assertEquals("/*/jcr:content/*", principalRoot.getChildren().iterator().next().getProperty(REP_GLOB).getValue(Type.STRING));
 
         // remove the restriction again
-        root.getTree(restritionsPath).remove();
+        root.getTreeOrNull(restritionsPath).remove();
         root.commit();
 
         principalRoot = getPrincipalRoot(testPrincipalName);
@@ -187,7 +187,7 @@ public class PermissionHookTest extends 
         Tree entry = getEntry(testPrincipalName, testPath);
         assertEquals(0, entry.getProperty(REP_INDEX).getValue(Type.LONG).longValue());
 
-        Tree aclTree = root.getTree(testPath + "/rep:policy");
+        Tree aclTree = root.getTreeOrNull(testPath + "/rep:policy");
         aclTree.getChildren().iterator().next().orderBefore(null);
 
         root.commit();
@@ -201,7 +201,7 @@ public class PermissionHookTest extends 
         Tree entry = getEntry(testPrincipalName, testPath);
         assertEquals(0, entry.getProperty(REP_INDEX).getValue(Type.LONG).longValue());
 
-        Tree aclTree = root.getTree(testPath + "/rep:policy");
+        Tree aclTree = root.getTreeOrNull(testPath + "/rep:policy");
         // reorder
         aclTree.getChildren().iterator().next().orderBefore(null);
 
@@ -220,7 +220,7 @@ public class PermissionHookTest extends 
         Tree entry = getEntry(testPrincipalName, testPath);
         assertEquals(0, entry.getProperty(REP_INDEX).getValue(Type.LONG).longValue());
 
-        Tree aclTree = root.getTree(testPath + "/rep:policy");
+        Tree aclTree = root.getTreeOrNull(testPath + "/rep:policy");
 
         // reorder testPrincipal entry to the end
         aclTree.getChildren().iterator().next().orderBefore(null);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java Mon Apr 29 12:41:59 2013
@@ -109,26 +109,26 @@ public class UserInitializerTest extends
     @Test
     public void testUserContent() throws Exception {
         Authorizable a = userMgr.getAuthorizable(UserUtility.getAdminId(config));
-        assertNotNull(root.getTree(a.getPath()));
+        assertNotNull(root.getTreeOrNull(a.getPath()));
 
         a = userMgr.getAuthorizable(UserUtility.getAnonymousId(config));
-        assertNotNull(root.getTree(a.getPath()));
+        assertNotNull(root.getTreeOrNull(a.getPath()));
     }
 
     @Test
     public void testUserIndexDefinitions() throws Exception {
-        Tree oakIndex = root.getTree('/' + IndexConstants.INDEX_DEFINITIONS_NAME);
+        Tree oakIndex = root.getTreeOrNull('/' + IndexConstants.INDEX_DEFINITIONS_NAME);
         assertNotNull(oakIndex);
 
-        Tree id = oakIndex.getChild("authorizableId");
+        Tree id = oakIndex.getChildOrNull("authorizableId");
         assertIndexDefinition(id, UserConstants.REP_AUTHORIZABLE_ID, true);
 
-        Tree princName = oakIndex.getChild("principalName");
+        Tree princName = oakIndex.getChildOrNull("principalName");
         assertIndexDefinition(princName, UserConstants.REP_PRINCIPAL_NAME, true);
         String[] declaringNtNames = TreeUtil.getStrings(princName, IndexConstants.DECLARING_NODE_TYPES);
         assertArrayEquals(new String[]{UserConstants.NT_REP_AUTHORIZABLE}, declaringNtNames);
 
-        Tree members = oakIndex.getChild("members");
+        Tree members = oakIndex.getChildOrNull("members");
         assertIndexDefinition(members, UserConstants.REP_MEMBERS, false);
     }
 
@@ -163,7 +163,7 @@ public class UserInitializerTest extends
             Authorizable adminUser = umgr.getAuthorizable("admin");
             assertNotNull(adminUser);
 
-            Tree adminTree = root.getTree(adminUser.getPath());
+            Tree adminTree = root.getTreeOrNull(adminUser.getPath());
             assertNotNull(adminTree);
             assertNull(adminTree.getProperty(UserConstants.REP_PASSWORD));
         } finally {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java Mon Apr 29 12:41:59 2013
@@ -83,7 +83,7 @@ public class UserManagerImplTest extends
         pwds.add("");
         pwds.add("{sha1}pw");
 
-        Tree userTree = root.getTree(user.getPath());
+        Tree userTree = root.getTreeOrNull(user.getPath());
         for (String pw : pwds) {
             userMgr.setPassword(userTree, pw, true);
             String pwHash = userTree.getProperty(UserConstants.REP_PASSWORD).getValue(Type.STRING);
@@ -109,7 +109,7 @@ public class UserManagerImplTest extends
         User user = userMgr.createUser(testUserId, null);
         root.commit();
 
-        Tree userTree = root.getTree(user.getPath());
+        Tree userTree = root.getTreeOrNull(user.getPath());
         try {
             userMgr.setPassword(userTree, null, true);
             fail("setting null password should fail");
@@ -130,7 +130,7 @@ public class UserManagerImplTest extends
         User user = userMgr.createUser(testUserId, null);
         root.commit();
 
-        Tree userTree = root.getTree(user.getPath());
+        Tree userTree = root.getTreeOrNull(user.getPath());
         assertNull(userTree.getProperty(UserConstants.REP_PASSWORD));
     }
 
@@ -154,7 +154,7 @@ public class UserManagerImplTest extends
         User user = userMgr.createUser(testUserId, null);
         root.commit();
 
-        NodeUtil userNode = new NodeUtil(root.getTree(user.getPath()));
+        NodeUtil userNode = new NodeUtil(root.getTreeOrNull(user.getPath()));
 
         NodeUtil folder = userNode.addChild("folder", UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
         String path = folder.getTree().getPath();
@@ -217,7 +217,7 @@ public class UserManagerImplTest extends
             }
         } finally {
             root.refresh();
-            Tree t = root.getTree(path);
+            Tree t = root.getTreeOrNull(path);
             if (t != null) {
                 t.remove();
                 root.commit();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java Mon Apr 29 12:41:59 2013
@@ -285,7 +285,7 @@ public class UserProviderTest {
         Tree u1 = up.createUser("b", "b");
         Tree u2 = up.createUser("bb", "bb");
 
-        Tree folder = root.getTree(Text.getRelativeParent(u1.getPath(), 2));
+        Tree folder = root.getTreeOrNull(Text.getRelativeParent(u1.getPath(), 2));
         folder.remove();
         if (up.getAuthorizable("b") != null) {
             fail("Removing the top authorizable folder must remove all users contained.");

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java Mon Apr 29 12:41:59 2013
@@ -53,7 +53,7 @@ public class UserValidatorTest extends A
     @Test
     public void removePassword() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.removeProperty(UserConstants.REP_PASSWORD);
             root.commit();
             fail("removing password should fail");
@@ -67,7 +67,7 @@ public class UserValidatorTest extends A
     @Test
     public void removePrincipalName() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.removeProperty(UserConstants.REP_PRINCIPAL_NAME);
             root.commit();
             fail("removing principal name should fail");
@@ -81,7 +81,7 @@ public class UserValidatorTest extends A
     @Test
     public void removeAuthorizableId() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.removeProperty(UserConstants.REP_AUTHORIZABLE_ID);
             root.commit();
             fail("removing authorizable id should fail");
@@ -96,7 +96,7 @@ public class UserValidatorTest extends A
     public void createWithoutPrincipalName() throws Exception {
         try {
             User user = getUserManager().createUser("withoutPrincipalName", "pw");
-            Tree tree = root.getTree(userPath);
+            Tree tree = root.getTreeOrNull(userPath);
             tree.removeProperty(UserConstants.REP_PRINCIPAL_NAME);
             root.commit();
 
@@ -112,7 +112,7 @@ public class UserValidatorTest extends A
     public void createWithInvalidUUID() throws Exception {
         try {
             User user = getUserManager().createUser("withInvalidUUID", "pw");
-            Tree tree = root.getTree(userPath);
+            Tree tree = root.getTreeOrNull(userPath);
             tree.setProperty(JcrConstants.JCR_UUID, UUID.randomUUID().toString());
             root.commit();
 
@@ -127,7 +127,7 @@ public class UserValidatorTest extends A
     @Test
     public void changeUUID() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.setProperty(JcrConstants.JCR_UUID, UUID.randomUUID().toString());
             root.commit();
             fail("changing jcr:uuid should fail if it the uuid valid is invalid");
@@ -141,7 +141,7 @@ public class UserValidatorTest extends A
     @Test
     public void changePrincipalName() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.setProperty(UserConstants.REP_PRINCIPAL_NAME, "another");
             root.commit();
             fail("changing the principal name should fail");
@@ -155,7 +155,7 @@ public class UserValidatorTest extends A
     @Test
     public void changeAuthorizableId() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.setProperty(UserConstants.REP_AUTHORIZABLE_ID, "modified");
             root.commit();
             fail("changing the authorizable id should fail");
@@ -169,7 +169,7 @@ public class UserValidatorTest extends A
     @Test
     public void changePasswordToPlainText() throws Exception {
         try {
-            Tree userTree = root.getTree(userPath);
+            Tree userTree = root.getTreeOrNull(userPath);
             userTree.setProperty(UserConstants.REP_PASSWORD, "plaintext");
             root.commit();
             fail("storing a plaintext password should fail");
@@ -191,7 +191,7 @@ public class UserValidatorTest extends A
                 root.commit();
             }
 
-            root.getTree(admin.getPath()).remove();
+            root.getTreeOrNull(admin.getPath()).remove();
             root.commit();
             fail("Admin user cannot be removed");
         } catch (CommitFailedException e) {
@@ -212,7 +212,7 @@ public class UserValidatorTest extends A
                 root.commit();
             }
 
-            root.getTree(admin.getPath()).setProperty(UserConstants.REP_DISABLED, "disabled");
+            root.getTreeOrNull(admin.getPath()).setProperty(UserConstants.REP_DISABLED, "disabled");
             root.commit();
             fail("Admin user cannot be disabled");
         } catch (CommitFailedException e) {
@@ -236,12 +236,12 @@ public class UserValidatorTest extends A
 
         for (String path : invalid) {
             try {
-                Tree parent = root.getTree(path);
+                Tree parent = root.getTreeOrNull(path);
                 if (parent == null) {
                     String[] segments = Text.explode(path, '/', false);
-                    parent = root.getTree("/");
+                    parent = root.getTreeOrNull("/");
                     for (String segment : segments) {
-                        Tree next = parent.getChild(segment);
+                        Tree next = parent.getChildOrNull(segment);
                         if (next == null) {
                             next = parent.addChild(segment);
                             next.setProperty(JcrConstants.JCR_PRIMARYTYPE, UserConstants.NT_REP_AUTHORIZABLE_FOLDER, Type.NAME);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlTest.java Mon Apr 29 12:41:59 2013
@@ -38,7 +38,7 @@ public abstract class AbstractAccessCont
 
             @Override
             protected Tree getReadTree() {
-                return root.getTree("/");
+                return root.getTreeOrNull("/");
             }
         };
         nsRegistry.registerNamespace(prefix, uri);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java Mon Apr 29 12:41:59 2013
@@ -46,7 +46,7 @@ public class RestrictionDefinitionImplTe
         super.before();
 
         registerNamespace(TestNameMapper.TEST_PREFIX, TestNameMapper.TEST_URI);
-        NamePathMapper npMapper = new NamePathMapperImpl(new TestNameMapper(Namespaces.getNamespaceMap(root.getTree("/")), TestNameMapper.LOCAL_MAPPING));
+        NamePathMapper npMapper = new NamePathMapperImpl(new TestNameMapper(Namespaces.getNamespaceMap(root.getTreeOrNull("/")), TestNameMapper.LOCAL_MAPPING));
 
         name = TestNameMapper.TEST_PREFIX + ":defName";
         definition = new RestrictionDefinitionImpl(name, PropertyType.NAME, true, npMapper);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java Mon Apr 29 12:41:59 2013
@@ -52,7 +52,7 @@ public class RestrictionImplTest extends
         super.before();
 
         registerNamespace(TestNameMapper.TEST_PREFIX, TestNameMapper.TEST_URI);
-        NamePathMapper npMapper = new NamePathMapperImpl(new TestNameMapper(Namespaces.getNamespaceMap(root.getTree("/")), TestNameMapper.LOCAL_MAPPING));
+        NamePathMapper npMapper = new NamePathMapperImpl(new TestNameMapper(Namespaces.getNamespaceMap(root.getTreeOrNull("/")), TestNameMapper.LOCAL_MAPPING));
 
         name = TestNameMapper.TEST_PREFIX + ":defName";
         PropertyState property = createProperty(name);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java Mon Apr 29 12:41:59 2013
@@ -130,7 +130,7 @@ public class PasswordValidationActionTes
         testUser = getUserManager().createUser("testuser", hashed);
         root.commit();
 
-        String pwValue = root.getTree(testUser.getPath()).getProperty(UserConstants.REP_PASSWORD).getValue(Type.STRING);
+        String pwValue = root.getTreeOrNull(testUser.getPath()).getProperty(UserConstants.REP_PASSWORD).getValue(Type.STRING);
         assertFalse(PasswordUtility.isPlainTextPassword(pwValue));
         assertTrue(PasswordUtility.isSame(pwValue, hashed));
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/JsopUtilTest.java Mon Apr 29 12:41:59 2013
@@ -33,24 +33,24 @@ public class JsopUtilTest extends OakBas
     public void test() throws Exception {
         Root root = createContentSession().getLatestRoot();
 
-        Tree t = root.getTree("/");
+        Tree t = root.getTreeOrNull("/");
         assertFalse(t.hasChild("test"));
 
         String add = "/ + \"test\": { \"a\": { \"id\": \"123\" }, \"b\": {} }";
         JsopUtil.apply(root, add);
         root.commit();
 
-        t = root.getTree("/");
+        t = root.getTreeOrNull("/");
         assertTrue(t.hasChild("test"));
 
-        t = t.getChild("test");
+        t = t.getChildOrNull("test");
         assertEquals(2, t.getChildrenCount());
         assertTrue(t.hasChild("a"));
         assertTrue(t.hasChild("b"));
 
-        assertEquals(0, t.getChild("b").getChildrenCount());
+        assertEquals(0, t.getChildOrNull("b").getChildrenCount());
 
-        t = t.getChild("a");
+        t = t.getChildOrNull("a");
         assertEquals(0, t.getChildrenCount());
         assertTrue(t.hasProperty("id"));
         assertEquals("123", t.getProperty("id").getValue(STRING));
@@ -59,7 +59,7 @@ public class JsopUtilTest extends OakBas
         JsopUtil.apply(root, rm);
         root.commit();
 
-        t = root.getTree("/");
+        t = root.getTreeOrNull("/");
         assertFalse(t.hasChild("test"));
     }
 

Modified: jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java (original)
+++ jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java Mon Apr 29 12:41:59 2013
@@ -77,7 +77,7 @@ public class OakServlet extends HttpServ
                 // direction as some parent nodes may be read-protected.
                 String head = request.getPathInfo();
                 String tail = "";
-                Tree tree = root.getTree(head);
+                Tree tree = root.getTreeOrNull(head);
                 while (tree == null) {
                     if (head.equals("/")) {
                         response.sendError(HttpServletResponse.SC_NOT_FOUND);
@@ -89,7 +89,7 @@ public class OakServlet extends HttpServ
                     if (head.isEmpty()){
                     	head="/";
                     }
-                    tree = root.getTree(head);
+                    tree = root.getTreeOrNull(head);
                 }
                 request.setAttribute("tree", tree);
                 request.setAttribute("path", tail);
@@ -160,13 +160,13 @@ public class OakServlet extends HttpServ
                 if (tree.hasProperty(name)) {
                     tree.removeProperty(name);
                 }
-                Tree child = tree.getChild(name);
+                Tree child = tree.getChildOrNull(name);
                 if (child == null) {
                     child = tree.addChild(name);
                 }
                 post(value, child);
             } else {
-                Tree child = tree.getChild(name);
+                Tree child = tree.getChildOrNull(name);
                 if (child != null) {
                     child.remove();
                 }
@@ -194,9 +194,9 @@ public class OakServlet extends HttpServ
         try {
             Root root = (Root) request.getAttribute("root");
             Tree tree = (Tree) request.getAttribute("tree");
-            Tree parent = tree.getParent();
+            Tree parent = tree.getParentOrNull();
             if (parent != null) {
-                Tree child = parent.getChild(tree.getName());
+                Tree child = parent.getChildOrNull(tree.getName());
                 if (child != null) {
                     child.remove();
                 }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java Mon Apr 29 12:41:59 2013
@@ -1123,7 +1123,7 @@ public class NodeImpl<T extends NodeDele
         String lockIsDeep = getOakPathOrThrow(JCR_LOCK_IS_DEEP);
         try {
             Root root = session.getLatestRoot();
-            Tree tree = root.getTree(dlg.getPath());
+            Tree tree = root.getTreeOrNull(dlg.getPath());
             if (tree == null) {
                 throw new ItemNotFoundException();
             }
@@ -1196,7 +1196,7 @@ public class NodeImpl<T extends NodeDele
         String lockIsDeep = getOakPathOrThrow(JCR_LOCK_IS_DEEP);
         try {
             Root root = sessionDelegate.getContentSession().getLatestRoot();
-            Tree tree = root.getTree(dlg.getPath());
+            Tree tree = root.getTreeOrNull(dlg.getPath());
             if (tree == null) {
                 throw new ItemNotFoundException();
             }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java Mon Apr 29 12:41:59 2013
@@ -85,7 +85,7 @@ public abstract class SessionContext imp
         LocalNameMapper nameMapper = new LocalNameMapper() {
             @Override
             protected Map<String, String> getNamespaceMap() {
-                return Namespaces.getNamespaceMap(delegate.getRoot().getTree("/"));
+                return Namespaces.getNamespaceMap(delegate.getRoot().getTreeOrNull("/"));
             }
 
             @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java Mon Apr 29 12:41:59 2013
@@ -76,7 +76,7 @@ public class WorkspaceImpl implements Ja
 
             @Override
             protected Tree getTypes() {
-                return sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+                return sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
             }
 
             @Nonnull
@@ -188,7 +188,7 @@ public class WorkspaceImpl implements Ja
         return new ReadWriteNamespaceRegistry() {
             @Override
             protected Tree getReadTree() {
-                return sessionDelegate.getRoot().getTree("/");
+                return sessionDelegate.getRoot().getTreeOrNull("/");
             }
 
             @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java Mon Apr 29 12:41:59 2013
@@ -122,10 +122,10 @@ public class NodeDelegate extends ItemDe
     public boolean isProtected() throws InvalidItemStateException {
         Tree tree = getTree();
 
-        Tree parent = tree.getParent();
+        Tree parent = tree.getParentOrNull();
         if (parent != null) {
             String name = tree.getName();
-            Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+            Tree typeRoot = sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
             List<Tree> types = getEffectiveType(parent, typeRoot);
 
             boolean protectedResidual = false;
@@ -149,10 +149,10 @@ public class NodeDelegate extends ItemDe
                 }
 
                 for (Tree type : types) {
-                    Tree definitions = type.getChild(OAK_RESIDUAL_CHILD_NODE_DEFINITIONS);
+                    Tree definitions = type.getChildOrNull(OAK_RESIDUAL_CHILD_NODE_DEFINITIONS);
                     if (definitions != null) {
                         for (String typeName : typeNames) {
-                            Tree definition = definitions.getChild(typeName);
+                            Tree definition = definitions.getChildOrNull(typeName);
                             if (definition != null
                                     && getBoolean(definition, JCR_PROTECTED)) {
                                 return true;
@@ -168,7 +168,7 @@ public class NodeDelegate extends ItemDe
 
     boolean isProtected(String property) throws InvalidItemStateException {
         Tree tree = getTree();
-        Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+        Tree typeRoot = sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
         List<Tree> types = getEffectiveType(tree, typeRoot);
 
         boolean protectedResidual = false;
@@ -186,7 +186,7 @@ public class NodeDelegate extends ItemDe
         // there's a matching, protected one.
         if (protectedResidual) {
             for (Tree type : types) {
-                Tree definitions = type.getChild(OAK_RESIDUAL_PROPERTY_DEFINITIONS);
+                Tree definitions = type.getChildOrNull(OAK_RESIDUAL_PROPERTY_DEFINITIONS);
                 if (definitions != null) {
                     for (Tree definition : definitions.getChildren()) {
                         // TODO: check for matching property type?
@@ -312,18 +312,18 @@ public class NodeDelegate extends ItemDe
     public void orderBefore(String source, String target)
             throws ItemNotFoundException, InvalidItemStateException {
         Tree tree = getTree();
-        if (tree.getChild(source) == null) {
+        if (tree.getChildOrNull(source) == null) {
             throw new ItemNotFoundException("Not a child: " + source);
-        } else if (target != null && tree.getChild(target) == null) {
+        } else if (target != null && tree.getChildOrNull(target) == null) {
             throw new ItemNotFoundException("Not a child: " + target);
         } else {
-            tree.getChild(source).orderBefore(target);
+            tree.getChildOrNull(source).orderBefore(target);
         }
     }
 
     public boolean canAddMixin(String typeName) throws RepositoryException {
-        Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
-        Tree type = typeRoot.getChild(typeName);
+        Tree typeRoot = sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
+        Tree type = typeRoot.getChildOrNull(typeName);
         if (type != null) {
             return !getBoolean(type, JCR_IS_ABSTRACT)
                     && getBoolean(type, JCR_ISMIXIN);
@@ -334,9 +334,9 @@ public class NodeDelegate extends ItemDe
     }
 
     public void addMixin(String typeName) throws RepositoryException {
-        Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+        Tree typeRoot = sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
 
-        Tree type = typeRoot.getChild(typeName);
+        Tree type = typeRoot.getChildOrNull(typeName);
         if (type == null) {
             throw new NoSuchNodeTypeException(
                     "Node type " + typeName + " does not exist");
@@ -407,7 +407,7 @@ public class NodeDelegate extends ItemDe
             return null;
         }
 
-        Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+        Tree typeRoot = sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
         if (typeName == null) {
             typeName = getDefaultChildType(typeRoot, tree, name);
             if (typeName == null) {
@@ -444,7 +444,7 @@ public class NodeDelegate extends ItemDe
     private Tree internalAddChild(
             Tree parent, String name, String typeName, Tree typeRoot)
             throws RepositoryException {
-        Tree type = typeRoot.getChild(typeName);
+        Tree type = typeRoot.getChildOrNull(typeName);
         if (type == null) {
             throw new NoSuchNodeTypeException(
                     "Node type " + typeName + " does not exist");
@@ -468,7 +468,7 @@ public class NodeDelegate extends ItemDe
     private void autoCreateItems(Tree tree, Tree type, Tree typeRoot)
             throws RepositoryException {
         // TODO: use a separate oak:autoCreatePropertyDefinitions
-        Tree properties = type.getChild(OAK_NAMED_PROPERTY_DEFINITIONS);
+        Tree properties = type.getChildOrNull(OAK_NAMED_PROPERTY_DEFINITIONS);
         if (properties != null) {
             for (Tree definitions : properties.getChildren()) {
                 String name = definitions.getName();
@@ -498,7 +498,7 @@ public class NodeDelegate extends ItemDe
         }
 
         // TODO: use a separate oak:autoCreateChildNodeDefinitions
-        Tree childNodes = type.getChild(OAK_NAMED_CHILD_NODE_DEFINITIONS);
+        Tree childNodes = type.getChildOrNull(OAK_NAMED_CHILD_NODE_DEFINITIONS);
         if (childNodes != null) {
             for (Tree definitions : childNodes.getChildren()) {
                 String name = definitions.getName();
@@ -569,9 +569,9 @@ public class NodeDelegate extends ItemDe
 
         // first look for named node definitions
         for (Tree type : types) {
-            Tree named = type.getChild(OAK_NAMED_CHILD_NODE_DEFINITIONS);
+            Tree named = type.getChildOrNull(OAK_NAMED_CHILD_NODE_DEFINITIONS);
             if (named != null) {
-                Tree definitions = named.getChild(childName);
+                Tree definitions = named.getChildOrNull(childName);
                 if (definitions != null) {
                     String defaultName =
                             findDefaultPrimaryType(typeRoot, definitions);
@@ -584,7 +584,7 @@ public class NodeDelegate extends ItemDe
 
         // then check residual definitions
         for (Tree type : types) {
-            Tree definitions = type.getChild(OAK_RESIDUAL_CHILD_NODE_DEFINITIONS);
+            Tree definitions = type.getChildOrNull(OAK_RESIDUAL_CHILD_NODE_DEFINITIONS);
             if (definitions != null) {
                 String defaultName =
                         findDefaultPrimaryType(typeRoot, definitions);
@@ -606,14 +606,14 @@ public class NodeDelegate extends ItemDe
 
         String primary = getName(tree, JCR_PRIMARYTYPE);
         if (primary != null) {
-            Tree type = typeRoot.getChild(primary);
+            Tree type = typeRoot.getChildOrNull(primary);
             if (type != null) {
                 types.add(type);
             }
         }
 
         for (String mixin : getNames(tree, JCR_MIXINTYPES)) {
-            Tree type = typeRoot.getChild(mixin);
+            Tree type = typeRoot.getChildOrNull(mixin);
             if (type != null) {
                 types.add(type);
             }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java Mon Apr 29 12:41:59 2013
@@ -260,20 +260,20 @@ public class SessionDelegate {
         Root moveRoot = transientOp ? root : contentSession.getLatestRoot();
 
         // check destination
-        Tree dest = moveRoot.getTree(destPath);
+        Tree dest = moveRoot.getTreeOrNull(destPath);
         if (dest != null) {
             throw new ItemExistsException(destPath);
         }
 
         // check parent of destination
         String destParentPath = PathUtils.getParentPath(destPath);
-        Tree destParent = moveRoot.getTree(destParentPath);
+        Tree destParent = moveRoot.getTreeOrNull(destParentPath);
         if (destParent == null) {
             throw new PathNotFoundException(PathUtils.getParentPath(destPath));
         }
 
         // check source exists
-        Tree src = moveRoot.getTree(srcPath);
+        Tree src = moveRoot.getTreeOrNull(srcPath);
         if (src == null) {
             throw new PathNotFoundException(srcPath);
         }
@@ -313,7 +313,7 @@ public class SessionDelegate {
      */
     @CheckForNull
     private Tree getTree(String path) {
-        return root.getTree(path);
+        return root.getTreeOrNull(path);
     }
 
     /**

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java Mon Apr 29 12:41:59 2013
@@ -55,7 +55,7 @@ public class VersionHistoryDelegate exte
 
     @Nonnull
     public VersionDelegate getRootVersion() throws RepositoryException {
-        Tree rootVersion = getTree().getChild(VersionConstants.JCR_ROOTVERSION);
+        Tree rootVersion = getTree().getChildOrNull(VersionConstants.JCR_ROOTVERSION);
         if (rootVersion == null) {
             throw new RepositoryException("Inconsistent version storage. " +
                     "VersionHistory does not have a root version");
@@ -67,7 +67,7 @@ public class VersionHistoryDelegate exte
     public VersionDelegate getVersion(@Nonnull String versionName)
             throws VersionException, RepositoryException {
         checkNotNull(versionName);
-        Tree version = getTree().getChild(versionName);
+        Tree version = getTree().getChildOrNull(versionName);
         if (version == null) {
             throw new VersionException("No such Version: " + versionName);
         }
@@ -137,7 +137,7 @@ public class VersionHistoryDelegate exte
         return Iterators.transform(versions.values().iterator(), new Function<String, VersionDelegate>() {
             @Override
             public VersionDelegate apply(String name) {
-                return VersionDelegate.create(sessionDelegate, thisTree.getChild(name));
+                return VersionDelegate.create(sessionDelegate, thisTree.getChildOrNull(name));
             }
         });
     }
@@ -152,7 +152,7 @@ public class VersionHistoryDelegate exte
      */
     @Nonnull
     private Tree getVersionLabelsTree() throws RepositoryException {
-        Tree versionLabels = getTree().getChild(VersionConstants.JCR_VERSIONLABELS);
+        Tree versionLabels = getTree().getChildOrNull(VersionConstants.JCR_VERSIONLABELS);
         if (versionLabels == null) {
             throw new RepositoryException("Inconsistent version storage. " +
                     "VersionHistory does not have jcr:versionLabels child node");

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java Mon Apr 29 12:41:59 2013
@@ -116,7 +116,7 @@ public class ReadWriteVersionManager ext
                 throw new RepositoryException(e);
             }
         }
-        return getBaseVersion(getWorkspaceRoot().getTree(location.getPath()));
+        return getBaseVersion(getWorkspaceRoot().getTreeOrNull(location.getPath()));
     }
 
     /**

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java Mon Apr 29 12:41:59 2013
@@ -118,7 +118,7 @@ public class SessionImporter implements 
         // add node
         node = parent.addNode(nodeName, nodeTypeName == null ? namespaceHelper.getJcrName(NamespaceRegistry.NAMESPACE_NT, "unstructured") : nodeTypeName);
         if (uuid != null) {
-            root.getTree(node.getPath()).setProperty(NamespaceRegistry.PREFIX_JCR + ":uuid", uuid);
+            root.getTreeOrNull(node.getPath()).setProperty(NamespaceRegistry.PREFIX_JCR + ":uuid", uuid);
         }
         // add mixins
         if (mixinNames != null) {
@@ -288,7 +288,7 @@ public class SessionImporter implements 
                 // start of a item tree that is protected by this parent. If it
                 // potentially is able to deal with it, notify it about the child node.
                 for (ProtectedItemImporter pni : pItemImporters) {
-                    if (pni instanceof ProtectedNodeImporter && ((ProtectedNodeImporter) pni).start(root.getTree(parent.getPath()))) {
+                    if (pni instanceof ProtectedNodeImporter && ((ProtectedNodeImporter) pni).start(root.getTreeOrNull(parent.getPath()))) {
                         log.debug("Protected node -> delegated to ProtectedNodeImporter");
                         pnImporter = (ProtectedNodeImporter) pni;
                         pnImporter.startChildInfo(nodeInfo, propInfos);
@@ -408,7 +408,7 @@ public class SessionImporter implements 
 
                     // notify the ProtectedPropertyImporter.
                     for (ProtectedItemImporter ppi : pItemImporters) {
-                        if (ppi instanceof ProtectedPropertyImporter && ((ProtectedPropertyImporter) ppi).handlePropInfo(root.getTree(node.getPath()), pi, def)) {
+                        if (ppi instanceof ProtectedPropertyImporter && ((ProtectedPropertyImporter) ppi).handlePropInfo(root.getTreeOrNull(node.getPath()), pi, def)) {
                             log.debug("Protected property -> delegated to ProtectedPropertyImporter");
                             break;
                         } /* else: p-i-Importer isn't able to deal with this property.
@@ -437,7 +437,7 @@ public class SessionImporter implements 
             }
         } else if (parent.getDefinition().isProtected()) {
             if (pnImporter != null) {
-                pnImporter.end(root.getTree(parent.getPath()));
+                pnImporter.end(root.getTreeOrNull(parent.getPath()));
                 // and reset the pnImporter field waiting for the next protected
                 // parent -> selecting again from available importers
                 pnImporter = null;

Modified: jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java Mon Apr 29 12:41:59 2013
@@ -40,7 +40,7 @@ public class LuceneIndexQueryTest extend
 
     @Override
     protected void createTestIndexNode() throws Exception {
-        Tree index = root.getTree("/");
+        Tree index = root.getTreeOrNull("/");
         createTestIndexNode(index, LuceneIndexConstants.TYPE_LUCENE);
         root.commit();
     }

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java (original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/index/SolrCommitHookIT.java Mon Apr 29 12:41:59 2013
@@ -20,7 +20,6 @@ import javax.security.auth.Subject;
 
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.core.RootImpl;
-import org.apache.jackrabbit.oak.plugins.index.solr.index.SolrCommitHook;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrBaseTest;
 import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
@@ -45,13 +44,13 @@ public class SolrCommitHookIT extends So
     @Test
     public void testAddSomeNodes() throws Exception {
         Root r = createRootImpl();
-        r.getTree("/").addChild("a").addChild("b").addChild("doc1").
+        r.getTreeOrNull("/").addChild("a").addChild("b").addChild("doc1").
                 setProperty("text", "hit that hot hat tattoo");
-        r.getTree("/").getChild("a").addChild("c").addChild("doc2").
+        r.getTreeOrNull("/").getChildOrNull("a").addChild("c").addChild("doc2").
                 setProperty("text", "it hits hot hats");
-        r.getTree("/").getChild("a").getChild("b").addChild("doc3").
+        r.getTreeOrNull("/").getChildOrNull("a").getChildOrNull("b").addChild("doc3").
                 setProperty("text", "tattoos hate hot hits");
-        r.getTree("/").getChild("a").getChild("b").addChild("doc4").
+        r.getTreeOrNull("/").getChildOrNull("a").getChildOrNull("b").addChild("doc4").
                 setProperty("text", "hats tattoos hit hot");
         r.commit();
 
@@ -71,7 +70,7 @@ public class SolrCommitHookIT extends So
 
         // remove the node in oak
         Root r = createRootImpl();
-        r.getTree("/").getChild("z").remove();
+        r.getTreeOrNull("/").getChildOrNull("z").remove();
         r.commit();
 
         // check the node is not in Solr anymore

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrIndexQueryTest.java Mon Apr 29 12:41:59 2013
@@ -52,7 +52,7 @@ public class SolrIndexQueryTest extends 
 
     @Override
     protected void createTestIndexNode() throws Exception {
-        Tree index = root.getTree("/");
+        Tree index = root.getTreeOrNull("/");
         createTestIndexNode(index, SolrQueryIndex.TYPE);
         root.commit();
     }

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java?rev=1477009&r1=1477008&r2=1477009&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java (original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryEngineIT.java Mon Apr 29 12:41:59 2013
@@ -23,7 +23,6 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.core.RootImpl;
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinition;
 import org.apache.jackrabbit.oak.plugins.index.IndexDefinitionImpl;
-import org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrBaseTest;
@@ -58,7 +57,7 @@ public class SolrQueryEngineIT extends S
         IndexDefinition testID = new IndexDefinitionImpl("solr-test",
                 "solr", "/");
         Root root = createRootImpl();
-        Tree tree = root.getTree("/");
+        Tree tree = root.getTreeOrNull("/");
 
         tree.addChild("somenode").setProperty("foo", "bar");
         root.commit();



Mime
View raw message