mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Revert BindConverter changes that are now handled by Framework
See gh-28592 and spring-projects/spring-framework#28609 Closes gh-31343
This commit is contained in:
parent
2f40c52d81
commit
5d7cab09b8
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user