jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r157347 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Date Sun, 13 Mar 2005 18:09:05 GMT
Author: tripod
Date: Sun Mar 13 10:09:04 2005
New Revision: 157347

URL: http://svn.apache.org/viewcvs?view=rev&rev=157347
Log:
- fixing duplicated references (JCR-45)

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?view=diff&r1=157346&r2=157347
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Sun Mar 13 10:09:04 2005
@@ -19,6 +19,7 @@
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.Constants;
+import org.apache.jackrabbit.core.PropertyId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.ItemStateManager;
@@ -30,6 +31,7 @@
 import javax.jcr.version.VersionHistory;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ArrayList;
 
 /**
  * This Class implements a VersionManager. It more or less acts as proxy
@@ -248,7 +250,16 @@
      * {@inheritDoc}
      */
     public void setItemReferences(InternalVersionItem item, List references) {
-        vMgr.setItemReferences(item, references);
+        // filter out version storage intern ones
+        ArrayList refs = new ArrayList();
+        Iterator iter = references.iterator();
+        while (iter.hasNext()) {
+            PropertyId id = (PropertyId) iter.next();
+            if (!vMgr.hasItem(id.getParentUUID())) {
+                refs.add(id);
+            }
+        }
+        vMgr.setItemReferences(item, refs);
     }
 
     /**



Mime
View raw message