kwin commented on code in PR #398:
URL: 
https://github.com/apache/jackrabbit-filevault/pull/398#discussion_r2557521701


##########
vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewImporter.java:
##########
@@ -906,16 +906,20 @@ private StackElement addNode(DocViewNode2 docViewNode) 
throws RepositoryExceptio
                             } else {
                                 log.warn("To-be imported node and existing 
conflicting node have different parents. Will create new identifier for the 
former. ({})",
                                         newNodePath);
-                                preprocessedProperties.removeIf(p -> 
p.getName().equals(NameConstants.JCR_UUID) 
-                                        || 
p.getName().equals(NameConstants.JCR_BASEVERSION) 
+                                preprocessedProperties.removeIf(p -> 
p.getName().equals(NameConstants.JCR_UUID)
+                                        || 
p.getName().equals(NameConstants.JCR_BASEVERSION)
                                         || 
p.getName().equals(NameConstants.JCR_PREDECESSORS)
                                         || 
p.getName().equals(NameConstants.JCR_SUCCESSORS)
                                         || 
p.getName().equals(NameConstants.JCR_VERSIONHISTORY));
                             }
                         }
                     }
                 } catch (ItemNotFoundException e) {
-                    // ignore
+                    // no node with same ID present, but target node exists
+                    if (existingNode != null && idConflictPolicy == 
IdConflictPolicy.LEGACY && 
existingNode.isNodeType(JcrConstants.MIX_REFERENCEABLE)) {
+                        log.debug("IdConflictPolicy.LEGACY - removing 
Identifier " + identifier.get() + " from imported package at: " + 
docViewNode.getName());

Review Comment:
   I find this a bit confusing, what about 
   ```suggestion
                           log.debug("IdConflictPolicy.LEGACY - ignoring 
Identifier " + identifier.get() + " from imported package at " + 
docViewNode.getName() + " but keep existing identifier " + 
existingNode.getIdentifier() );
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to