diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java index ba0e921327..bd71752caf 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java @@ -96,7 +96,7 @@ public class ValidationErrors implements Iterable { private boolean isForError(ConfigurationPropertyName name, ConfigurationPropertyName boundPropertyName, FieldError error) { return name.isParentOf(boundPropertyName) - && boundPropertyName.getLastElement(Form.UNIFORM).toString() + && boundPropertyName.getLastElement(Form.UNIFORM) .equalsIgnoreCase(error.getField()); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index f621665692..7b8ac56812 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -283,8 +283,8 @@ public final class ConfigurationPropertyName } if (indexed1 && indexed2) { try { - long v1 = Long.parseLong(e1.toString()); - long v2 = Long.parseLong(e2.toString()); + long v1 = Long.parseLong(e1); + long v2 = Long.parseLong(e2); return Long.compare(v1, v2); } catch (NumberFormatException ex) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java index 1dfe8fbbe0..0873c2e3d3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java @@ -110,7 +110,7 @@ final class SystemEnvironmentPropertyMapper implements PropertyMapper { StringBuilder result = new StringBuilder(); for (int i = 0; i < numberOfElements; i++) { result.append(result.length() == 0 ? "" : "_"); - result.append(name.getElement(i, Form.UNIFORM).toString().toUpperCase()); + result.append(name.getElement(i, Form.UNIFORM).toUpperCase()); } return result.toString(); }