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

Konrad Windszus commented on SLING-5462:
----------------------------------------

[[email protected]] Actually your implementation is still wrong as the 
javadoc for {{ServiceReference.compareTo(...)}} says: 
{quote}
If this ServiceReference and the specified ServiceReference have the same 
service id they are equal. This ServiceReference is less than the specified 
ServiceReference if it has a lower service ranking and greater if it has a 
higher service ranking. Otherwise, if this ServiceReference and the specified 
ServiceReference have the same service ranking, this ServiceReference is less 
than the specified ServiceReference if it has a higher service id and greater 
if it has a lower service id. 
{quote}

Your compareTo is still wrong if the service id is equal! Please see the 
updated patch with commons.osgi 2.2. Still there are two tests failing, but I 
assume this is just the case because they are making wrong assumptions. Can you 
again have a look please?

> MockServiceReference sorts in the wrong way w.r.t. service ranking
> ------------------------------------------------------------------
>
>                 Key: SLING-5462
>                 URL: https://issues.apache.org/jira/browse/SLING-5462
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Testing OSGi Mock 2.0.0
>            Reporter: Bertrand Delacretaz
>            Assignee: Stefan Seifert
>            Priority: Minor
>         Attachments: SLING-5462-v01-failing-test.patch
>
>
> I'll add tests that demonstrate that, by comparing with the sorting done by a 
> real OSGi framework.



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

Reply via email to