You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2013/07/24 16:27:49 UTC

[jira] [Commented] (OAK-930) VersionManager#isCheckedOut throws IllegalStateException

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

angela commented on OAK-930:
----------------------------

added test-case illustrating the problem at revision 1506574
                
> VersionManager#isCheckedOut throws IllegalStateException
> --------------------------------------------------------
>
>                 Key: OAK-930
>                 URL: https://issues.apache.org/jira/browse/OAK-930
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, jcr
>            Reporter: angela
>
> the currently implementation of VersionManager#isCheckedOut will throws
> IllegalStateException if the node at the specified path is not versionable and the root node is not accessible to the editing session.
> the issue is caused by the implementation of ReadOnlyVersionManager#isCheckedOut
> which looks as follows:
> {code}
> if (checkNotNull(tree).exists()) {
>             PropertyState p = tree.getProperty(VersionConstants.JCR_ISCHECKEDOUT);
>             if (p != null) {
>                 return p.getValue(Type.BOOLEAN);
>             } else if (tree.isRoot()) {
>                 return true;
>             }
>         } else {
>             // FIXME: this actually means access to the tree is restricted
>             // and may result in wrong isCheckedOut value. This should never
>             // be the case in a commit hook because it operates on non-access-
>             // controlled NodeStates. This means consistency is not at risk
>             // but it may mean oak-jcr sees a node as checked out even though
>             // it is in fact read-only because of a checked-in ancestor.
>         }
>         // otherwise return checkedOut status of parent
>         return isCheckedOut(tree.getParent());
> {code}
> in fact: in case of the failing calling the code hits the FIXME.
> IMHO the underlying problem is caused by the fact that the versionmanager operates on the access controlled tree instances instead of relying on low level NodeState or ImmutableTree.
> i will commit a test case illustrating the problem.

--
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