FELIX-5187: Removed unnecessary null-check when using the logger.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1730332 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java b/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
index b92bf4b..1122d44 100644
--- a/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
+++ b/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
@@ -429,7 +429,7 @@
if (! callbackFound) {
String[] instanceClasses = Stream.of(instances).map(c -> c.getClass().getName()).toArray(String[]::new);
- log("\"" + m_add + "\" configuration callback not found in any of the component classes: " + Arrays.toString(instanceClasses));
+ m_logger.log(Logger.LOG_ERROR, "\"" + m_add + "\" configuration callback not found in any of the component classes: " + Arrays.toString(instanceClasses));
}
}
}
@@ -439,23 +439,8 @@
m_metaType = new MetaTypeProviderImpl(m_pid, m_context, m_logger, this, null);
}
}
-
- private void log(String msg) {
- if (m_logger != null) {
- m_logger.log(Logger.LOG_ERROR, msg);
- } else {
- System.err.println(msg);
- }
- }
-
+
private void logConfigurationException(ConfigurationException e) {
- if (m_logger != null) {
- m_logger.log(Logger.LOG_ERROR, "Got exception while handling configuration update for pid " + m_pid, e);
- } else {
- System.err.println("Got exception while handling configuration update for pid " + m_pid);
- if (e != null) {
- e.printStackTrace();
- }
- }
+ m_logger.log(Logger.LOG_ERROR, "Got exception while handling configuration update for pid " + m_pid, e);
}
}