Improve error messages when the bundle context lookup failed (issue #Felix-555).
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@655961 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java
index 6e53c4a..c4a027f 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java
@@ -443,7 +443,7 @@
// getBundleContext (OSGi 4.1)
Method meth = null;
try {
- meth = bundle.getClass().getMethod("getBundleContext", new Class[0]);
+ meth = bundle.getClass().getMethod("getBundleContext", new Class[0]); // This method is public and is specified in the Bundle interface.
} catch (SecurityException e) {
// Nothing do to, will try the Equinox method
} catch (NoSuchMethodException e) {
@@ -490,10 +490,10 @@
try {
return (BundleContext) fields[i].get(bundle);
} catch (IllegalArgumentException e) {
- m_logger.log(Logger.ERROR, "Cannot get the BundleContext by invoking " + meth.getName(), e);
+ m_logger.log(Logger.ERROR, "Cannot get the BundleContext by invoking " + fields[i].getName(), e);
return null;
} catch (IllegalAccessException e) {
- m_logger.log(Logger.ERROR, "Cannot get the BundleContext by invoking " + meth.getName(), e);
+ m_logger.log(Logger.ERROR, "Cannot get the BundleContext by invoking " + fields[i].getName(), e);
return null;
}
}