add misc methods to classpath

This commit is contained in:
Joel Dice
2007-09-13 20:19:44 -06:00
parent ce97b6eecb
commit 5e42158f4b
4 changed files with 22 additions and 0 deletions

View File

@ -110,4 +110,14 @@ public class Method<T> extends AccessibleObject implements Member {
public static native Object invoke(Method method, Object instance,
Object ... arguments)
throws InvocationTargetException, IllegalAccessException;
public Class getReturnType() {
for (int i = 0; i < spec.length - 1; ++i) {
if (spec[i] == ')') {
return Class.forCanonicalName
(new String(spec, i + 1, spec.length - i - 2, false));
}
}
throw new RuntimeException();
}
}