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

org.apache.felix.webconsole.internal.compendium.ConfigManager.listConfigurations(): ManagedServiceFactory instances are listed twice: with pid and factoryPid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • webconsole-1.2.0
    • Web Console
    • None

    Description

      ManagedServiceFactory instances are listed twice, with pid and factoryPid in org.apache.felix.webconsole.internal.compendium.ConfigManager.listConfigurations().

      The factoryPid will be added by the loop over the ServiceReference instances obtained from the framework for the type (class) ManagedServiceFactory:
      // find all ManagedServiceFactories to get the factoryPIDs
      ServiceReference[] refs = this.getBundleContext().getServiceReferences(ManagedServiceFactory.class.getName(), null );
      for ( int i = 0; refs != null && i < refs.length; i++ )

      Given that it is not removed from the map metaDataPids, it will also be added as "pid" by the loop:
      if ( !metaDataPids.isEmpty() )
      {
      for ( Iterator mdpi = metaDataPids.entrySet().iterator(); mdpi.hasNext(); )
      ....

      SVN revision 662145.

      A fix for this problem is to consistently remove the identifier from metaDataPids; this is done in some cases using:
      // remove from the list of known pids
      metaDataPids.remove( pid );

      Attachments

        1. webconsole.patch
          2 kB
          Pedro Pedruzzi

        Activity

          People

            fmeschbe Felix Meschberger
            wimpi Dieter Wimberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: