felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1589853 - /felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java
Date Thu, 24 Apr 2014 19:48:17 GMT
Author: rickhall
Date: Thu Apr 24 19:48:17 2014
New Revision: 1589853

URL: http://svn.apache.org/r1589853
Log:
Apply patch FELIX-4494 to fix improperly wrapped fragment capabilities.

Modified:
    felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java

Modified: felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java?rev=1589853&r1=1589852&r2=1589853&view=diff
==============================================================================
--- felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java (original)
+++ felix/trunk/resolver/src/main/java/org/apache/felix/resolver/Candidates.java Thu Apr 24
19:48:17 2014
@@ -31,6 +31,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import org.osgi.framework.Version;
 import org.osgi.framework.namespace.HostNamespace;
+import org.osgi.framework.namespace.IdentityNamespace;
 import org.osgi.framework.namespace.PackageNamespace;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
@@ -433,18 +434,23 @@ class Candidates
         {
             for (Capability fragCand : fragmentCands)
             {
+            	String fragCandName = fragCand.getNamespace();
+            	if (IdentityNamespace.IDENTITY_NAMESPACE.equals(fragCandName)) {
+            		// no need to wrap identity namespace ever
+            		continue;
+            	}
                 // Only necessary for resolved fragments.
                 Wiring wiring = rc.getWirings().get(fragCand.getResource());
                 if (wiring != null)
                 {
                     // Fragments only have host wire, so each wire represents
                     // an attached host.
-                    for (Wire wire : wiring.getRequiredResourceWires(null))
+                    for (Wire wire : wiring.getRequiredResourceWires(HostNamespace.HOST_NAMESPACE))
                     {
                         // If the capability is a package, then make sure the
                         // host actually provides it in its resolved capabilities,
                         // since it may be a substitutable export.
-                        if (!fragCand.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE)
+                        if (!fragCandName.equals(PackageNamespace.PACKAGE_NAMESPACE)
                             || rc.getWirings().get(wire.getProvider())
                                 .getResourceCapabilities(null).contains(fragCand))
                         {



Mime
View raw message