[
https://issues.apache.org/jira/browse/SLING-13326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joerg Hoh reassigned SLING-13326:
---------------------------------
Assignee: Joerg Hoh
> incorrect results from ResourceResolver.getParentResourceType() cache
> ----------------------------------------------------------------------
>
> Key: SLING-13326
> URL: https://issues.apache.org/jira/browse/SLING-13326
> Project: Sling
> Issue Type: Bug
> Components: ResourceResolver
> Reporter: Julian Sedding
> Assignee: Joerg Hoh
> Priority: Major
> Fix For: Resource Resolver 2.0.8, Resource Resolver 1.12.20
>
>
> The cache for {{ResourceResolver.getParentResourceType()}} calls uses
> {{Resource.getPath()}} as the key. However, it is commonplace, e.g. in Sling
> Models, to wrap/decorate a resource in order to override its resource-type.
> In this case, the path does not change, but the result of
> {{ResourceResolver.getParentResourceType()}} needs to reflect the changed
> resource-type.
> This can lead to endless recursion for a scenario similar to the following
> {noformat}
> # given the following resource-type hierarchy
> # foo/pages/special
> # \_ foo/pages/base
> # \_ generic/pages/page
> ResourceResolver rr
> Resource resource = Resource(/content/foo, foo/pages/special)
> assert rr.getParentResourceType(resource) == foo/pages/base
> Resource decorated = Resource(resource, foo/pages/base)
> assert rr.getParentResourceType(resource) == generic/pages/page // fails,
> because it is foo/pages/base{noformat}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)