obj = args[0];
int copyLen;
//Note: Warning 参数个数不一致
System.arraycopy(args, 1, methodArgs = new Object[myArgsCount], 0, ((copyLen = args.length - 1) <= myArgsCount) ? copyLen : myArgsCount);
} else {
throw new ScriptRuntimeException("this method need one argument at least");
}
}
try {
Object result = method.invoke(obj, methodArgs);
return noVoid ? result : Context.VOID;
} catch (IllegalAccessException ex) {
throw new ScriptRuntimeException("this method is inaccessible: ".concat(ex.getLocalizedMessage()));
} catch (IllegalArgumentException ex) {
throw new ScriptRuntimeException("illegal argument: ".concat(ex.getLocalizedMessage()));
} catch (InvocationTargetException ex) {
throw new ScriptRuntimeException("this method throws an exception", ex.getTargetException());
}
}