1
2
3
4 package joeq.Bootstrap;
5
6 import java.lang.reflect.InvocationTargetException;
7 import joeq.Class.jq_Method;
8 import joeq.Runtime.Reflection;
9
10 /***
11 * MethodInvocation
12 *
13 * @author John Whaley <jwhaley@alum.mit.edu>
14 * @version $Id: MethodInvocation.java 1941 2004-09-30 03:37:06Z joewhaley $
15 */
16 public class MethodInvocation {
17
18 jq_Method method;
19 Object[] args;
20
21 public MethodInvocation(jq_Method m, Object[] a) {
22 this.method = m;
23 this.args = a;
24 }
25
26 public long invoke() throws Throwable {
27 try {
28 return Reflection.invoke(method, null, args);
29 } catch (InvocationTargetException x) {
30 throw x.getTargetException();
31 }
32 }
33
34 public String toString() {
35 return "method "+method;
36 }
37 }