jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r160782 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Date Sun, 10 Apr 2005 15:09:54 GMT
Author: stefan
Date: Sun Apr 10 08:09:53 2005
New Revision: 160782

URL: http://svn.apache.org/viewcvs?view=rev&rev=160782
Log:
Workspace.clone(...,removeExisting=true) & Workspace.importXML(..., IMPORT_UUID_COLLISION_REMOVE_EXISTING)
potentially leaves repository in inconsistent state

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?view=diff&r1=160781&r2=160782
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Sun Apr 10 08:09:53 2005
@@ -393,7 +393,7 @@
             NodeId parentId = new NodeId(parentUUID);
 
             // unlink target node from this parent
-            unlinkNodeState(target, parentUUID);
+            unlinkNode(target, parentUUID);
 
             // remove child node entries
             NodeState parent;
@@ -436,7 +436,7 @@
      * @param parentUUID
      * @throws RepositoryException if an error occurs
      */
-    private void unlinkNodeState(NodeState target, String parentUUID)
+    private void unlinkNode(NodeState target, String parentUUID)
             throws RepositoryException {
 
         // check if this node state would be orphaned after unlinking it from parent
@@ -453,14 +453,14 @@
                 NodeState.ChildNodeEntry entry = (NodeState.ChildNodeEntry) tmp.get(i);
                 NodeId nodeId = new NodeId(entry.getUUID());
                 try {
-                    NodeState nodeState = (NodeState) stateMgr.getItemState(nodeId);
+                    NodeState node = (NodeState) stateMgr.getItemState(nodeId);
                     // check if child node can be removed
                     // (access rights, locking & versioning status)
-                    wsp.checkRemoveNode(nodeState, (NodeId) target.getId(),
+                    wsp.checkRemoveNode(node, (NodeId) target.getId(),
                             WorkspaceImpl.CHECK_ACCESS | WorkspaceImpl.CHECK_LOCK
                             | WorkspaceImpl.CHECK_VERSIONING);
                     // unlink child node (recursive)
-                    unlinkNodeState(nodeState, target.getUUID());
+                    unlinkNode(node, target.getUUID());
                 } catch (ItemStateException ise) {
                     String msg = "internal error: failed to retrieve state of "
                             + nodeId;
@@ -480,11 +480,11 @@
                 PropertyId propId =
                         new PropertyId(target.getUUID(), entry.getName());
                 try {
-                    PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
+                    PropertyState prop = (PropertyState) stateMgr.getItemState(propId);
                     // remove property entry
                     target.removePropertyEntry(propId.getName());
                     // destroy property state
-                    stateMgr.destroy(propState);
+                    stateMgr.destroy(prop);
                 } catch (ItemStateException ise) {
                     String msg = "internal error: failed to retrieve state of "
                             + propId;
@@ -499,10 +499,10 @@
         target.removeParentUUID(parentUUID);
 
         if (orphaned) {
-            // destroy target state
+            // destroy target
             stateMgr.destroy(target);
         } else {
-            // store target state
+            // store target
             stateMgr.store(target);
         }
     }



Mime
View raw message