Skip to content

Commit 380776a

Browse files
committed
Merge branch '2.7.x'
2 parents 8937924 + 7bf82b5 commit 380776a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.springframework.core.convert.TypeDescriptor;
4343
import org.springframework.core.convert.converter.ConditionalGenericConverter;
4444
import org.springframework.core.convert.support.GenericConversionService;
45+
import org.springframework.util.ClassUtils;
4546
import org.springframework.util.CollectionUtils;
4647

4748
/**
@@ -107,7 +108,7 @@ private Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor
107108
try {
108109
if (delegate.canConvert(sourceType, targetType)) {
109110
Object converted = delegate.convert(source, sourceType, targetType);
110-
if (targetType.getType().isInstance(converted)) {
111+
if (ClassUtils.isAssignableValue(targetType.getType(), converted)) {
111112
return converted;
112113
}
113114
}

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/WithPublicObjectToObjectMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ public static Optional<WithPublicObjectToObjectMethod> from(String value) {
4040
return Optional.of(new WithPublicObjectToObjectMethod(value));
4141
}
4242

43-
}
43+
}

0 commit comments

Comments
 (0)