You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2004/10/01 18:17:01 UTC

svn commit: rev 47651 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core

Author: stefan
Date: Fri Oct  1 09:16:59 2004
New Revision: 47651

Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
Log:
bug fix: Item.getAncestor(int) throws PathNotFoundException instead of ItemNotFoundException

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java	(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java	Fri Oct  1 09:16:59 2004
@@ -1147,12 +1147,11 @@
             return itemMgr.getRootNode();
         }
 
-        // Path.getAncestor requires relative degree, i.e. we need
-        // to convert absolute to relative ancestor degree
-        Path path = getPrimaryPath();
-        Path ancestorPath = path.getAncestor(path.getAncestorCount() - degree);
-
         try {
+            // Path.getAncestor requires relative degree, i.e. we need
+            // to convert absolute to relative ancestor degree
+            Path path = getPrimaryPath();
+            Path ancestorPath = path.getAncestor(path.getAncestorCount() - degree);
             return itemMgr.getItem(ancestorPath);
         } catch (PathNotFoundException pnfe) {
             throw new ItemNotFoundException();