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

Robert Munteanu commented on SLING-10844:
-----------------------------------------

[~AdityaSeth] - tests run fine for me, with latest master 
{{org.apache.sling.resourceresolver-1.8.0-2-g9554ba2}} and 

{noformat}$ mvn -v
Apache Maven 3.8.1 (SUSE 3.8.1-3.2)
Maven home: /usr/share/maven
Java version: 11.0.13, vendor: Oracle Corporation, runtime: 
/usr/lib64/jvm/java-11-openjdk-11
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.7-1-default", arch: "amd64", family: "unix"
{noformat}

I execute then with {{mvn clean verify}}. 

> ResourceMapper.getMapping() returns null for empty path
> -------------------------------------------------------
>
>                 Key: SLING-10844
>                 URL: https://issues.apache.org/jira/browse/SLING-10844
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.7.0
>            Reporter: Mohit Arora
>            Assignee: Robert Munteanu
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> After the bug fix for SLING-9620, the behavior for 
> ResourceMapper.getAllMappings() was changed such that the mappings list 
> remains empty if the resourcePath provided is an empty string. Prior to this 
> bug fix, the mappings list contained a single entry for empty path.
> Since mappings list is empty, [ResourceMapper.getMapping() returns 
> null|https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L74-L75].
>  The [javadoc of 
> ResourceMapper.getMapping()|https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/mapping/ResourceMapper.java#L67]
>  API mentions that it will return a non null value if the resourcepath is not 
> null.
> We need to decide on the expected behavior here. If mappings list should not 
> be updated in case of empty resourcePath then the API annotation will have to 
> be changed and it can potentially be a backwards incompatible issue in theory 
> as the consumers of the API may not have added a null check to the return 
> value.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to