Introspect interface-declared methods in case of proxy (for varargs)
Issue: SPR-16122
This commit is contained in:
parent
2611aa000d
commit
419b4440a7
|
@ -18,6 +18,7 @@ package org.springframework.expression.spel.support;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -230,6 +231,14 @@ public class ReflectiveMethodResolver implements MethodResolver {
|
|||
result.addAll(Arrays.asList(getMethods(Class.class)));
|
||||
return result;
|
||||
}
|
||||
else if (Proxy.isProxyClass(type)) {
|
||||
Set<Method> result = new LinkedHashSet<>();
|
||||
// Expose interface methods (not proxy-declared overrides) for proper vararg introspection
|
||||
for (Class<?> ifc : type.getInterfaces()) {
|
||||
result.addAll(Arrays.asList(getMethods(ifc)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return Arrays.asList(getMethods(type));
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue