Skip to content

Commit

Permalink
fix(kubernetes): Fix Optional ofNullable (#3265)
Browse files Browse the repository at this point in the history
The usages of Optional.of should be Optional.ofNullable.
  • Loading branch information
ezimanyi authored and mergify[bot] committed Oct 29, 2019
1 parent 2136674 commit e383297
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public BakeManifestContext(
@Nullable @JsonProperty("inputArtifact") CreateBakeManifestTask.InputArtifact inputArtifact,
@Nullable @JsonProperty("kustomizeFilePath") String kustomizeFilePath,
@JsonProperty("rawOverrides") Boolean rawOverrides) {
this.inputArtifacts = Optional.of(inputArtifacts).orElse(new ArrayList<>());
this.inputArtifacts = Optional.ofNullable(inputArtifacts).orElse(new ArrayList<>());
// Kustomize stage configs provide a single input artifact
if (this.inputArtifacts.isEmpty() && inputArtifact != null) {
this.inputArtifacts.add(inputArtifact);
}
this.expectedArtifacts = Optional.of(expectedArtifacts).orElse(new ArrayList<>());
this.expectedArtifacts = Optional.ofNullable(expectedArtifacts).orElse(new ArrayList<>());
this.overrides = overrides;
this.evaluateOverrideExpressions = evaluateOverrideExpressions;
this.templateRenderer = templateRenderer;
Expand Down

0 comments on commit e383297

Please sign in to comment.