Skip to content

Commit 8580483

Browse files
committed
SerializableTypeWrapper reobtains type accessors from declaring interface
Issue: SPR-14487
1 parent aaac199 commit 8580483

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-core/src/main/java/org/springframework/core/SerializableTypeWrapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ static class MethodInvokeTypeProvider implements TypeProvider {
372372

373373
private final String methodName;
374374

375+
private final Class<?> declaringClass;
376+
375377
private final int index;
376378

377379
private transient Method method;
@@ -381,6 +383,7 @@ static class MethodInvokeTypeProvider implements TypeProvider {
381383
public MethodInvokeTypeProvider(TypeProvider provider, Method method, int index) {
382384
this.provider = provider;
383385
this.methodName = method.getName();
386+
this.declaringClass = method.getDeclaringClass();
384387
this.index = index;
385388
this.method = method;
386389
}
@@ -404,7 +407,7 @@ public Object getSource() {
404407

405408
private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException {
406409
inputStream.defaultReadObject();
407-
this.method = ReflectionUtils.findMethod(this.provider.getType().getClass(), this.methodName);
410+
this.method = ReflectionUtils.findMethod(this.declaringClass, this.methodName);
408411
Assert.state(Type.class == this.method.getReturnType() || Type[].class == this.method.getReturnType());
409412
}
410413
}

0 commit comments

Comments
 (0)