You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/08/07 05:06:00 UTC
[jira] [Commented] (ARIES-2241) SPI Fly ignores fragment ServiceLoader capabilities when the host declares the same capability namespace
[ https://issues.apache.org/jira/browse/ARIES-2241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102657#comment-18102657 ]
ASF subversion and git services commented on ARIES-2241:
--------------------------------------------------------
Commit 1020822442210185179028c196a53853f061bc9c in aries's branch refs/heads/trunk from Václav Haisman
[ https://gitbox.apache.org/repos/asf?p=aries.git;h=102082244 ]
ARIES-2241: Fix fragment ServiceLoader capability merging (#878)
Keep fragment contributions when the host declares the same capability namespace.
> 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
> Priority: Blocker
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> 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)