[
https://issues.apache.org/jira/browse/OAK-7015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17682914#comment-17682914
]
Angela Schreiber commented on OAK-7015:
---------------------------------------
[~reschke], as discussed the downstream project is using
{{TreeFactory#createTree(@NotNull NodeBuilder builder)}} for which there is no
replacement and passes the Tree to {{IndexDefinitionBuilder#build(Tree tree)}}.
I quickly check remaining usages in the oak code base and they are as well
limited to indexing/search.
I would recommend to clean up the index/search code and make sure the builder
consistently operates on NodeStates/NodeBuilder objects. in this particular
case the code looks as follows:
{code}
indexBuilder.build(TreeFactory.createTree(luceneIdxBuilder));
{code}
which is a bit odd. it ignores the return value of the build method and the
original object is a builder. so the extra conversion to Tree doesn't make
sense to me. in particular as a tree should always be connected to a parent,
which in this case is not possible.
{{IndexDefinitionBuilder.build(Tree)}} in turn:
{code}
public Tree build(Tree tree) {
NodeStateCopyUtils.copyToTree(this.build(), tree);
return tree;
}
{code}
so again mixing NodeBuilder, NodeState, Tree. i would recommend to clean that
up and replace it with methods that take a NodeBuilder for consistency.
can you create a bug for that?
> Deprecate TreeFactory/RootFactory
> ---------------------------------
>
> Key: OAK-7015
> URL: https://issues.apache.org/jira/browse/OAK-7015
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: core
> Reporter: Angela Schreiber
> Assignee: Angela Schreiber
> Priority: Major
> Fix For: 1.7.12, 1.8.0
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)