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

Jukka Zitting commented on OAK-781:
-----------------------------------

You're probably right about the need for an overhaul of the MemoryNodeBuilder 
implementation, as it has evolved quite a bit from the original design. Since 
this is a pretty central piece of functionality, it might be a good idea to 
start such an effort by better documenting the intended design and increasing 
test coverage. I'll start with a few design notes.

bq. Attached patch implements the behaviour defined herein and passed all tests.

Looks like a step in the right direction, though as you say, we'll probably 
need some more work here. Some comments:

* I'm not sure about the explicit {{exists}} flag. It would seem like a better 
idea to use the {{exists()}} status of the underlying base {{NodeState}}, as 
AFAICT that should already cover everything we need. I.e. 
{{MemoryNodeBuilder.exists()}} would be implemented as {{return 
read().exists()}}, returning the existence of either the read or write base 
state, depending on the state of the builder.
* Re: iterability vs. existence; We need to clarify the bit in the 
{{NodeState}} contract that says that {{!exists()}} implies 
{{!getChildNodeEntries().iterator().hasNext()}} (and similarly for 
{{getProperties()}}). That seems like the natural thing to do, but there might 
be some backwards compatibility issues we need to consider. I'll start a thread 
on oak-dev@ about that.
                
> Clarify / fix effects of MISSING_NODE as base state of NodeBuilder
> ------------------------------------------------------------------
>
>                 Key: OAK-781
>                 URL: https://issues.apache.org/jira/browse/OAK-781
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>            Reporter: Michael Dürig
>         Attachments: 
> 0001-OAK-781-Clarify-fix-effects-of-MISSING_NODE-as-base-.patch, OAK-781.patch
>
>
> Having a {{MISSING_NODE}} respectively a node state that returns false for 
> its {{exists}} method as a base state of a node builder results in undefined 
> behaviour. We need to clarify how to handle such cases for resolving OAK-766.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to