diff options
author | Thomas Watson | 2017-02-09 15:09:37 +0000 |
---|---|---|
committer | Thomas Watson | 2017-02-09 18:43:57 +0000 |
commit | f5262c4a0110dcc27aeb553e720e07e67a7e6ae2 (patch) | |
tree | dc6feeaaedb41acc535fb6177303a3b83b959d70 | |
parent | 4fa9c28f322c3691a43ac71663a735b3a2790e85 (diff) | |
download | rt.equinox.framework-f5262c4a0110dcc27aeb553e720e07e67a7e6ae2.tar.gz rt.equinox.framework-f5262c4a0110dcc27aeb553e720e07e67a7e6ae2.tar.xz rt.equinox.framework-f5262c4a0110dcc27aeb553e720e07e67a7e6ae2.zip |
Bug 511593 - Issue resolving split packagesS4_6_3_RC4S4_6_3_RC3S4_6_3_RC2R4_6_3M20170301-0400M20170228-0545M20170222-0400M20170215-0400M20170214-1550M20170214-0330M20170213-1455M20170213-0955M20170212-0800
Change solution to avoid introducing new API on ModuleWiring.
Change-Id: I1de1dd5ce55c05b04f9eaa699606ce70ba22ec89
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
6 files changed, 29 insertions, 55 deletions
diff --git a/bundles/org.eclipse.osgi/.settings/.api_filters b/bundles/org.eclipse.osgi/.settings/.api_filters deleted file mode 100644 index 882d258f9..000000000 --- a/bundles/org.eclipse.osgi/.settings/.api_filters +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<component id="org.eclipse.osgi" version="2"> - <resource path="META-INF/MANIFEST.MF"> - <filter comment="Bug 511593: Issue resolving split packages" id="924844039"> - <message_arguments> - <message_argument value="3.11.3"/> - <message_argument value="3.11.2"/> - </message_arguments> - </filter> - </resource> - <resource path="container/src/org/eclipse/osgi/container/ModuleWiring.java" type="org.eclipse.osgi.container.ModuleWiring"> - <filter comment="Bug 511593: Issue resolving split packages" id="1141899266"> - <message_arguments> - <message_argument value="3.12"/> - <message_argument value="3.11"/> - <message_argument value="getSubstitutionWires()"/> - </message_arguments> - </filter> - </resource> -</component> diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java index f07ff1475..38b8afca1 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java @@ -1502,6 +1502,11 @@ final class ModuleResolver { } adaptor.getResolverExecutor().execute(command); } + + @Override + public Collection<Wire> getSubstitutionWires(Wiring wiring) { + return ((ModuleWiring) wiring).getSubstitutionWires(); + } } protected boolean threadResolving() { 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 210b39916..bd8dede53 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 @@ -14,7 +14,6 @@ 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; @@ -29,7 +28,7 @@ import org.osgi.resource.*; * An implementation of {@link BundleWiring}. * @since 3.10 */ -public final class ModuleWiring implements BundleWiring, FelixWiring { +public final class ModuleWiring implements BundleWiring { class LoaderInitializer implements Callable<ModuleLoader> { @Override public ModuleLoader call() throws Exception { @@ -455,11 +454,7 @@ public final class ModuleWiring implements BundleWiring, FelixWiring { } } - /** - * @since 3.12 - */ - @Override - public Collection<Wire> getSubstitutionWires() { + Collection<Wire> getSubstitutionWires() { if (substitutedPkgNames.isEmpty()) { return Collections.emptyList(); } diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixResolveContext.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixResolveContext.java index 502a7e459..9782d0a02 100755 --- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixResolveContext.java +++ b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixResolveContext.java @@ -18,7 +18,11 @@ */package org.apache.felix.resolver; import java.util.Collection; + +import org.osgi.framework.namespace.PackageNamespace; import org.osgi.resource.Resource; +import org.osgi.resource.Wire; +import org.osgi.resource.Wiring; public interface FelixResolveContext { @@ -41,4 +45,19 @@ public interface FelixResolveContext * resources. The returned collection may be unmodifiable. */ public Collection<Resource> getOndemandResources(Resource host); + + /** + * Returns the subset of {@link Wiring#getRequiredResourceWires(String) require wires} + * that provide wires to {@link Capability capabilities} which substitute capabilities + * of the given wiring. For example, when a {@link PackageNamespace package} name is both + * provided and required by the same resource. If the package requirement is resolved + * to a capability hosted by a different wiring then the package capability is + * considered to be substituted. + * + * @param wiring the wiring to get the substitution wires from + * @return A collection containing a snapshot of the substitution {@link Wire}s + * for the {@link Requirement requirements} of this wiring, or an empty list + * if this wiring has no substitution wires. + */ + public Collection<Wire> getSubstitutionWires(Wiring wiring); } diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixWiring.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixWiring.java deleted file mode 100644 index ce453b029..000000000 --- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/FelixWiring.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */package org.apache.felix.resolver; - -import java.util.Collection; -import org.osgi.resource.Wire; - -public interface FelixWiring -{ - Collection<Wire> getSubstitutionWires(); -} diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java index 897b9698f..60beca879 100755 --- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java +++ b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java @@ -1608,9 +1608,10 @@ public class ResolverImpl implements Resolver if (wiring != null) { Collection<Wire> substitutionWires; - if (wiring instanceof FelixWiring) + if (session.getContext() instanceof FelixResolveContext) { - substitutionWires = ((FelixWiring) wiring).getSubstitutionWires(); + substitutionWires = ((FelixResolveContext) session.getContext()).getSubstitutionWires( + wiring); } else { |