You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (Jira)" <ji...@apache.org> on 2021/11/12 11:04:00 UTC
[jira] [Closed] (SLING-9850) Clarify null return values for
ResourceResolver.map(...)
[ https://issues.apache.org/jira/browse/SLING-9850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler closed SLING-9850.
-----------------------------------
> Clarify null return values for ResourceResolver.map(...)
> --------------------------------------------------------
>
> Key: SLING-9850
> URL: https://issues.apache.org/jira/browse/SLING-9850
> Project: Sling
> Issue Type: Improvement
> Components: API
> Affects Versions: API 2.23.0
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
> Priority: Major
> Fix For: API 2.24.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Currently the two signatures of {{map}} differ by their null return annotation:
> - https://github.com/apache/sling-org-apache-sling-api/blob/3e9cf187eff999235ee161e0543f1d8a68c4285c/src/main/java/org/apache/sling/api/resource/ResourceResolver.java#L294 (must not return null)
> and
> - https://github.com/apache/sling-org-apache-sling-api/blob/3e9cf187eff999235ee161e0543f1d8a68c4285c/src/main/java/org/apache/sling/api/resource/ResourceResolver.java#L332 (may return null)
> The implementation of both may return null though in fact, IIU
> https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/657055bcb31059dc7b71cde55941fb2050cbaddb/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java#L40, https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/657055bcb31059dc7b71cde55941fb2050cbaddb/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java#L420 and https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/657055bcb31059dc7b71cde55941fb2050cbaddb/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L75 correctly.
> The javadoc for both methods should be clarified with regards to when to expect a null value and most probably the null annotations need to be fixed as well.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)