jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1478110 - in /jackrabbit/oak/trunk: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/
Date Wed, 01 May 2013 17:42:42 GMT
Author: mduerig
Date: Wed May  1 17:42:41 2013
New Revision: 1478110

URL: http://svn.apache.org/r1478110
Log:
OAK-798: Review / refactor TreeImpl and related classes
reduce usage of deprecated methods: replace Root.getTreeOrNull with Root.getTree in oak-jcr

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImplTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/SessionImporter.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImplTest.java?rev=1478110&r1=1478109&r2=1478110&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/TokenProviderImplTest.java
Wed May  1 17:42:41 2013
@@ -217,7 +217,7 @@ public class TokenProviderImplTest exten
         String tokenNodePath = tokens.getChildren().iterator().next().getPath();
 
         tokenProvider.removeToken(info);
-        assertTrue(root.getTree(tokenNodePath).exists());
+        assertFalse(root.getTree(tokenNodePath).exists());
     }
 
     @Test

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=1478110&r1=1478109&r2=1478110&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
Wed May  1 17:42:41 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().getTreeOrNull("/"));
+                return Namespaces.getNamespaceMap(delegate.getRoot().getTree("/"));
             }
 
             @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=1478110&r1=1478109&r2=1478110&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
Wed May  1 17:42:41 2013
@@ -76,7 +76,7 @@ public class WorkspaceImpl implements Ja
 
             @Override
             protected Tree getTypes() {
-                return sessionDelegate.getRoot().getTreeOrNull(NODE_TYPES_PATH);
+                return sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
             }
 
             @Nonnull
@@ -188,7 +188,7 @@ public class WorkspaceImpl implements Ja
         return new ReadWriteNamespaceRegistry() {
             @Override
             protected Tree getReadTree() {
-                return sessionDelegate.getRoot().getTreeOrNull("/");
+                return sessionDelegate.getRoot().getTree("/");
             }
 
             @Override

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=1478110&r1=1478109&r2=1478110&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
Wed May  1 17:42:41 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.getTreeOrNull(node.getPath()).setProperty(NamespaceRegistry.PREFIX_JCR +
":uuid", uuid);
+            root.getTree(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.getTreeOrNull(parent.getPath()))) {
+                    if (pni instanceof ProtectedNodeImporter && ((ProtectedNodeImporter)
pni).start(root.getTree(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.getTreeOrNull(node.getPath()), pi, def)) {
+                        if (ppi instanceof ProtectedPropertyImporter && ((ProtectedPropertyImporter)
ppi).handlePropInfo(root.getTree(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.getTreeOrNull(parent.getPath()));
+                pnImporter.end(root.getTree(parent.getPath()));
                 // and reset the pnImporter field waiting for the next protected
                 // parent -> selecting again from available importers
                 pnImporter = null;



Mime
View raw message