Skip to content

Commit d45910d

Browse files
committed
Merge pull request #12202 from dreis2211:match-polish
* pr/12202: Polish contribution Polish
2 parents 602f733 + 2641559 commit d45910d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@ private boolean hasConfigurationProcessorOnClasspath(JavaCompile compile) {
166166
Set<File> files = compile.getOptions().getAnnotationProcessorPath() != null
167167
? compile.getOptions().getAnnotationProcessorPath().getFiles()
168168
: compile.getClasspath().getFiles();
169-
return files.stream().map(File::getName)
170-
.filter((name) -> name.startsWith("spring-boot-configuration-processor"))
171-
.findFirst().isPresent();
169+
return files.stream().map(File::getName).anyMatch(
170+
(name) -> name.startsWith("spring-boot-configuration-processor"));
172171
}
173172

174173
private void configureAdditionalMetadataLocations(JavaCompile compile,

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.boot.context.properties.source;
1818

19-
import java.util.stream.IntStream;
20-
2119
import org.springframework.boot.context.properties.source.ConfigurationPropertyName.Form;
2220

2321
/**
@@ -95,7 +93,7 @@ private String convertLegacyName(ConfigurationPropertyName name) {
9593
}
9694

9795
private Object convertLegacyNameElement(String element) {
98-
return element.replace("-", "_").toUpperCase();
96+
return element.replace('-', '_').toUpperCase();
9997
}
10098

10199
private CharSequence processElementValue(CharSequence value) {
@@ -104,9 +102,7 @@ private CharSequence processElementValue(CharSequence value) {
104102
}
105103

106104
private static boolean isNumber(String string) {
107-
IntStream nonDigits = string.chars().filter((c) -> !Character.isDigit(c));
108-
boolean hasNonDigit = nonDigits.findFirst().isPresent();
109-
return !hasNonDigit;
105+
return string.chars().allMatch(Character::isDigit);
110106
}
111107

112108
}

0 commit comments

Comments
 (0)