Use chars rather than strings
Update `SystemEnvironmentPropertyMapper` to use single chars rather than strings whenever possible. See gh-21523
This commit is contained in:
parent
de8970ec8e
commit
33deba4948
|
@ -58,7 +58,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < numberOfElements; i++) {
|
||||
if (result.length() > 0) {
|
||||
result.append("_");
|
||||
result.append('_');
|
||||
}
|
||||
result.append(name.getElement(i, Form.UNIFORM).toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
|||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < name.getNumberOfElements(); i++) {
|
||||
if (result.length() > 0) {
|
||||
result.append("_");
|
||||
result.append('_');
|
||||
}
|
||||
result.append(convertLegacyNameElement(name.getElement(i, Form.ORIGINAL)));
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper {
|
|||
}
|
||||
StringBuilder legacyCompatibleName = new StringBuilder();
|
||||
for (int i = 0; i < name.getNumberOfElements(); i++) {
|
||||
legacyCompatibleName.append((i != 0) ? "." : "");
|
||||
legacyCompatibleName.append((i != 0) ? '.' : "");
|
||||
legacyCompatibleName.append(name.getElement(i, Form.DASHED).replace('-', '.'));
|
||||
}
|
||||
return ConfigurationPropertyName.isValid(legacyCompatibleName)
|
||||
|
|
Loading…
Reference in New Issue