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

Konrad Windszus edited comment on JCRVLT-826 at 1/6/26 4:33 PM:
----------------------------------------------------------------

bq. under the assumption, that in most cases protected properties are not part 
of a filevault package

This does not hold, as packages by default contain protected properties (most 
prominently jcr:uuid, compare with 
https://github.com/apache/jackrabbit-filevault/blob/c1d3aba606270a016920388e21b6e696e26700fb/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewImporter.java#L133-L142).

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. 


was (Author: kwin):
bq. under the assumption, that in most cases protected properties are not part 
of a filevault package

This does not hold, as packages by default contain protected properties (most 
prominently 
{{[jcr:created|https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.7.11.7%20mix:created]}},
 but also jcr:createdBy).

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. 

> 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