Browse Source

Merge branch '2.6.x' into 2.7.x

Closes gh-31379
pull/31463/head
Andy Wilkinson 4 years ago
parent
commit
6de4ade0cf
  1. 6
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java

6
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; @@ -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 { @@ -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) {

Loading…
Cancel
Save