mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish
See gh-11181
This commit is contained in:
parent
bae6b3115e
commit
2bd8c2bfca
@ -75,7 +75,9 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
||||
private String convertName(ConfigurationPropertyName name, int numberOfElements) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < numberOfElements; i++) {
|
||||
result.append(result.length() == 0 ? "" : "_");
|
||||
if (result.length() > 0) {
|
||||
result.append("_");
|
||||
}
|
||||
result.append(name.getElement(i, Form.UNIFORM).toUpperCase());
|
||||
}
|
||||
return result.toString();
|
||||
@ -84,7 +86,9 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
||||
private String convertLegacyName(ConfigurationPropertyName name) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < name.getNumberOfElements(); i++) {
|
||||
result.append(result.length() == 0 ? "" : "_");
|
||||
if (result.length() > 0) {
|
||||
result.append("_");
|
||||
}
|
||||
result.append(convertLegacyNameElement(name.getElement(i, Form.ORIGINAL)));
|
||||
}
|
||||
return result.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user