jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1372958 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Date Tue, 14 Aug 2012 16:15:08 GMT
Author: mduerig
Date: Tue Aug 14 16:15:08 2012
New Revision: 1372958

URL: http://svn.apache.org/viewvc?rev=1372958&view=rev
Log:
OAK-243: NodeImpl.getParent() not fully encapsulated in a SessionOperation

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java

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=1372958&r1=1372957&r2=1372958&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
Tue Aug 14 16:15:08 2012
@@ -110,20 +110,20 @@ public class NodeImpl extends ItemImpl<N
     public Node getParent() throws RepositoryException {
         checkStatus();
 
-        if (dlg.isRoot()) {
-            throw new ItemNotFoundException("Root has no parent");
-        } else {
-            return sessionDelegate.perform(new SessionOperation<NodeImpl>() {
-                @Override
-                public NodeImpl perform() throws RepositoryException {
+        return sessionDelegate.perform(new SessionOperation<NodeImpl>() {
+            @Override
+            public NodeImpl perform() throws RepositoryException {
+                if (dlg.isRoot()) {
+                    throw new ItemNotFoundException("Root has no parent");
+                } else {
                     NodeDelegate parent = dlg.getParent();
                     if (parent == null) {
                         throw new AccessDeniedException();
                     }
                     return new NodeImpl(parent);
                 }
-            });
-        }
+            }
+        });
     }
 
     /**



Mime
View raw message