jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r577696 - in /jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml: SessionImporter.java WorkspaceImporter.java
Date Thu, 20 Sep 2007 11:44:19 GMT
Author: jukka
Date: Thu Sep 20 04:44:19 2007
New Revision: 577696

URL: http://svn.apache.org/viewvc?rev=577696&view=rev
Log:
1.3: Merged revision 575325 (JCR-1128)

Modified:
    jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
    jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java?rev=577696&r1=577695&r2=577696&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
Thu Sep 20 04:44:19 2007
@@ -204,7 +204,7 @@
         QName[] mixins = nodeInfo.getMixinNames();
 
         if (parent == null) {
-            // parent node was skipped, skip this child node also
+            // parent node was skipped, skip this child node too
             parents.push(null); // push null onto stack for skipped node
             log.debug("skipping node " + nodeName);
             return;
@@ -226,7 +226,14 @@
                     // this node has already been auto-created, no need to create it
                     node = existing;
                 } else {
-                    throw new ItemExistsException(existing.safeGetJCRPath());
+                    // edge case: colliding node does have same uuid
+                    // (see http://issues.apache.org/jira/browse/JCR-1128)
+                    if (! (existing.getId().equals(id)
+                            && (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
+                            || uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING)))
{
+                        throw new ItemExistsException(existing.safeGetJCRPath());
+                    }
+                    // fall through
                 }
             }
         }

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?rev=577696&r1=577695&r2=577696&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Thu Sep 20 04:44:19 2007
@@ -370,7 +370,7 @@
             QName[] mixins = nodeInfo.getMixinNames();
 
             if (parent == null) {
-                // parent node was skipped, skip this child node also
+                // parent node was skipped, skip this child node too
                 parents.push(null); // push null onto stack for skipped node
                 succeeded = true;
                 log.debug("skipping node " + nodeName);
@@ -402,7 +402,14 @@
                         // no need to create it
                         node = existing;
                     } else {
-                        throw new ItemExistsException(itemOps.safeGetJCRPath(existing.getNodeId()));
+                        // edge case: colliding node does have same uuid
+                        // (see http://issues.apache.org/jira/browse/JCR-1128)
+                        if (! (idExisting.equals(id)
+                                && (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
+                                || uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING)))
{
+                            throw new ItemExistsException(itemOps.safeGetJCRPath(existing.getNodeId()));
+                        }
+                        // fall through
                     }
                 }
             }



Mime
View raw message