Skip to content

Commit 9136f54

Browse files
committed
Merge pull request spring-projects#19291 from dreis2211
* pr/19291: Simplify some Stream API usages Closes spring-projectsgh-19291
2 parents 5b92cd8 + b1158bf commit 9136f54

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class NamedContributorsMapAdapter<V, C> implements NamedContributors<C>
4343
NamedContributorsMapAdapter(Map<String, V> map, Function<V, ? extends C> valueAdapter) {
4444
Assert.notNull(map, "Map must not be null");
4545
Assert.notNull(valueAdapter, "ValueAdapter must not be null");
46-
map.keySet().stream().forEach((key) -> Assert.notNull(key, "Map must not contain null keys"));
46+
map.keySet().forEach((key) -> Assert.notNull(key, "Map must not contain null keys"));
4747
map.values().stream().map(valueAdapter)
4848
.forEach((value) -> Assert.notNull(value, "Map must not contain null values"));
4949
this.map = Collections.unmodifiableMap(new LinkedHashMap<>(map));

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleStatusAggregator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public SimpleStatusAggregator(List<String> order) {
6969

7070
@Override
7171
public Status getAggregateStatus(Set<Status> statuses) {
72-
return statuses.stream().filter(this::contains).sorted(this.comparator).findFirst().orElse(Status.UNKNOWN);
72+
return statuses.stream().filter(this::contains).min(this.comparator).orElse(Status.UNKNOWN);
7373
}
7474

7575
private boolean contains(Status status) {

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void customFeatures() {
9696
features.add(Feature.ONLY_WINDOWS_2008_SERVER);
9797
}
9898
load("spring.mongodb.embedded.features="
99-
+ String.join(", ", features.stream().map(Feature::name).collect(Collectors.toList())));
99+
+ features.stream().map(Feature::name).collect(Collectors.joining(", ")));
100100
assertThat(this.context.getBean(EmbeddedMongoProperties.class).getFeatures())
101101
.containsExactlyElementsOf(features);
102102
}

0 commit comments

Comments
 (0)