[ https://issues.apache.org/jira/browse/OAK-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13616270#comment-13616270 ]
Michael Dürig commented on OAK-690: ----------------------------------- At revision 1462088 I changed the contract for {{Tree}} and {{Root}} such that trees stay valid across {{Root.commit}}, {{Root.rebase}} and {{Root.refresh}}. {{Tree}} instances may still become disconnected in certain cases though: * after a call to {{Tree.remove}} * after refresh/rebase/commit when the underlying node in the repository has gone Disconnected tree instances throw an {{InvalidStateException}} on all method calls except for {{getName}}, {{isRoot}}, {{getPath}}, {{getParent}} and {{getStatus}}. The state reflected by the former methods reflect that at the time when the tree became disconnected. > Enforce and clarify Root contract wrt. invalid Tree instances > ------------------------------------------------------------- > > Key: OAK-690 > URL: https://issues.apache.org/jira/browse/OAK-690 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: core > Reporter: Michael Dürig > Assignee: Michael Dürig > > The contract of {{Root.commit()}}, {{Root.refresh()}} and {{Root.rebase()}} > specify that {{Tree}} instances acquired through that {{Root}} instance > become invalid after one of these methods are called. > In fact the hierarchy related methods are not affected by this, which is > required for higher layers to be able to reload {{Tree}} instances that have > become invalid. OTOH affected methods might not immediately throw an > exception but just result in undefined behaviour. I'd like to change this > such that invalid {{Tree}} instances immediately throw an > {{IllegalStateException}} when accessed. -- 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