[
https://issues.apache.org/jira/browse/JCRVLT-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050220#comment-18050220
]
Joerg Hoh commented on JCRVLT-826:
----------------------------------
> Therefore as long as Oak does not expose a method to check if a property is
> protected (without relying on exceptions) we have to stick to 2.
Do you mean "as long as we don't expose a method to set a property, which will
indicate the attempt of setting a protected property with an exception"?
Because the current approach works with a check, and I want to get rid of this
redundant check.
> Redundant check for protected properties in Vault?
> --------------------------------------------------
>
> Key: JCRVLT-826
> URL: https://issues.apache.org/jira/browse/JCRVLT-826
> Project: Jackrabbit FileVault
> Issue Type: Task
> Affects Versions: 4.1.4
> Reporter: Joerg Hoh
> Priority: Major
>
> On import filevault checks every property that it's not protected. This check
> can be quite expensive, as it needs to load the nodetype definition etc.
> {noformat}
> at
> org.apache.jackrabbit.vault.util.EffectiveNodeType.getApplicablePropertyDefinition(EffectiveNodeType.java:112)
> at
> org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.isPropertyProtected(DocViewImporter.java:1254)
> at
> org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.lambda$removeProtectedProperties$6(DocViewImporter.java:1228)
> at
> org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter$$Lambda/0x000000080198c220.test(Unknown
> Source)
> at
> java.util.stream.ReferencePipeline$2$1.accept([email protected]/ReferencePipeline.java:178)
> at
> java.util.Iterator.forEachRemaining([email protected]/Iterator.java:133)
> at
> java.util.Spliterators$IteratorSpliterator.forEachRemaining([email protected]/Spliterators.java:1939)
> at
> java.util.stream.AbstractPipeline.copyInto([email protected]/AbstractPipeline.java:509)
> at
> java.util.stream.AbstractPipeline.wrapAndCopyInto([email protected]/AbstractPipeline.java:499)
> at
> java.util.stream.ReduceOps$ReduceOp.evaluateSequential([email protected]/ReduceOps.java:921)
> at
> java.util.stream.AbstractPipeline.evaluate([email protected]/AbstractPipeline.java:234)
> at
> java.util.stream.ReferencePipeline.collect([email protected]/ReferencePipeline.java:682)
> at
> org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.removeProtectedProperties(DocViewImporter.java:1242)
> at
> org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.updateExistingNode(DocViewImporter.java:1082)
> at
> org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.addNode(DocViewImporter.java:956)
> {noformat}
> But at the same time Oak also does the same checks when properties are
> actually set.
> We should check if it makes sense to rely only on Oak for these checks, and
> let FileVault handle the exceptions caused by trying to set protected
> properties.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)