diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index 8105cc4502f1..bf228281cdb7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -167,8 +167,7 @@ private boolean hasConfigurationProcessorOnClasspath(JavaCompile compile) { ? compile.getOptions().getAnnotationProcessorPath().getFiles() : compile.getClasspath().getFiles(); return files.stream().map(File::getName) - .filter((name) -> name.startsWith("spring-boot-configuration-processor")) - .findFirst().isPresent(); + .anyMatch((name) -> name.startsWith("spring-boot-configuration-processor")); } private void configureAdditionalMetadataLocations(JavaCompile compile, diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java index 0dd392f5b6a2..2b3faa4c074d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java @@ -16,8 +16,6 @@ package org.springframework.boot.context.properties.source; -import java.util.stream.IntStream; - import org.springframework.boot.context.properties.source.ConfigurationPropertyName.Form; /** @@ -95,7 +93,7 @@ private String convertLegacyName(ConfigurationPropertyName name) { } private Object convertLegacyNameElement(String element) { - return element.replace("-", "_").toUpperCase(); + return element.replace('-', '_').toUpperCase(); } private CharSequence processElementValue(CharSequence value) { @@ -104,9 +102,7 @@ private CharSequence processElementValue(CharSequence value) { } private static boolean isNumber(String string) { - IntStream nonDigits = string.chars().filter((c) -> !Character.isDigit(c)); - boolean hasNonDigit = nonDigits.findFirst().isPresent(); - return !hasNonDigit; + return string.chars().allMatch(Character::isDigit); } }