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

Konrad Windszus commented on SLING-12733:
-----------------------------------------

This is a follow up to SLING-10844. Why do we still have the guard with the 
isEmpty in the resource resolver then? [~cziegeler] Any idea?

> ResourceMapper.getMapping(...) may return null
> ----------------------------------------------
>
>                 Key: SLING-12733
>                 URL: https://issues.apache.org/jira/browse/SLING-12733
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Although all {{getMapping(...)}} methods in {{ResourceMapper}} have a 
> {{@NotNull}} annotation on the return value 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/mapping/ResourceMapper.java).
>  However the implementation may return null:
> https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/c73f8b5912a0dceef12b255e568e046450dc67de/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L71
> https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/c73f8b5912a0dceef12b255e568e046450dc67de/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L79
> IMHO this is reasonable so I would just propose to update the null annotation 
> here. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to