Skip to content

Commit

Permalink
Add fixes from suggestions, and cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cbridgha committed Jul 15, 2024
1 parent 0b4724f commit 88eb15a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1012,16 +1012,14 @@ private void reportErrors() throws RepositoryResolutionException {

List<String> missingBasePlatforms = new ArrayList<String>();

// 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));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public boolean isConvenience() {
*
* <ul><li>private</li>
* <li>do not have a short name</li>
* <li>contain ".eeCompatible-" or ".mpCompatible-" in their symbolic name.</li>
* <li>has a platform value</li>
* </ul>
*
* @return True or false telling if this is a versionless feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 88eb15a

Please sign in to comment.