From 5d7cab09b86a9128d0ada45d9abe671d52465e71 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 14 Jun 2022 10:37:35 +0100 Subject: [PATCH] Revert BindConverter changes that are now handled by Framework See gh-28592 and spring-projects/spring-framework#28609 Closes gh-31343 --- .../boot/context/properties/bind/BindConverter.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java index 430270b89c..cdabe1d990 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java @@ -42,7 +42,6 @@ import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.ConditionalGenericConverter; import org.springframework.core.convert.support.GenericConversionService; -import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; /** @@ -107,10 +106,7 @@ final class BindConverter { for (ConversionService delegate : this.delegates) { try { if (delegate.canConvert(sourceType, targetType)) { - Object converted = delegate.convert(source, sourceType, targetType); - if (ClassUtils.isAssignableValue(targetType.getType(), converted)) { - return converted; - } + return delegate.convert(source, sourceType, targetType); } } catch (ConversionException ex) {