jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Parvulescu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-2540) Session operations null check
Date Mon, 02 Mar 2015 11:50:04 GMT

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

Alex Parvulescu commented on OAK-2540:
--------------------------------------

Thanks for the feedback!

So 
 * _Session#getAttribute_ no null check
 * _Session#impersonate_ null check

What can we do with _Session#hasCapability_ then, can _methodName_ ever be null? it doesn't
look like a valid input to me.

> Session operations null check
> -----------------------------
>
>                 Key: OAK-2540
>                 URL: https://issues.apache.org/jira/browse/OAK-2540
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>            Reporter: Alex Parvulescu
>            Assignee: Alex Parvulescu
>             Fix For: 1.1.8
>
>         Attachments: OAK-2540.patch
>
>
> Calling a _Session.getNode(null)_ throws an ugly NPE. We should add a few null checks
and turn those illegal inputs into IAEs.
> For those wondering Jackrabbit doesn't fare better here.
> _Oak_
> {code}
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.needsFullMapping(NamePathMapperImpl.java:224)
> 	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getOakPath(NamePathMapperImpl.java:80)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPath(SessionContext.java:306)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPathOrThrow(SessionContext.java:325)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getOakPathOrThrow(SessionImpl.java:149)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl.access$1(SessionImpl.java:148)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl$1.perform(SessionImpl.java:188)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl$1.perform(SessionImpl.java:1)
> 	at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:238)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl.perform(SessionImpl.java:139)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNodeOrNull(SessionImpl.java:184)
> 	at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNode(SessionImpl.java:315)
> {code}
> _Jackrabbit_
> {code}
> java.lang.NullPointerException
> 	at org.apache.jackrabbit.spi.commons.conversion.CachingPathResolver.getQPath(CachingPathResolver.java:93)
> 	at org.apache.jackrabbit.spi.commons.conversion.CachingPathResolver.getQPath(CachingPathResolver.java:77)
> 	at org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver.getQPath(DefaultNamePathResolver.java:82)
> 	at org.apache.jackrabbit.core.SessionImpl.getQPath(SessionImpl.java:648)
> 	at org.apache.jackrabbit.core.session.SessionContext.getQPath(SessionContext.java:338)
> 	at org.apache.jackrabbit.core.session.SessionItemOperation.perform(SessionItemOperation.java:185)
> 	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
> 	at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:361)
> 	at org.apache.jackrabbit.core.SessionImpl.getNode(SessionImpl.java:1111)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message