Skip to content

Commit 69050a9

Browse files
committed
Merge branch '2.7.x'
Closes gh-31781
2 parents f52d00d + 52d4dd9 commit 69050a9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ private FailureAnalysis analyzeGenericBindException(BindException cause) {
6363
private void buildDescription(StringBuilder description, ConfigurationProperty property) {
6464
if (property != null) {
6565
description.append(String.format("%n Property: %s", property.getName()));
66-
description.append(String.format("%n Value: %s", property.getValue()));
66+
description.append(String.format("%n Value: \"%s\"", property.getValue()));
6767
description.append(String.format("%n Origin: %s", property.getOrigin()));
6868
}
6969
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private FailureAnalysis analyzeBindValidationException(ExceptionDetails details)
7575
private void appendFieldError(StringBuilder description, FieldError error) {
7676
Origin origin = Origin.from(error);
7777
description.append(String.format("%n Property: %s", error.getObjectName() + "." + error.getField()));
78-
description.append(String.format("%n Value: %s", error.getRejectedValue()));
78+
description.append(String.format("%n Value: \"%s\"", error.getRejectedValue()));
7979
if (origin != null) {
8080
description.append(String.format("%n Origin: %s", origin));
8181
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ private FailureAnalysis analyzeUnboundConfigurationPropertiesException(BindExcep
5151
private void buildDescription(StringBuilder description, ConfigurationProperty property) {
5252
if (property != null) {
5353
description.append(String.format("%n Property: %s", property.getName()));
54-
description.append(String.format("%n Value: %s", property.getValue()));
54+
description.append(String.format("%n Value: \"%s\"", property.getValue()));
5555
description.append(String.format("%n Origin: %s", property.getOrigin()));
5656
}
5757
}

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void bindExceptionDueToMapConversionFailure() {
100100
}
101101

102102
private static String failure(String property, String value, String origin, String reason) {
103-
return String.format("Property: %s%n Value: %s%n Origin: %s%n Reason: %s", property, value, origin,
103+
return String.format("Property: %s%n Value: \"%s\"%n Origin: %s%n Reason: %s", property, value, origin,
104104
reason);
105105
}
106106

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void otherBindExceptionShouldReturnAnalysis() {
9191
}
9292

9393
private static String failure(String property, String value, String reason) {
94-
return String.format("Property: %s%n Value: %s%n Reason: %s", property, value, reason);
94+
return String.format("Property: %s%n Value: \"%s\"%n Reason: %s", property, value, reason);
9595
}
9696

9797
private FailureAnalysis performAnalysis(Class<?> configuration, String... environment) {

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ void bindExceptionDueToUnboundElements() {
6363
}
6464

6565
private static String failure(String property, String value, String origin, String reason) {
66-
return String.format("Property: %s%n Value: %s%n Origin: %s%n Reason: %s", property, value, origin,
66+
return String.format("Property: %s%n Value: \"%s\"%n Origin: %s%n Reason: %s", property, value, origin,
6767
reason);
6868
}
6969

0 commit comments

Comments
 (0)