David Caviedes created JCR-3877:
-----------------------------------

             Summary: XML bootstrap import: Bad "if" conditions when resolving 
UUID conflicts
                 Key: JCR-3877
                 URL: https://issues.apache.org/jira/browse/JCR-3877
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.8
         Environment: Windows 7 64 bits // Java 1.7.0_67
            Reporter: David Caviedes


There is a bad "if" condition in class 
org.apache.jackrabbit.core.xml.SessionImporter when trying to resolve UUID 
conflicts at line 377:
{code:title=SessionImporter .java|borderStyle=solid}// 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_REPLACE_EXISTING))) {
                        throw new ItemExistsException(
                                "Node with the same UUID exists:" + existing);
                    }{code}

In our case, the old id is filled and the new id is null, so 
"existing.getId().equals(id)" will always return false so the "if" condition 
will always be true, what is not correct, because uuids are not the same (as 
the exception says).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to