Skip to content

Commit 7f4aaac

Browse files
tobias-lippertphilwebb
authored andcommitted
Simplify stream chain operations
See gh-39259
1 parent 15f1e85 commit 7f4aaac

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeDependencies.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ private boolean isAnUpgrade(Library library, DependencyVersion candidate) {
242242
}
243243

244244
private boolean isNotProhibited(Library library, DependencyVersion candidate) {
245-
return !library.getProhibitedVersions()
245+
return library.getProhibitedVersions()
246246
.stream()
247-
.anyMatch((prohibited) -> prohibited.isProhibited(candidate.toString()));
247+
.noneMatch((prohibited) -> prohibited.isProhibited(candidate.toString()));
248248
}
249249

250250
private List<Library> matchingLibraries() {

spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ void nativeImageArgFileWithExcludesIsWritten() throws Exception {
651651
expected.add("\\Q" + libraryTwo.getName() + "\\E");
652652
expected.add("^/META-INF/native-image/.*");
653653
assertThat(getPackagedEntryContent("META-INF/native-image/argfile"))
654-
.isEqualTo(expected.stream().collect(Collectors.joining("\n")) + "\n");
654+
.isEqualTo(String.join("\n", expected) + "\n");
655655
}
656656

657657
private File createLibraryJar() throws IOException {

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/junit/DisabledOnOsCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private ConditionEvaluationResult evaluate(DisabledOnOs annotation) {
5353
String architecture = System.getProperty("os.arch");
5454
String os = System.getProperty("os.name");
5555
boolean onDisabledOs = Arrays.stream(annotation.os()).anyMatch(OS::isCurrentOs);
56-
boolean onDisabledArchitecture = Arrays.stream(annotation.architecture()).anyMatch(architecture::equals);
56+
boolean onDisabledArchitecture = Arrays.asList(annotation.architecture()).contains(architecture);
5757
if (onDisabledOs && onDisabledArchitecture) {
5858
String reason = annotation.disabledReason().isEmpty()
5959
? String.format("Disabled on OS = %s, architecture = %s", os, architecture)

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/IncompatibleConfigurationFailureAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class IncompatibleConfigurationFailureAnalyzer extends AbstractFailureAnalyzer<I
3232
@Override
3333
protected FailureAnalysis analyze(Throwable rootFailure, IncompatibleConfigurationException cause) {
3434
String action = String.format("Review the docs for %s and change the configured values.",
35-
cause.getIncompatibleKeys().stream().collect(Collectors.joining(", ")));
35+
String.join(", ", cause.getIncompatibleKeys()));
3636
return new FailureAnalysis(cause.getMessage(), action, cause);
3737
}
3838

0 commit comments

Comments
 (0)