[ 
https://issues.apache.org/jira/browse/JCRVLT-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18037483#comment-18037483
 ] 

Konrad Windszus commented on JCRVLT-826:
----------------------------------------

For several reasons I would not go a route which relies on exceptions only: 
https://stackoverflow.com/questions/729379/why-not-use-exceptions-as-regular-flow-of-control.

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

Reply via email to