You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2026/10/06 07:27:00 UTC
[jira] [Updated] (SLING-13326) incorrect results from ResourceResolver.getParentResourceType() cache
[ https://issues.apache.org/jira/browse/SLING-13326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Seifert updated SLING-13326:
-----------------------------------
Affects Version/s: Resource Resolver 1.12.18
Resource Resolver 2.0.6
> 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
> Affects Versions: Resource Resolver 2.0.6, Resource Resolver 1.12.18
> Reporter: Julian Sedding
> Assignee: Joerg Hoh
> Priority: Blocker
> 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)