jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r178205 - in /incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core: SessionImpl.java state/NodeState.java
Date Tue, 24 May 2005 16:50:21 GMT
Author: tripod
Date: Tue May 24 09:50:13 2005
New Revision: 178205

URL: http://svn.apache.org/viewcvs?rev=178205&view=rev
Log:
- optimize move operations

Modified:
    incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/SessionImpl.java
    incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/state/NodeState.java

Modified: incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/SessionImpl.java?rev=178205&r1=178204&r2=178205&view=diff
==============================================================================
--- incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/SessionImpl.java
Tue May 24 09:50:13 2005
@@ -911,24 +911,21 @@
         }
 
         // check lock status
+
         srcParentNode.checkLock();
         destParentNode.checkLock();
 
+        // do move operation
+
         String targetUUID = ((NodeState) targetNode.getItemState()).getUUID();
+        // add target to new parent
+        destParentNode.createChildNodeLink(destName.getName(), targetUUID);
+        // remove target from old parent
         int index = srcName.getIndex();
         if (index == 0) {
             index = 1;
         }
-
-        if (srcParentNode.isSame(destParentNode)) {
-            // do rename
-            destParentNode.renameChildNodeLink(srcName.getName(), index, targetUUID, destName.getName());
-        } else {
-            // do move
-            destParentNode.createChildNodeLink(destName.getName(), targetUUID);
-            srcParentNode.removeChildNode(srcName.getName(), index);
-        }
-
+        srcParentNode.removeChildNode(srcName.getName(), index);
         // change definition of target if necessary
         NodeDefinitionImpl oldTargetDef = (NodeDefinitionImpl) targetNode.getDefinition();
         NodeDefId oldTargetDefId = oldTargetDef.unwrap().getId();

Modified: incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/state/NodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/state/NodeState.java?rev=178205&r1=178204&r2=178205&view=diff
==============================================================================
--- incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/state/NodeState.java
(original)
+++ incubator/jackrabbit/branches/ri-1.0/src/java/org/apache/jackrabbit/core/state/NodeState.java
Tue May 24 09:50:13 2005
@@ -202,6 +202,9 @@
      * @see #removeParentUUID
      */
     public synchronized void addParentUUID(String uuid) {
+        if (parentUUIDs.isEmpty()) {
+            parentUUID = uuid;
+        }
         parentUUIDs.add(uuid);
     }
 
@@ -242,6 +245,11 @@
     public synchronized void setParentUUIDs(List uuids) {
         parentUUIDs.clear();
         parentUUIDs.addAll(uuids);
+        if (!parentUUIDs.isEmpty()) {
+            parentUUID = (String) parentUUIDs.iterator().next();
+        } else {
+            parentUUID = null;
+        }
     }
 
     /**



Mime
View raw message