You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2015/07/21 12:56:04 UTC

[jira] [Closed] (SLING-4656) ProviderHandler implements compareTo incorreclty

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

Stefan Egli closed SLING-4656.
------------------------------

> ProviderHandler implements compareTo incorreclty
> ------------------------------------------------
>
>                 Key: SLING-4656
>                 URL: https://issues.apache.org/jira/browse/SLING-4656
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.2.4
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: Resource Resolver 1.2.6
>
>
> The implementation of the ResourceResolver's compareTo method is wrong as it favors services registered later over services registered earlier, while older services should actually be preferred (assuming there sevice.ranking values are equal). In essence it implements natural ServiceReference ordering instead of ranking order which is the inverse.
> Two options to fix:
> * Fix ProviderHandler.compareTo to implement service ranking and thus revers of natural ordering
> * Fix ResourceProviderEntry.conditionalSort to use a reverse comparator
> While at it, the extraction of the service.ranking property is overly complex since it first checks for null and then for the correct type. This can be simplified by just checking for the correct type as a null value never matches any type.



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