|
36 | 36 | import org.osgi.framework.Bundle; |
37 | 37 | import org.osgi.framework.Constants; |
38 | 38 | import org.osgi.framework.Version; |
39 | | -import org.osgi.framework.namespace.BundleNamespace; |
40 | | -import org.osgi.framework.namespace.ExecutionEnvironmentNamespace; |
41 | 39 | import org.osgi.framework.namespace.HostNamespace; |
42 | | -import org.osgi.framework.namespace.PackageNamespace; |
43 | | -import org.osgi.framework.wiring.BundleCapability; |
44 | 40 | import org.osgi.framework.wiring.BundleRequirement; |
45 | 41 | import org.osgi.framework.wiring.BundleRevision; |
46 | 42 | import org.osgi.framework.wiring.BundleWire; |
@@ -84,12 +80,7 @@ public enum Options { |
84 | 80 | * that define an {@link ICoreConstants#PLATFORM_FILTER} in their |
85 | 81 | * manifest. |
86 | 82 | */ |
87 | | - INCLUDE_EXTENSIBLE_FRAGMENTS, |
88 | | - /** |
89 | | - * Option that can be set to exclude generic capabilities on which the |
90 | | - * bundle depends. |
91 | | - */ |
92 | | - EXCLUDE_REQUIRED_CAPABILITY; |
| 83 | + INCLUDE_EXTENSIBLE_FRAGMENTS; |
93 | 84 | } |
94 | 85 |
|
95 | 86 | /** |
@@ -186,7 +177,6 @@ public static Set<BundleDescription> findRequirementsClosure(Collection<BundleDe |
186 | 177 | Options... options) { |
187 | 178 |
|
188 | 179 | Set<Options> optionSet = Set.of(options); |
189 | | - boolean excludeGenericRequiredCapability = optionSet.contains(Options.EXCLUDE_REQUIRED_CAPABILITY); |
190 | 180 | boolean includeOptional = optionSet.contains(Options.INCLUDE_OPTIONAL_DEPENDENCIES); |
191 | 181 | boolean includeAllFragments = optionSet.contains(Options.INCLUDE_ALL_FRAGMENTS); |
192 | 182 | boolean includeNonTestFragments = optionSet.contains(Options.INCLUDE_NON_TEST_FRAGMENTS); |
@@ -252,19 +242,7 @@ public static Set<BundleDescription> findRequirementsClosure(Collection<BundleDe |
252 | 242 | // not included into the closure. |
253 | 243 | continue; |
254 | 244 | } |
255 | | - BundleCapability capability = wire.getCapability(); |
256 | | - if (excludeGenericRequiredCapability) { |
257 | | - String namespace = capability.getNamespace(); |
258 | | - if (!BundleNamespace.BUNDLE_NAMESPACE.equals(namespace) |
259 | | - && !PackageNamespace.PACKAGE_NAMESPACE.equals(namespace) |
260 | | - && !HostNamespace.HOST_NAMESPACE.equals(namespace) |
261 | | - && !ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE.equals(namespace)) { |
262 | | - // If it is not one of the framework namespaces it is a |
263 | | - // generic one see https://docs.osgi.org/specification/osgi.core/8.0.0/framework.namespaces.html |
264 | | - continue; |
265 | | - } |
266 | | - } |
267 | | - BundleRevision provider = capability.getRevision(); |
| 245 | + BundleRevision provider = wire.getCapability().getRevision(); |
268 | 246 | // Use revision of required capability to support the case if |
269 | 247 | // fragments contribute new packages to their host's API. |
270 | 248 | if (provider instanceof BundleDescription requiredBundle && (includeOptional || !isOptional(wire.getRequirement()))) { |
|
0 commit comments