[ 
https://issues.apache.org/jira/browse/SLING-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254076#comment-13254076
 ] 

Felix Meschberger commented on SLING-2457:
------------------------------------------

> Is the fail-over from Resource.isResourceType to isAInternal really buying us 
> anything?
> Why not just modify the existing isA to use isResourceType?

>From AbstractResource.isResourceType:

        // Implemented calling the ResourceUtil.isA method (which actually has
        // the implementation) to prevent problems if there are implementations
        // of the pre-2.1.0 Resource interface in the framework.

If there happens to be an old Resource interface implementation, which does not 
implement the isResourceType method and does not extend from AbstractResource 
(which newer implementations should), and the providing bundle does not 
properly import the o.a.s.resource package with appropriate version ranges, 
calling Resource.isResourceType would result in an AbstractMethodError (we have 
seen that).
                
> ResourceUtil.isA() fails if resource has a type, whose super type is not 
> readable
> ---------------------------------------------------------------------------------
>
>                 Key: SLING-2457
>                 URL: https://issues.apache.org/jira/browse/SLING-2457
>             Project: Sling
>          Issue Type: Bug
>          Components: API
>    Affects Versions: API 2.2.0
>            Reporter: Tyson Norris
>
> * define a resource at /content/component/foo whose type is 
> myapp/components/bar
> * define bar at /apps/myapp/components/bar
> * on /apps/myapp/components/bar, set sling:resourceSuperType as 
> /libs/components/bar2
> If resolver from resource.getResourceResolver() cannot access 
> /libs/components/bar2, then ResouceUtil.isA(resource, "components/bar2") 
> returns false, otherwise it returns true.
> There could be an argument that it should not return true in any case, 
> however, if you set resourceSuperType on resource as "components/bar2", then 
> it returns true with current implementation. 
> At least one of these is wrong, I think. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to