[
https://issues.apache.org/jira/browse/SLING-11757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680188#comment-17680188
]
Julian Reschke edited comment on SLING-11757 at 1/31/23 11:54 AM:
------------------------------------------------------------------
Some more thoughts:
- I'm not convinced that having a custom URI library here is a good idea - in
particular because MapEntries uses java.net.URL for the same purpose. The
inconsistency could couse strange bugs.
- We could "fix" URI not to return null.
- We could fix ResourceMapperImpl to handle null.
- We could also fix MapEntries to handle "scheme://x.y.z" to return "/" as
path, but that would yield different test results
was (Author: reschke):
Some more thoughts:
- I'm not convinced that having a custom URI library here is a good idea - in
particular because MapEntries uses java.net.URL for the same purpose. The
inconsistency could couse strange bugs.
- We could "fix" URI not to return null.
- We could fix ResourceMapperImpl to handle null.
- We could alsi fix MapEntries to handle "scheme://x.y.z" to return "/" as path
> resource resolver: pathless URL in vanity path causes NPE in
> ResourceMapperImpl.apply()
> ---------------------------------------------------------------------------------------
>
> Key: SLING-11757
> URL: https://issues.apache.org/jira/browse/SLING-11757
> Project: Sling
> Issue Type: Sub-task
> Components: ResourceResolver
> Reporter: Julian Reschke
> Assignee: Julian Reschke
> Priority: Major
>
> {noformat}
> java.lang.NullPointerException
> at java.lang.String.concat(String.java:2027)
> at
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl$ApplyContextPath.apply(ResourceMapperImpl.java:371)
> at
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl$ApplyContextPath.apply(ResourceMapperImpl.java:345)
> at java.util.ArrayList.replaceAll(ArrayList.java:1452)
> at
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl.getAllMappings(ResourceMapperImpl.java:171)
> at
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl.getMapping(ResourceMapperImpl.java:73)
> at
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImplTest$ExpectedMappings.verify(ResourceMapperImplTest.java:510)
> at
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImplTest.mapResourceWithVanityPathsURLTargetNoPath(ResourceMapperImplTest.java:402)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)