jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r723784 - /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Date Fri, 05 Dec 2008 16:31:05 GMT
Author: reschke
Date: Fri Dec  5 08:31:05 2008
New Revision: 723784

URL: http://svn.apache.org/viewvc?rev=723784&view=rev
Log:
JCR-1902: avoid warning when parent-set property is computed on root node

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java?rev=723784&r1=723783&r2=723784&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Fri Dec  5 08:31:05 2008
@@ -936,25 +936,27 @@
      */
     public Set getParentElements() {
         try {
-            //TODO remove this check once jcr2 is out
-            if (!(this.node instanceof org.apache.jackrabbit.api.jsr283.Node)) {
-                DavResourceLocator loc = this.locator.getFactory().createResourceLocator(
-                        this.locator.getPrefix(), this.locator.getWorkspacePath(), this.node.getParent().getPath(),
false);
-                return Collections.singleton(new ParentElement(loc.getHref(true), this.node.getName()));
-            }
-            Set ps = new HashSet();
-            NodeIterator sharedSetIterator = ((org.apache.jackrabbit.api.jsr283.Node) this.node).getSharedSet();
-            while (sharedSetIterator.hasNext()) {
-                Node sharednode = sharedSetIterator.nextNode();
-                DavResourceLocator loc = this.locator.getFactory().createResourceLocator(
-                        this.locator.getPrefix(), this.locator.getWorkspacePath(), sharednode.getParent().getPath(),
false);
-                ps.add(new ParentElement(loc.getHref(true), sharednode.getName()));
+            if (this.node.getDepth() > 0) {
+                //TODO remove this check once jcr2 is out
+                if (!(this.node instanceof org.apache.jackrabbit.api.jsr283.Node)) {
+                    DavResourceLocator loc = this.locator.getFactory().createResourceLocator(
+                            this.locator.getPrefix(), this.locator.getWorkspacePath(), this.node.getParent().getPath(),
false);
+                    return Collections.singleton(new ParentElement(loc.getHref(true), this.node.getName()));
+                }
+                Set ps = new HashSet();
+                NodeIterator sharedSetIterator = ((org.apache.jackrabbit.api.jsr283.Node)
this.node).getSharedSet();
+                while (sharedSetIterator.hasNext()) {
+                    Node sharednode = sharedSetIterator.nextNode();
+                    DavResourceLocator loc = this.locator.getFactory().createResourceLocator(
+                            this.locator.getPrefix(), this.locator.getWorkspacePath(), sharednode.getParent().getPath(),
false);
+                    ps.add(new ParentElement(loc.getHref(true), sharednode.getName()));
+                }
+                return ps;
             }
-            return ps;
         } catch (RepositoryException e) {
             log.warn("unable to calculate parent set", e);
-            return Collections.EMPTY_SET; 
         }
+        return Collections.EMPTY_SET;
     }
 
     /**



Mime
View raw message