felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1199131 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Date Tue, 08 Nov 2011 07:03:53 GMT
Author: rickhall
Date: Tue Nov  8 07:03:53 2011
New Revision: 1199131

URL: http://svn.apache.org/viewvc?rev=1199131&view=rev
Log:
Make sure we wrap capabilities pulled from BundleWiring when calculating
package sources. (FELIX-3178)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java?rev=1199131&r1=1199130&r2=1199131&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Tue Nov  8 07:03:53 2011
@@ -1391,12 +1391,22 @@ public class ResolverImpl implements Res
             List<BundleCapability> caps = (cap.getRevision().getWiring() != null)
                 ? cap.getRevision().getWiring().getCapabilities(null)
                 : cap.getRevision().getDeclaredCapabilities(null);
-            for (int capIdx = 0; capIdx < caps.size(); capIdx++)
+            for (BundleCapability sourceCap : caps)
             {
-                if (caps.get(capIdx).getNamespace().equals(BundleRevision.PACKAGE_NAMESPACE)
-                    && caps.get(capIdx).getAttributes().get(BundleRevision.PACKAGE_NAMESPACE).equals(pkgName))
+                if (sourceCap.getNamespace().equals(BundleRevision.PACKAGE_NAMESPACE)
+                    && sourceCap.getAttributes().get(BundleRevision.PACKAGE_NAMESPACE).equals(pkgName))
                 {
-                    sources.add(caps.get(capIdx));
+                    // Since capabilities may come from fragments, we need to check
+                    // for that case and wrap them.
+                    if (!cap.getRevision().equals(sourceCap.getRevision()))
+                    {
+                        sources.add(
+                            new HostedCapability(cap.getRevision(), (BundleCapabilityImpl)
sourceCap));
+                    }
+                    else
+                    {
+                        sources.add(sourceCap);
+                    }
                 }
             }
 



Mime
View raw message