[
https://issues.apache.org/jira/browse/SLING-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481248#comment-13481248
]
Felix Meschberger commented on SLING-2626:
------------------------------------------
[~radu.cotescu] While technically it is compile compatible, I think it is an
API change if we introduce the NPE possibility by documenting it. Rather I was
thinking of just throwing a SlingException.
On the other hand, the longer I think of it taking in mind, that the API should
be easy to use, we should really just be nice and return null as you propose.
> NPE in ResourceResolverImpl.getResource
> ---------------------------------------
>
> Key: SLING-2626
> URL: https://issues.apache.org/jira/browse/SLING-2626
> Project: Sling
> Issue Type: Bug
> Components: ResourceResolver
> Affects Versions: JCR Resource 2.1.0, Resource Resolver 1.0.0
> Reporter: Radu Cotescu
> Assignee: Carsten Ziegeler
> Labels: patch
> Fix For: Resource Resolver 1.0.0
>
> Attachments: sling_rev_1400664.patch
>
>
> The path parameter is not checked for null in either of the
> ResourceResolverImpl.getResource(String path) and
> ResourceResolverImpl.getResource(Resource base, String path), which makes the
> two methods throw NPE on several lines.
--
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