service.ranking property not respected for singular service reference ---------------------------------------------------------------------
Key: FELIX-950 URL: https://issues.apache.org/jira/browse/FELIX-950 Project: Felix Issue Type: Bug Components: Declarative Services (SCR) Affects Versions: scr-1.0.6 Reporter: Felix Meschberger Assignee: Felix Meschberger Fix For: scr-1.0.8 For a service reference with singular cardinality (0..1 or 1..1), the service ranking has to be applied as per the service.ranking and service.id properties as defined in section 112.3.2, Reference Cardinality, of the OSGi Compendium Specification. Currently the service.ranking property is never obeyed resulting in the following non-conforming situations: * If a service is bound and a new service is registered with a higher service.ranking, the bound service is not replaced. Correct is to replace the bound service with the new service. * If multiple services are registered, the service with the highest ranking (or the lowest id for equal rankings) must be bound. Currently, the first service returned by BundleContext.getServiceReferences(String, String) is returned. Since this method is not specified to return the services in any order, the wrong service is almost certainly selected. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.