Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3877

XML bootstrap import: Bad "if" conditions when resolving UUID conflicts

    XMLWordPrintableJSON

Details

    • Important

    Description

      There is a bad "if" condition in class org.apache.jackrabbit.core.xml.SessionImporter when trying to resolve UUID conflicts at line 377:

      SessionImporter .java
      // 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);
                          }

      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).

      Attachments

        Activity

          People

            Unassigned Unassigned
            dcaviedes David Caviedes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: