From 88eb15a84fbb25936992a0bbf0624855e25fd59d Mon Sep 17 00:00:00 2001 From: Chuck Bridgham Date: Mon, 15 Jul 2024 12:21:44 -0400 Subject: [PATCH] Add fixes from suggestions, and cleanup comments --- .../resolver/RepositoryResolver.java | 18 ++++++++---------- .../internal/kernel/KernelResolverEsa.java | 2 +- .../kernel/KernelResolverRepository.java | 9 +++++---- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java index 56b44028e8ca..f0ccc794935d 100755 --- a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java +++ b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java @@ -1012,16 +1012,14 @@ private void reportErrors() throws RepositoryResolutionException { List missingBasePlatforms = new ArrayList(); - // Versionless feature issues - if (!missingTopLevelRequirements.isEmpty()) { - for (String name : missingTopLevelRequirements) { - ProvisioningFeatureDefinition feature = resolverRepository.getFeature(name); - if (feature != null && feature.isVersionless()) { - ProvisioningFeatureDefinition firstChild = resolverRepository.findAllPossibleVersions(feature).get(0); - String plat = firstChild.getPlatformName(); - if (plat != null && plat.indexOf("-") != -1) { - missingBasePlatforms.add(resolverRepository.getFeatureBaseName(plat)); - } + // Versionless feature issues will appear in missingTopLevelRequirements, and this will gather the associated platform unable to target. + for (String name : missingTopLevelRequirements) { + ProvisioningFeatureDefinition feature = resolverRepository.getFeature(name); + if (feature != null && feature.isVersionless()) { + ProvisioningFeatureDefinition firstChild = resolverRepository.findAllPossibleVersions(feature).get(0); + String plat = firstChild.getPlatformName(); + if (plat != null) {//This will add just the platform name without version + missingBasePlatforms.add(resolverRepository.getFeatureBaseName(plat)); } } } diff --git a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverEsa.java b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverEsa.java index 8a9ed9294b46..857b965f55ef 100644 --- a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverEsa.java +++ b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverEsa.java @@ -283,7 +283,7 @@ public boolean isConvenience() { * *
  • private
  • *
  • do not have a short name
  • - *
  • contain ".eeCompatible-" or ".mpCompatible-" in their symbolic name.
  • + *
  • has a platform value
  • *
* * @return True or false telling if this is a versionless feature. 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 fe3fc5c78fa3..47cd993efc0c 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,8 +21,6 @@ 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; @@ -38,6 +36,8 @@ 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. */ @@ -283,10 +283,11 @@ private ProvisioningFeatureDefinition getVersionedFeature(String versionlessLink for (FeatureResource versionedFeature : feature.getConstituents(SubsystemContentType.FEATURE_TYPE)) { //Find the right public feature (should only be one) - set the result ProvisioningFeatureDefinition versionedFeatureDef = getFeature(versionedFeature.getSymbolicName()); - if (versionedFeatureDef.getVisibility() != Visibility.PUBLIC) { - continue; + if (versionedFeatureDef.getVisibility() == Visibility.PUBLIC) { + return versionedFeatureDef; } result = versionedFeatureDef; + break; } } return result;