Fix important parameter not used in ReflexionUtil
This commit is contained in:
parent
c72a1af3ba
commit
92a1d21b3b
@ -96,7 +96,7 @@ public class ReflexionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Object invokeMethod(Class<?> clazz, Object instance, String methodName, Class<?>[] parameterTypes, Object... args) throws ReflectiveOperationException {
|
public static Object invokeMethod(Class<?> clazz, Object instance, String methodName, Class<?>[] parameterTypes, Object... args) throws ReflectiveOperationException {
|
||||||
Method m = clazz.getMethod(methodName);
|
Method m = clazz.getMethod(methodName, parameterTypes);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
return m.invoke(instance, args);
|
return m.invoke(instance, args);
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ public class ReflexionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Object invokeDeclaredMethod(Class<?> clazz, Object instance, String methodName, Class<?>[] parameterTypes, Object... args) throws ReflectiveOperationException {
|
public static Object invokeDeclaredMethod(Class<?> clazz, Object instance, String methodName, Class<?>[] parameterTypes, Object... args) throws ReflectiveOperationException {
|
||||||
Method m = clazz.getDeclaredMethod(methodName);
|
Method m = clazz.getDeclaredMethod(methodName, parameterTypes);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
return m.invoke(instance, args);
|
return m.invoke(instance, args);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user