Skip to content

Commit

Permalink
Merge pull request #9971 from murdos/chore/optional-stream-idiom
Browse files Browse the repository at this point in the history
chore: simplify code by using Optional::stream
  • Loading branch information
pascalgrimaud authored Jun 2, 2024
2 parents fb5ca32 + 10708a2 commit dbb0529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ private Optional<JHipsterLandscapeDependencies> buildDependencies() {
modules()
.stream()
.map(JHipsterLandscapeModule::dependencies)
.filter(Optional::isPresent)
.map(Optional::get)
.flatMap(Optional::stream)
.flatMap(JHipsterLandscapeDependencies::stream)
.toList()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public DockerImageVersions get() {
.map(String::trim)
.map(String::toLowerCase)
.map(toDockerImage())
.filter(Optional::isPresent)
.map(Optional::get)
.flatMap(Optional::stream)
.toList();

return new DockerImageVersions(versionsRead);
Expand Down

0 comments on commit dbb0529

Please sign in to comment.