Skip to content

Commit

Permalink
Fix GAL-359, Handling of null stability level
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Mar 26, 2024
1 parent bf5ab18 commit ff882fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public FeaturePackRuntime transform(FeaturePackRuntimeBuilder other) throws Prov
}

public String getLowestConfigStability() {
return lowestConfigStability.toString();
return lowestConfigStability == null ? null : lowestConfigStability.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ private ProvisioningRuntime doBuild() throws ProvisioningException {
packageStabilityOption = stabilityOption;
}
if (configStabilityOption == null) {
Stability stability = Stability.DEFAULT;
Stability stability = null;
for (FeaturePackRuntimeBuilder fp : layout.getOrderedFeaturePacks()) {
Stability fpStability = fp.getSpec().getConfigStability();
if (stability == null || (fpStability.ordinal() > stability.ordinal())) {
if (stability == null || (fpStability != null && (fpStability.ordinal() > stability.ordinal()))) {
stability = fpStability;
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@ private ProvisioningRuntime doBuild() throws ProvisioningException {
* given feature-pack. The stability set by the user can only reduce the scope.
*/
public Stability getMinConfigStability(Stability featurePackStability) {
Stability minStability= featurePackStability;
Stability minStability= featurePackStability == null ? Stability.DEFAULT : featurePackStability;
if (getUserConfigStability() != null) {
if (minStability.enables(getUserConfigStability())) {
minStability = getUserConfigStability();
Expand All @@ -300,7 +300,7 @@ public Stability getMinConfigStability(Stability featurePackStability) {
* given feature-pack. The stability set by the user can only reduce the scope.
*/
public Stability getMinPackageStability(Stability featurePackStability) {
Stability minStability= featurePackStability;
Stability minStability= featurePackStability == null ? Stability.DEFAULT : featurePackStability;
if (getUserPackageStability() != null) {
if (minStability.enables(getUserPackageStability())) {
minStability = getUserPackageStability();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ protected FeaturePackSpec(Builder builder) throws ProvisioningDescriptionExcepti
this.patchFor = builder.patchFor;
this.systemPaths = CollectionUtils.unmodifiable(builder.systemPaths);
this.galleonMinVersion = builder.galleonMinVersion;
this.configStability = builder.configStability == null ? Stability.DEFAULT : builder.configStability;
this.packageStability = builder.packageStability == null ? Stability.DEFAULT : builder.packageStability;
this.configStability = builder.configStability == null ? null : builder.configStability;
this.packageStability = builder.packageStability == null ? null : builder.packageStability;
}

public String getGalleonMinVersion() {
Expand Down

0 comments on commit ff882fc

Please sign in to comment.