Skip to content

Polish #12202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Polish #12202

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}

}