You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2007/01/29 18:41:29 UTC

svn commit: r501125 - /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java

Author: rickhall
Date: Mon Jan 29 09:41:28 2007
New Revision: 501125

URL: http://svn.apache.org/viewvc?view=rev&rev=501125
Log:
When checking for exported packages, it is necessary to filter out 
capabilities that do not represent package exports.

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?view=diff&rev=501125&r1=501124&r2=501125
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Mon Jan 29 09:41:28 2007
@@ -2623,22 +2623,25 @@
                 {
                     // See if the target bundle's module is one of the
                     // "in use" exporters of the package.
-                    R4SearchPolicyCore.ResolverCandidate[] inUseModules = m_policyCore.getInUseCandidates(
-                        new Requirement(
-                            ICapability.PACKAGE_NAMESPACE,
-                            null,
-                            null,
-                            new R4Attribute[] { new R4Attribute(ICapability.PACKAGE_PROPERTY, ((Capability) caps[capIdx]).getPackageName(), false) }),
-                        true);
-
-                    // Search through the current providers to find the target
-                    // module.
-                    for (int i = 0; (inUseModules != null) && (i < inUseModules.length); i++)
+                    if (caps[capIdx].getNamespace().equals(ICapability.PACKAGE_NAMESPACE))
                     {
-                        if (inUseModules[i].m_module == modules[modIdx])
+                        R4SearchPolicyCore.ResolverCandidate[] inUseModules = m_policyCore.getInUseCandidates(
+                            new Requirement(
+                                ICapability.PACKAGE_NAMESPACE,
+                                null,
+                                null,
+                                new R4Attribute[] { new R4Attribute(ICapability.PACKAGE_PROPERTY, ((Capability) caps[capIdx]).getPackageName(), false) }),
+                            true);
+    
+                        // Search through the current providers to find the target
+                        // module.
+                        for (int i = 0; (inUseModules != null) && (i < inUseModules.length); i++)
                         {
-                            list.add(new ExportedPackageImpl(
-                                this, bundle, modules[modIdx], (Capability) caps[capIdx]));
+                            if (inUseModules[i].m_module == modules[modIdx])
+                            {
+                                list.add(new ExportedPackageImpl(
+                                    this, bundle, modules[modIdx], (Capability) caps[capIdx]));
+                            }
                         }
                     }
                 }