docs: final void populateSPIInfo(BundleContext bundleContext, FeatureManager fm) {
  
          //if the bundleContext is null we aren't going to be able to do this
          if (bundleContext != null) {
  
              // We're going to rebuild new indices, so use local variables
              ProductPackages newPackageIndex = new ProductPackages();
  
              // For figuring out SPI information, we need the installed features and the kernel features.
              Collection<ProvisioningFeatureDefinition> allInstalledFeatures = fm.getInstalledFeatureDefinitions();
              allInstalledFeatures.addAll(KernelFeatureDefinitionImpl.getKernelFeatures(bundleContext, fm.getLocationService()));
  
              // For all installed features, get information about the declared product packages
              // and the declared osgi bundles..
              for (ProvisioningFeatureDefinition def : allInstalledFeatures) {
                  // Add package information to ProductPackages..
                  newPackageIndex.addPackages(def);
              }
  
              // compact the read-only index
              newPackageIndex.compact();
  
              // Replace the member variables with the new instances
              packageIndex = newPackageIndex;
          }
      }