[ 
https://issues.apache.org/jira/browse/SLING-3876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Edelson updated SLING-3876:
----------------------------------

    Remaining Estimate: 0h
     Original Estimate: 0h

> SelfInjector is too aggressive
> ------------------------------
>
>                 Key: SLING-3876
>                 URL: https://issues.apache.org/jira/browse/SLING-3876
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Justin Edelson
>            Assignee: Justin Edelson
>              Labels: models
>             Fix For: Sling Models Implementation 1.0.8
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The service ranking of the self injector is currently 100. Since the only 
> restriction it has is based on class, this blocks any of the other standard 
> injectors from providing an object which has the same supertype as the 
> adaptable. For example, if you did:
> Resource someOtherResource = resourceResolver.getResource("/something");
> request.setAttribute("foo", someOtherResource);
> @Model(adaptable=Resource.class)
> public interface GettingFoo {
> @Inject @Named("foo")
> Resource getFooResource();
> }
> getFooResource() would return the adaptable, not the resource.
> I'll increase the service ranking to MAX_INTEGER as a first step, but this 
> might require something additional.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to