Rollback an unintended commit from my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@694798 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Wire.java b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Wire.java
index 07ff41e..7085e59 100755
--- a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Wire.java
+++ b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Wire.java
@@ -88,24 +88,18 @@
if (m_capability.getNamespace().equals(ICapability.PACKAGE_NAMESPACE) &&
m_capability.getProperties().get(ICapability.PACKAGE_PROPERTY).equals(pkgName))
{
- // If the importer and the exporter are the same, then
- // just ask for the class from the exporting module's
- // content directly.
- if (m_exporter == m_importer)
+ // Before delegating to the exporting module to satisfy
+ // the class load, we must check the include/exclude filters
+ // from the target package to make sure that the class is
+ // actually visible. However, if the exporting module is the
+ // same as the requesting module, then filtering is not
+ // performed since a module has complete access to itself.
+ if ((m_exporter == m_importer) ||
+ (m_capability.getNamespace().equals(ICapability.PACKAGE_NAMESPACE) &&
+ ((Capability) m_capability).isIncluded(name)))
{
clazz = m_exporter.getContentLoader().getClass(name);
}
- // Otherwise, check the include/exclude filters from the target
- // package to make sure that the class is actually visible. In
- // this case since the importing and exporting modules are different,
- // we delegate to the exporting module, rather than its content,
- // so that it can follow any internal wires it may have (e.g.,
- // if the package has multiple sources).
- else if (m_capability.getNamespace().equals(ICapability.PACKAGE_NAMESPACE)
- && ((Capability) m_capability).isIncluded(name))
- {
- clazz = m_exporter.getClass(name);
- }
// If no class was found, then we must throw an exception
// since the exporter for this package did not contain the
@@ -187,4 +181,4 @@
}
return m_importer + " -> " + m_capability + " -> " + m_exporter;
}
-}
\ No newline at end of file
+}