Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
dependencymanager-3.2.0
-
None
Description
ComponentImpl#calculateServiceProperties() method overwrites implicitly defined service properties those coming from propagated dependencies.
addTo(properties, m_serviceProperties); for (int i = 0; i < m_dependencies.size(); i++) { Dependency d = (Dependency) m_dependencies.get(i); if (d.isPropagated() && d.isAvailable()) { Dictionary dict = d.getProperties(); addTo(properties, dict); } }
I think that it would be more appropriate to deal clashes so that service properties would be added AFTER dependency propagation inverting the overwrite. Traversal of dependencies should in my opinion be inverted as well.
for (int i = m_dependencies.size() - 1; i >= 0; i--) { Dependency d = (Dependency) m_dependencies.get(i); if (d.isPropagated() && d.isAvailable()) { Dictionary dict = d.getProperties(); addTo(properties, dict); } } addTo(properties, m_serviceProperties);
My use case involves Service PID which is currently overwritten by propagated dependencies. I'd turn off propagation but @AdapterService (and @AspectService) annotation is missing such option that @BundleAdapterService is providing. I can't work around the issue (without patching) while using annotations so I increased the priority accordingly.
Attachments
Issue Links
- is related to
-
FELIX-4600 Cherrypicking of propagated properties
- Closed