You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/08/19 10:07:00 UTC
[jira] [Comment Edited] (OAK-9541) ItemExistsException thrown
during SysView import with
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
[ https://issues.apache.org/jira/browse/OAK-9541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17401583#comment-17401583 ]
Konrad Windszus edited comment on OAK-9541 at 8/19/21, 10:06 AM:
-----------------------------------------------------------------
The condition at https://github.com/apache/jackrabbit-oak/blob/d01cb5c9dbc6ae6fdb4df58fd81ac5ed8b0536d3/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java#L423 IMHO negates the wrong expression.
Instead of
{code}
if (!(existingIdentifier.equals(id)
&& (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
|| uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING)))
{code}
probably
{code}
if (existingIdentifier.equals(id)
&& !(uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
|| uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING)))
{code}
is meant.
was (Author: kwin):
The condition at https://github.com/apache/jackrabbit-oak/blob/d01cb5c9dbc6ae6fdb4df58fd81ac5ed8b0536d3/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java#L423 IMHO negates the wrong expression.
Instead of
{code}
if (!(existingIdentifier.equals(id)
&& (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
|| uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING)))
{code}
{code}
if (existingIdentifier.equals(id)
&& !(uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
|| uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING)))
{code}
> ItemExistsException thrown during SysView import with ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
> --------------------------------------------------------------------------------------------------------------
>
> Key: OAK-9541
> URL: https://issues.apache.org/jira/browse/OAK-9541
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: jcr
> Affects Versions: 1.40.0
> Reporter: Konrad Windszus
> Priority: Major
>
> When trying to import a node via SysViewImportHandler which already exists with a different (but non-referenced UUID) in the repo the following exception can be observed:
> {code}
> javax.jcr.ItemExistsException: Node with the same UUID exists:/tmp/referenceable/child: { jcr:primaryType = nt:unstructured}
> at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.startNode(ImporterImpl.java:426) ~[oak-jcr-1.40.0.jar:1.40.0]
> at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:81) ~[oak-jcr-1.40.0.jar:1.40.0]
> at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.endElement(SysViewImportHandler.java:221) ~[oak-jcr-1.40.0.jar:1.40.0]
> at org.apache.jackrabbit.oak.jcr.xml.ImportHandler.endElement(ImportHandler.java:197) ~[oak-jcr-1.40.0.jar:1.40.0]
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)