Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2017-02-03 16:11:57 +0000
committerThomas Watson2017-02-03 21:42:54 +0000
commitfcab3e35945c3d10db5b22838c1230c67afdaee2 (patch)
tree1dc34e838247a4200c7615eb54358343db3697f4 /bundles/org.eclipse.osgi/container
parentf9777863a046cb6516c5846f2d592ff6aa25fb15 (diff)
downloadrt.equinox.framework-fcab3e35945c3d10db5b22838c1230c67afdaee2.tar.gz
rt.equinox.framework-fcab3e35945c3d10db5b22838c1230c67afdaee2.tar.xz
rt.equinox.framework-fcab3e35945c3d10db5b22838c1230c67afdaee2.zip
Bug 511593 - Issue resolving split packagesI20170205-2000I20170204-2000I20170203-2000
The resolver implementation fix. Change-Id: I71384aec4decc0a7b009c5d48815ade3a8a4c010 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.osgi/container')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java27
1 files changed, 25 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
index 035bdffaf..201a26bd4 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2016 IBM Corporation and others.
+ * Copyright (c) 2012, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@ import java.net.URL;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.felix.resolver.FelixWiring;
import org.eclipse.osgi.container.ModuleRevisionBuilder.GenericInfo;
import org.eclipse.osgi.internal.container.AtomicLazyInitializer;
import org.eclipse.osgi.internal.container.InternalUtils;
@@ -28,7 +29,7 @@ import org.osgi.resource.*;
* An implementation of {@link BundleWiring}.
* @since 3.10
*/
-public final class ModuleWiring implements BundleWiring {
+public final class ModuleWiring implements BundleWiring, FelixWiring {
class LoaderInitializer implements Callable<ModuleLoader> {
@Override
public ModuleLoader call() throws Exception {
@@ -458,4 +459,26 @@ public final class ModuleWiring implements BundleWiring {
public String toString() {
return revision.toString();
}
+
+ /**
+ * @since 3.12
+ */
+ @Override
+ public Collection<Wire> getSubstitutionWires() {
+ if (substitutedPkgNames.isEmpty()) {
+ return Collections.emptyList();
+ }
+ // Could cache this, but seems unnecessary since it will only be used by the resolver
+ Collection<Wire> substitutionWires = new ArrayList<>(substitutedPkgNames.size());
+ List<ModuleWire> current = requiredWires;
+ for (ModuleWire wire : current) {
+ Capability cap = wire.getCapability();
+ if (PackageNamespace.PACKAGE_NAMESPACE.equals(cap.getNamespace())) {
+ if (substitutedPkgNames.contains(cap.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE))) {
+ substitutionWires.add(wire);
+ }
+ }
+ }
+ return substitutionWires;
+ }
}

Back to the top