Merge branch '2.6.x' into 2.7.x

pull/31463/head
Phillip Webb 2 years ago
commit 7bf82b5349

@ -42,6 +42,7 @@ import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.ConditionalGenericConverter; import org.springframework.core.convert.converter.ConditionalGenericConverter;
import org.springframework.core.convert.support.GenericConversionService; import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
/** /**
@ -107,7 +108,7 @@ final class BindConverter {
try { try {
if (delegate.canConvert(sourceType, targetType)) { if (delegate.canConvert(sourceType, targetType)) {
Object converted = delegate.convert(source, sourceType, targetType); Object converted = delegate.convert(source, sourceType, targetType);
if (targetType.getType().isInstance(converted)) { if (ClassUtils.isAssignableValue(targetType.getType(), converted)) {
return converted; return converted;
} }
} }

Loading…
Cancel
Save