diff -r 44a5802816be -r c91483c86597 emul/src/main/java/java/lang/reflect/Method.java --- a/emul/src/main/java/java/lang/reflect/Method.java Fri Dec 28 12:35:32 2012 +0100 +++ b/emul/src/main/java/java/lang/reflect/Method.java Mon Jan 07 18:27:01 2013 +0100 @@ -512,6 +512,9 @@ throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { + if ((getModifiers() & Modifier.STATIC) == 0 && obj == null) { + throw new NullPointerException(); + } Object res = invoke0(this, obj, args); if (getReturnType().isPrimitive()) { res = fromPrimitive(getReturnType(), res); @@ -547,7 +550,9 @@ if (type == Short.TYPE) { return fromRaw(Short.class, "valueOf__Ljava_lang_Short_2S", o); } -// case 'V': return Void.TYPE; + if (type.getName().equals("void")) { + return null; + } throw new IllegalStateException("Can't convert " + o); }