Skip to content

Commit b1e90fd

Browse files
committed
Merge pull request #16974 from izeye
* pr/16974: Use actual resolvedType when checking Binder cache
2 parents 2c364ce + e2f69d0 commit b1e90fd

File tree

1 file changed

+4
-4
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ public BeanSupplier<T> getSupplier(Bindable<T> target) {
192192
});
193193
}
194194

195-
private boolean isOfDifferentType(ResolvableType targetType) {
195+
private boolean isOfDifferentType(ResolvableType targetType,
196+
Class<?> resolvedType) {
196197
if (this.type.hasGenerics() || targetType.hasGenerics()) {
197198
return !this.type.equals(targetType);
198199
}
199-
return this.resolvedType == null
200-
|| !this.resolvedType.equals(targetType.resolve());
200+
return this.resolvedType == null || !this.resolvedType.equals(resolvedType);
201201
}
202202

203203
@SuppressWarnings("unchecked")
@@ -214,7 +214,7 @@ public static <T> Bean<T> get(Bindable<T> bindable, boolean canCallGetValue) {
214214
return null;
215215
}
216216
Bean<?> bean = Bean.cached;
217-
if (bean == null || bean.isOfDifferentType(type)) {
217+
if (bean == null || bean.isOfDifferentType(type, resolvedType)) {
218218
bean = new Bean<>(type, resolvedType);
219219
cached = bean;
220220
}

0 commit comments

Comments
 (0)