You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2014/08/29 10:41:53 UTC
[jira] [Updated] (SLING-3896) TypeOverwritingResourceMapper does
not correctly implement the isResourceType method
[ https://issues.apache.org/jira/browse/SLING-3896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Konrad Windszus updated SLING-3896:
-----------------------------------
Description:
The TypeOverwritingResourceMapper is used, whenever the request dispatcher acts on the same resource but with a different resource type.
It just overwrites the methods getResourceType() and getResourceSuperType(). Unfortunately the method isResourceType() is not overwritten leading to the following behaviour:
I have a {{TypeOverwritingResourceMapper}} resource called "a" encapsulating a Resource with type "typeWrapped" and overwriting the type with "typeOverwritten":
Now {{ResourceResolver.isResourceType(a, "typeWrapped) == true}}, which is correct but {{a.isResourceType("typeWrapped") == false}} which is not correct!
The TypeOverwritingResourceMapper must overwrite also the method isResourceType, because otherwise it is called on the wrapped resource (and therefore considering the wrong resource type).
was:
The TypeOverwritingResourceMapper is used, whenever the request dispatcher acts on the same resource but with a different resource type.
It just overwrites the methods getResourceType() and getResourceSuperType(). Unfortunately the method isResourceType() is not overwritten leading to the following behaviour:
I have a {{TypeOverwritingResourceMapper}} resource called "a" encapsulating a Resource with type "typeWrapped" and overwriting the type with "typeOverwritten":
Now {{ResourceResolver.isResourceType(a, "typeWrapped) == true}}, which is correct but {{a.isResourceType("typeWrapped) == false}} which is not correct!
The TypeOverwritingResourceMapper must overwrite also the method isResourceType, because otherwise it is called on the wrapped resource (and therefore considering the wrong resource type).
> TypeOverwritingResourceMapper does not correctly implement the isResourceType method
> ------------------------------------------------------------------------------------
>
> Key: SLING-3896
> URL: https://issues.apache.org/jira/browse/SLING-3896
> Project: Sling
> Issue Type: Bug
> Components: Engine
> Affects Versions: Engine 2.3.2
> Reporter: Konrad Windszus
>
> The TypeOverwritingResourceMapper is used, whenever the request dispatcher acts on the same resource but with a different resource type.
> It just overwrites the methods getResourceType() and getResourceSuperType(). Unfortunately the method isResourceType() is not overwritten leading to the following behaviour:
> I have a {{TypeOverwritingResourceMapper}} resource called "a" encapsulating a Resource with type "typeWrapped" and overwriting the type with "typeOverwritten":
> Now {{ResourceResolver.isResourceType(a, "typeWrapped) == true}}, which is correct but {{a.isResourceType("typeWrapped") == false}} which is not correct!
> The TypeOverwritingResourceMapper must overwrite also the method isResourceType, because otherwise it is called on the wrapped resource (and therefore considering the wrong resource type).
--
This message was sent by Atlassian JIRA
(v6.2#6252)