You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fall back to application conversion service in BindConverter
Previously, if a user declared a custom conversionService bean that
was not an ApplicationConversionService instance, the binder lost
the ability to convert a String to a Duration (along with any other
conversions that are specific to ApplicationConversionService).
This commit updates BindConverter so that, if the ConversionService
with which it is created is not an ApplicationConversionService, it
will use one as an additional service when performing conversion.
Closesgh-12237
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@
18
18
19
19
importjava.beans.PropertyEditorSupport;
20
20
importjava.io.File;
21
+
importjava.time.Duration;
21
22
importjava.util.List;
22
23
importjava.util.function.Consumer;
23
24
@@ -45,6 +46,7 @@
45
46
* Tests for {@link BindConverter}.
46
47
*
47
48
* @author Phillip Webb
49
+
* @author Andy Wilkinson
48
50
*/
49
51
publicclassBindConverterTests {
50
52
@@ -202,10 +204,17 @@ public void convertWhenConvertingToFileShouldExcludeFileEditor() {
0 commit comments