-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JCRVLT-767: vlt: potential incorrect identifier comparison #348
base: master
Are you sure you want to change the base?
Conversation
vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewImporter.java
Outdated
Show resolved
Hide resolved
// if this is mix:ref and ni specifies an identifier, | ||
// try to set it | ||
try { | ||
uuidProp = node.setProperty(Property.JCR_UUID, identifier.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the uuid already set through the sysview import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we get here in case we skipped that...?
…etection of referenceable node)
…t fail on classic Jackrabbit by checking reh repo name desc as well)
boolean isUuidProtected = false; | ||
if (node.hasProperty(Property.JCR_UUID)) { | ||
isUuidProtected = node.getProperty(Property.JCR_UUID).getDefinition().isProtected(); | ||
} else if (! session.getRepository().getDescriptor(Repository.REP_NAME_DESC).contains("Oak")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why else if? Shouldn't this also overwrite isUuidProtected from line 995 potentially?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question; tests passed with Jackrabbit; will have another look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might have to do with https://jackrabbit.apache.org/oak/docs/differences.html#Identifiers - but code is unclear and needs fixing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should better wirh 223bb00
…ode that detects non-Oak repos)
if (! session.getRepository().getDescriptor(Repository.REP_NAME_DESC).contains("Oak")) { | ||
// workaround for non-Oak repos that may not be able to add | ||
// mixin:referencable *after* setting jcr:uuid | ||
isUuidProtected = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original idea was to encapsulate impl specific differences in https://github.com/apache/jackrabbit-filevault/blob/master/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/spi/ServiceProvider.java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointer; let's do more research on the "setting of jcr:uuid" first, and the outcome of that would inform what information we would want to add there.
(work in progress)
This appears to work, except in Jackrabbit, which is unhappy about the sequence "setProperty( ... uid ...)" followed by "addMixing(mix:ref)".