You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2025/04/01 13:12:00 UTC

[jira] [Updated] (SLING-12733) ResourceMapper.getMapping(...) may return null

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

Konrad Windszus updated SLING-12733:
------------------------------------
    Component/s: ResourceResolver
                     (was: API)

> 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
>
> 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)