Konrad Windszus created SLING-3896:
--------------------------------------

             Summary: 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)

Reply via email to