Browse Source

Merge branch '2.6.x' into 2.7.x

Closes gh-31780
pull/32861/head
Stephane Nicoll 4 years ago
parent
commit
52d4dd9347
  1. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzer.java
  2. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzer.java
  3. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzer.java
  4. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java
  5. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java
  6. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -63,7 +63,7 @@ class BindFailureAnalyzer extends AbstractFailureAnalyzer<BindException> { @@ -63,7 +63,7 @@ class BindFailureAnalyzer extends AbstractFailureAnalyzer<BindException> {
private void buildDescription(StringBuilder description, ConfigurationProperty property) {
if (property != null) {
description.append(String.format("%n Property: %s", property.getName()));
description.append(String.format("%n Value: %s", property.getValue()));
description.append(String.format("%n Value: \"%s\"", property.getValue()));
description.append(String.format("%n Origin: %s", property.getOrigin()));
}
}

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -75,7 +75,7 @@ class BindValidationFailureAnalyzer extends AbstractFailureAnalyzer<Throwable> { @@ -75,7 +75,7 @@ class BindValidationFailureAnalyzer extends AbstractFailureAnalyzer<Throwable> {
private void appendFieldError(StringBuilder description, FieldError error) {
Origin origin = Origin.from(error);
description.append(String.format("%n Property: %s", error.getObjectName() + "." + error.getField()));
description.append(String.format("%n Value: %s", error.getRejectedValue()));
description.append(String.format("%n Value: \"%s\"", error.getRejectedValue()));
if (origin != null) {
description.append(String.format("%n Origin: %s", origin));
}

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -51,7 +51,7 @@ class UnboundConfigurationPropertyFailureAnalyzer @@ -51,7 +51,7 @@ class UnboundConfigurationPropertyFailureAnalyzer
private void buildDescription(StringBuilder description, ConfigurationProperty property) {
if (property != null) {
description.append(String.format("%n Property: %s", property.getName()));
description.append(String.format("%n Value: %s", property.getValue()));
description.append(String.format("%n Value: \"%s\"", property.getValue()));
description.append(String.format("%n Origin: %s", property.getOrigin()));
}
}

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

@ -101,7 +101,7 @@ class BindFailureAnalyzerTests { @@ -101,7 +101,7 @@ class BindFailureAnalyzerTests {
}
private static String failure(String property, String value, String origin, String reason) {
return String.format("Property: %s%n Value: %s%n Origin: %s%n Reason: %s", property, value, origin,
return String.format("Property: %s%n Value: \"%s\"%n Origin: %s%n Reason: %s", property, value, origin,
reason);
}

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -92,7 +92,7 @@ class BindValidationFailureAnalyzerTests { @@ -92,7 +92,7 @@ class BindValidationFailureAnalyzerTests {
}
private static String failure(String property, String value, String reason) {
return String.format("Property: %s%n Value: %s%n Reason: %s", property, value, reason);
return String.format("Property: %s%n Value: \"%s\"%n Reason: %s", property, value, reason);
}
private FailureAnalysis performAnalysis(Class<?> configuration, String... environment) {

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -63,7 +63,7 @@ class UnboundConfigurationPropertyFailureAnalyzerTests { @@ -63,7 +63,7 @@ class UnboundConfigurationPropertyFailureAnalyzerTests {
}
private static String failure(String property, String value, String origin, String reason) {
return String.format("Property: %s%n Value: %s%n Origin: %s%n Reason: %s", property, value, origin,
return String.format("Property: %s%n Value: \"%s\"%n Origin: %s%n Reason: %s", property, value, origin,
reason);
}

Loading…
Cancel
Save