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

Konrad Windszus edited comment on SLING-12733 at 4/1/25 1:36 PM:
-----------------------------------------------------------------

Fixed with 
https://github.com/apache/sling-org-apache-sling-resourceresolver/commit/6b8c6e2dd3c08ec2c0365a77f0a6690237a467ad
 to throw instead of returning null.


was (Author: kwin):
Fixed with 
https://github.com/apache/sling-org-apache-sling-resourceresolver/commit/6b8c6e2dd3c08ec2c0365a77f0a6690237a467ad.

> ResourceMapper.getMapping(...) may return null
> ----------------------------------------------
>
>                 Key: SLING-12733
>                 URL: https://issues.apache.org/jira/browse/SLING-12733
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>            Reporter: Konrad Windszus
>            Priority: Major
>             Fix For: Resource Resolver 2.0.0
>
>
> 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