[ 
https://issues.apache.org/jira/browse/SLING-5605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler resolved SLING-5605.
-------------------------------------
    Resolution: Fixed

As discussed we should rather change the api than the implementation.
A good service should rather return null and not throw a runtime exception for 
such cases. As the implementation is already doing this and existing clients 
handle the null as a return value, we can safely adjust the javadocs

> Wrong null annotations on ServletResolver interface
> ---------------------------------------------------
>
>                 Key: SLING-5605
>                 URL: https://issues.apache.org/jira/browse/SLING-5605
>             Project: Sling
>          Issue Type: Bug
>          Components: API
>    Affects Versions: API 2.11.0
>            Reporter: Konrad Windszus
>            Assignee: Carsten Ziegeler
>             Fix For: API 2.12.0
>
>
> Currently all methods being defined on {{org.apache.sling.api.servlets}} are 
> carrying the {{@Nonnull}} annotation 
> (https://github.com/apache/sling/blob/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java).
>  According to the implementation this is wrong and all three may return 
> {{null}} in case there was no appropriate servlet found 
> (https://github.com/apache/sling/blob/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java).
> The javadoc as well as the null annotations should be adjusted.



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

Reply via email to