// Since static methods don't change parameter lists, they just invoke the executor
return new ReloadedTypeInvoker(declaringType, methodMember) {
@Override
public Object invoke(Object target, Object... params) throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException {
CurrentLiveVersion clv = rtype.getLiveVersion();
Method executor = clv.getExecutorMethod(methodMember);
return executor.invoke(target, params);
}
};
} else {
// Non static method invokers need to add target as a first param
return new ReloadedTypeInvoker(declaringType, methodMember) {
@Override
public Object invoke(Object target, Object... params) throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException {
CurrentLiveVersion clv = rtype.getLiveVersion();
Method executor = clv.getExecutorMethod(methodMember);
if (params == null) {
return executor.invoke(null, target);
} else {
Object[] ps = new Object[params.length + 1];
System.arraycopy(params, 0, ps, 1, params.length);