// least one preferred provider exists, filter out all other candidates
// that are not also preferred providers.
Collection<BundleCapability> preferredProviders = new ArrayList<BundleCapability>(candidates.size());
for (BundleCapability candidate : candidates)
for (BasicSubsystem subsystem : requirers) {
PreferredProviderHeader header = subsystem.getSubsystemManifest().getPreferredProviderHeader();
if (header != null && (header.contains(candidate.getResource()) || isResourceConstituentOfPreferredSubsystem(candidate.getResource(), subsystem)))
preferredProviders.add(candidate);
}
if (!preferredProviders.isEmpty())
candidates.retainAll(preferredProviders);
}