Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5113

Remove useless wrong test in ConfigurationDependencyImpl

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            pderop Pierre De Rop
            pderop Pierre De Rop
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: