Fix an error with TinyProtocol reflection

Fixes aadnk#103
This commit is contained in:
Dan Mulloy 2016-03-19 22:36:25 -04:00
parent 0e6a7a39a0
commit f561057311

View File

@ -215,7 +215,9 @@ public final class Reflection {
*/ */
public static MethodInvoker getTypedMethod(Class<?> clazz, String methodName, Class<?> returnType, Class<?>... params) { public static MethodInvoker getTypedMethod(Class<?> clazz, String methodName, Class<?> returnType, Class<?>... params) {
for (final Method method : clazz.getDeclaredMethods()) { for (final Method method : clazz.getDeclaredMethods()) {
if ((methodName == null || method.getName().equals(methodName)) && (returnType == null) || method.getReturnType().equals(returnType) && Arrays.equals(method.getParameterTypes(), params)) { if ((methodName == null || method.getName().equals(methodName))
&& (returnType == null || method.getReturnType().equals(returnType))
&& Arrays.equals(method.getParameterTypes(), params)) {
method.setAccessible(true); method.setAccessible(true);
return new MethodInvoker() { return new MethodInvoker() {