Felix was interpreting the spec such that bundles did not import from
themselves, but it appears that PackageAdmin should consider a bundle
that both exports and imports a package as being an importer of the
package even if it is selected as the exporter of the package. Previously,
Felix has been filtering out this scenario.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@423472 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
index a384d43..16cef73 100644
--- a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -2680,24 +2680,20 @@
{
BundleImpl importer = (BundleImpl) bundles[bundleIdx];
- // Ignore the bundle if it imports from itself.
- if (exporter != importer)
+ // Check the import wires of all modules for all bundles.
+ IModule[] modules = importer.getInfo().getModules();
+ for (int modIdx = 0; modIdx < modules.length; modIdx++)
{
- // Check the import wires of all modules for all bundles.
- IModule[] modules = importer.getInfo().getModules();
- for (int modIdx = 0; modIdx < modules.length; modIdx++)
+ R4Wire wire = Util.getWire(modules[modIdx], ep.getName());
+
+ // If the resolving module is associated with the
+ // exporting bundle, then add current bundle to
+ // import list.
+ if ((wire != null) && exporterInfo.hasModule(wire.getExportingModule()))
{
- R4Wire wire = Util.getWire(modules[modIdx], ep.getName());
-
- // If the resolving module is associated with the
- // exporting bundle, then add current bundle to
- // import list.
- if ((wire != null) && exporterInfo.hasModule(wire.getExportingModule()))
- {
- // Add the bundle to the list of importers.
- list.add(bundles[bundleIdx]);
- break;
- }
+ // Add the bundle to the list of importers.
+ list.add(bundles[bundleIdx]);
+ break;
}
}
}