When checking for exported packages, it is necessary to filter out
capabilities that do not represent package exports.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@501125 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index 104a7ae..f6f7f53 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -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]));
+ }
}
}
}