|
|
|
@ -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 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Object convertLegacyNameElement(String element) {
|
|
|
|
|
return element.replace("-", "_").toUpperCase();
|
|
|
|
|
return element.replace('-', '_').toUpperCase();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CharSequence processElementValue(CharSequence value) {
|
|
|
|
@ -104,9 +102,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|