[
https://issues.apache.org/jira/browse/OAK-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13576689#comment-13576689
]
Michael Dürig commented on OAK-606:
-----------------------------------
I just had a quick chat with [~anchela] about above behaviour and we came to
the conclusion that it might be better to make the last line from above also
throw an {{IllegalItemStateException}}. I.e. when an item becomes invalid in
this sense, it stays invalid for ever. A consequence of this however is, that
we also need to throw in {{isSame()}} calls:
{code}
Node foo = session.getNode("/foo");
session.move("/foo", "/bar");
foo.getPath(); // throws IllegalItemStateException
session.getRootNode().addNode("foo");
foo.getPath(); // still throws IllegalItemStateException
Node fooAgain = session.getNode("/foo");
fooAgain.isSame(foo); // also throws IllagalItemStateException since foo is
"invalid"
{code}
> Node becomes invalid after Session#move()
> -----------------------------------------
>
> Key: OAK-606
> URL: https://issues.apache.org/jira/browse/OAK-606
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: jcr
> Reporter: angela
> Attachments: OAK-606.patch
>
>
> moving or renaming an existing (saved) node renders that node instance
> invalid and any access on that node instance will throw IllegalStateException.
--
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