jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r178396 - in /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: NodeImpl.java state/NodeState.java
Date Wed, 25 May 2005 07:12:49 GMT
Author: tripod
Date: Wed May 25 00:12:48 2005
New Revision: 178396

URL: http://svn.apache.org/viewcvs?rev=178396&view=rev
Log:
- optimize move operations (finally :-)

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=178396&r1=178395&r2=178396&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Wed May 25
00:12:48 2005
@@ -553,7 +553,10 @@
         thisState.removeChildNodeEntry(oldName, index);
         thisState.addChildNodeEntry(newName, uuid);
 
-        return (NodeImpl) itemMgr.getItem(new NodeId(uuid));
+        // create transient state of target, so that it gets modified.
+        NodeImpl target = (NodeImpl) itemMgr.getItem(new NodeId(uuid));
+        target.getOrCreateTransientItemState();
+        return target;
     }
 
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java?rev=178396&r1=178395&r2=178396&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java Wed
May 25 00:12:48 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