diff --git a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java index 47cd993efc0..f56f2a0c90d 100644 --- a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java +++ b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java @@ -21,6 +21,8 @@ import java.util.Map; import java.util.Map.Entry; +import org.osgi.framework.Version; + import com.ibm.ws.kernel.feature.Visibility; import com.ibm.ws.kernel.feature.provisioning.FeatureResource; import com.ibm.ws.kernel.feature.provisioning.ProvisioningFeatureDefinition; @@ -36,8 +38,6 @@ import com.ibm.ws.repository.resources.RepositoryResource; import com.ibm.ws.repository.resources.internal.RepositoryResourceImpl; -import junit.runner.Version; - /** * Implementation of {@link FeatureResolver.Repository} which is backed by a collection of {@link EsaResource}s. */ @@ -252,16 +252,21 @@ public ProvisioningFeatureDefinition getFeature(String featureName) { * @return List */ public List findAllPossibleVersions(ProvisioningFeatureDefinition versionlessFeature) { + ProvisioningFeatureDefinition publicFeature = null; List result = new ArrayList<>(); for (FeatureResource dependency : versionlessFeature.getConstituents(SubsystemContentType.FEATURE_TYPE)) { - result.add(getVersionedFeature(dependency.getSymbolicName())); - + publicFeature = getVersionedFeature(dependency.getSymbolicName()); + if (publicFeature != null) + result.add(publicFeature); + String baseName = getFeatureBaseName(dependency.getSymbolicName()); List tolerates = dependency.getTolerates(); if (tolerates != null) { for (String toleratedVersion : tolerates) { String featureName = baseName + toleratedVersion; - result.add(getVersionedFeature(featureName)); + publicFeature = getVersionedFeature(featureName); + if (publicFeature != null) + result.add(publicFeature); } } } @@ -286,11 +291,9 @@ private ProvisioningFeatureDefinition getVersionedFeature(String versionlessLink if (versionedFeatureDef.getVisibility() == Visibility.PUBLIC) { return versionedFeatureDef; } - result = versionedFeatureDef; - break; } } - return result; + return null; } /**