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

Stefan Seifert resolved SLING-7194.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: API 2.16.6

fixed
https://github.com/apache/sling-org-apache-sling-api/commit/ec3dcf291b26e833b07a1f9c485bbe713a7ad4d5
https://github.com/apache/sling-site/commit/eb11261775a8766b2a456c62652bb9c3a0803950

> Document that AdapterManager sorts AdapterFactory implementations lowest 
> ranking first
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-7194
>                 URL: https://issues.apache.org/jira/browse/SLING-7194
>             Project: Sling
>          Issue Type: Task
>          Components: Extensions
>    Affects Versions: API 2.16.4
>            Reporter: Stefan Seifert
>            Assignee: Stefan Seifert
>            Priority: Minor
>             Fix For: API 2.16.6
>
>
> the current implementation of AdapterManager uses a 
> AdapterFactoryDescriptorMap to sort the AdapterFactory implementations found.
> this is done using a TreeMap with the ServiceReference as key. 
> ServiceReference implements a compareTo.
> according to its documentation the default implementation sorts with 
> service-ranking lowest-first/service id highest-first:
> https://osgi.org/javadoc/r6/core/org/osgi/framework/ServiceReference.html#compareTo(java.lang.Object)
> when picking a service from multiple ones using BundleContext.getService, the 
> service with hightest service ranking/lowest service id is returned.
> i would expect the same from the AdapterManager implementation - if multiple 
> implementations match pick that one with highest ranking/lowest service id.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to