Václav Haisman created ARIES-2241:
-------------------------------------
Summary: SPI Fly ignores fragment ServiceLoader capabilities when
the host declares the same capability namespace
Key: ARIES-2241
URL: https://issues.apache.org/jira/browse/ARIES-2241
Project: Aries
Issue Type: Bug
Components: SPI Fly
Affects Versions: spifly-1.3.7
Reporter: Václav Haisman
h3. Description
SPI Fly does not preserve ServiceLoader capability contributions from fragments
when the host bundle declares a capability in the same namespace.
{{ProviderBundleTrackerCustomizer}} parses the host and fragment headers into
separate bnd {{Parameters}} collections. Both collections assign the first
clause the same base key, such as {{osgi.serviceloader}}. Combining them with
{{Parameters.mergeWith(..., false)}} treats the fragment clause as a duplicate
and retains the host attributes, silently discarding the fragment contribution.
The fragment-processing loop can also return after the first fragment
containing a matching header, so contributions from additional attached
fragments are not considered.
h3. Steps to reproduce
# Create a host bundle that declares an {{osgi.serviceloader}} capability.
# Attach a fragment that declares another {{osgi.serviceloader}} capability and
supplies its provider through {{META-INF/services}}.
# Start the bundles with the SPI Fly mediator enabled.
h3. Actual result
Only the host capability is processed. The provider contributed by the fragment
is not registered or discoverable. Contributions from later fragments may also
be omitted.
h3. Expected result
All matching capability clauses from the host and every attached fragment are
processed independently, including clauses using the same capability namespace.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)