jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r409624 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Date Fri, 26 May 2006 10:23:04 GMT
Author: stefan
Date: Fri May 26 03:23:04 2006
New Revision: 409624

URL: http://svn.apache.org/viewvc?rev=409624&view=rev
Log:
JCR-439 Workspace.clone() fails the second time, if cloning referenceables

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=409624&r1=409623&r2=409624&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Fri May 26 03:23:04 2006
@@ -1622,19 +1622,11 @@
                         NodeState existingState = (NodeState) stateMgr.getItemState(id);
                         // make sure existing node is not the parent
                         // or an ancestor thereof
-                        Path p0 = hierMgr.getPath(destParentId);
-                        Path p1 = hierMgr.getPath(id);
-                        try {
-                            if (p1.equals(p0) || p1.isAncestorOf(p0)) {
-                                String msg = "cannot remove ancestor node";
-                                log.debug(msg);
-                                throw new RepositoryException(msg);
-                            }
-                        } catch (MalformedPathException mpe) {
-                            // should never get here...
-                            String msg = "internal error: failed to determine degree of relationship";
-                            log.error(msg, mpe);
-                            throw new RepositoryException(msg, mpe);
+                        if (id.equals(destParentId) 
+                                || hierMgr.isAncestor(id, destParentId)) {
+                            String msg = "cannot remove ancestor node";
+                            log.debug(msg);
+                            throw new RepositoryException(msg);
                         }
 
                         // check if existing can be removed



Mime
View raw message