Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Whenever a referenced service is added to or removed from the framework, the DependencyManager.serviceAdded or serviceRemoved method is called respectively. These methods maintain a counter of services registered in the system matching the selection criteria (service interface and target filter) :
- when a service added whose ServiceReference does not match the target filter (if any) is ignored. Otherwise the internal
counter is incremented regardless of whether the service will actually be bound or not - when a service is removed it is ignored, if it is not bound. The internal counter is only decremented if the service is bound.
The problem is, that upon service removal the counter should be decremented if the service matches the target filter regardless of whether the service bound or not. Otherwise the counter might not be decremented and the dependency may be marked satisfied even though no (or not enough) service(s) are available.