Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
org.apache.felix.dependencymanager-r5
-
None
Description
There is a useless and wrong test in the ConfigurationDependencyImpl.updated() method:
// If this is initial settings, or a configuration update, we handle it synchronously. // We'll conclude that the dependency is available only if invoking updated did not cause // any ConfigurationException. Object[] instances = m_component.getInstances(); if (instances != null) { try { invokeUpdated(settings); } catch (ConfigurationException e) { logConfigurationException(e); throw e; } }
the "if (instances != null)" test is useless, and also wrong, but fortunately, it does not causes any problems.
Indeed, the m_component.getInstances() never returns null, and return an empty array when the component instance is not yet instantiated. This may happen when an instance callback is specified (like a Factory that needs the configuration before the Factory.create method is called).
Anyway, this test should be removed.