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 "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2013/11/13 09:26:18 UTC

[jira] [Comment Edited] (OAK-1173) NPE if checking for a non-existing node in version storage

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

Tobias Bocanegra edited comment on OAK-1173 at 11/13/13 8:25 AM:
-----------------------------------------------------------------

Test Case:

{code}
        ContentSession session = createTestSession();
        Root root = session.getLatestRoot();
        Tree vs = root.getTree("/jcr:system/jcr:versionStorage");
        vs.getChildrenCount(Long.MAX_VALUE);

--> throws NPE
{code}



was (Author: tripod):
Potential Test Case:

{code}
class org.apache.jackrabbit.oak.security.authorization.permission.TreePermissionImplTest ....
...
    @Test
    public void testCanReadHiddenNode() throws Exception {
        // ensure that :index exists
        Tree adminIndex = root.getTree("/jcr:system/jcr:versionStorage/:index");
        assertTrue(adminIndex.exists());

        ContentSession session = createTestSession();
        Root root = session.getLatestRoot();
        Tree vs = root.getTree("/jcr:system/jcr:versionStorage");
        Tree index = vs.getChild(":index");
        assertTrue(index.exists());
        session.close();
    }
{code}


> NPE if checking for a non-existing node in version storage
> ----------------------------------------------------------
>
>                 Key: OAK-1173
>                 URL: https://issues.apache.org/jira/browse/OAK-1173
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Tobias Bocanegra
>            Assignee: angela
>            Priority: Blocker
>
> NPE If a tree given to CompiledPermissionImpl.getTreePermission() does not have a primary type, e.g. for a "hidden" oak node:
> {noformat}
> 	  at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
> 	  at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl.getTreePermission(CompiledPermissionImpl.java:160)
> 	  at org.apache.jackrabbit.oak.security.authorization.permission.CompiledPermissionImpl$TreePermissionImpl.getChildPermission(CompiledPermissionImpl.java:443)
> 	  at org.apache.jackrabbit.oak.core.SecureNodeBuilder.getTreePermission(SecureNodeBuilder.java:352)
> 	  at org.apache.jackrabbit.oak.core.SecureNodeBuilder.exists(SecureNodeBuilder.java:129)
> 	  at org.apache.jackrabbit.oak.core.SecureNodeBuilder.hasChildNode(SecureNodeBuilder.java:271)
> 	  at org.apache.jackrabbit.oak.core.AbstractTree.getChildrenCount(AbstractTree.java:248)
> {noformat}
> The tree passed here to get the children count is: {{/jcr:system/jcr:versionStorage}} and the child node not having a primary type is {{:index}}



--
This message was sent by Atlassian JIRA
(v6.1#6144)