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

Justin Edelson commented on SLING-5035:
---------------------------------------

IMHO, the linked JavaDoc is irrelevant as that describes the interpretation of 
ranking with respect to returning a single service when multiple are registered.

In any case, I can see the point about interpretations ranking as 'priority' 
and because there's no override option (first value wins), it is inverted in 
this case. However, the intention was that ranking here would be interpreted 
quite literally as order and that's what was done. If someone thinks the 
ranking is wrong (I.e. That ScriptBindings should be later), that's a different 
issue.

Unlike the Filter issue where we switch the ranking interpretation in a 
non-backwards compatible way, the documentation and implementation are aligned. 
There is no issue here.

> Sling Models Injectors should be queried in the reverse order of their 
> service ranking value
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-5035
>                 URL: https://issues.apache.org/jira/browse/SLING-5035
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Impl 1.2.2
>            Reporter: Radu Cotescu
>             Fix For: Sling Models Impl 1.2.4
>
>
> The current version of the {{ModelAdaptorFactory}} \[0\] queries the 
> Injectors in the ascending order of their service ranking value. However they 
> should be queried in the descending order of the service ranking, to use the 
> same logic as the {{BundleContext#getServiceReference(String)}} method \[1\].
> \[0\] - 
> https://github.com/apache/sling/blob/f56b444b765beb1c31eed01b4c09fbda4013a580/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java#L411
> \[1\] - 
> https://osgi.org/javadoc/r4v42/org/osgi/framework/BundleContext.html#getServiceReference(java.lang.String)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to