1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -372,6 +372,8 @@ static class MethodInvokeTypeProvider implements TypeProvider {
372
372
373
373
private final String methodName ;
374
374
375
+ private final Class <?> declaringClass ;
376
+
375
377
private final int index ;
376
378
377
379
private transient Method method ;
@@ -381,6 +383,7 @@ static class MethodInvokeTypeProvider implements TypeProvider {
381
383
public MethodInvokeTypeProvider (TypeProvider provider , Method method , int index ) {
382
384
this .provider = provider ;
383
385
this .methodName = method .getName ();
386
+ this .declaringClass = method .getDeclaringClass ();
384
387
this .index = index ;
385
388
this .method = method ;
386
389
}
@@ -404,7 +407,7 @@ public Object getSource() {
404
407
405
408
private void readObject (ObjectInputStream inputStream ) throws IOException , ClassNotFoundException {
406
409
inputStream .defaultReadObject ();
407
- this .method = ReflectionUtils .findMethod (this .provider . getType (). getClass () , this .methodName );
410
+ this .method = ReflectionUtils .findMethod (this .declaringClass , this .methodName );
408
411
Assert .state (Type .class == this .method .getReturnType () || Type [].class == this .method .getReturnType ());
409
412
}
410
413
}
0 commit comments