Please see the following code:
------------------------------------------------------
import java.dyn.*;
public class Test {
public static void foo(int i){}
public static void main(String argv[]) throws Throwable {
MethodHandle handle = MethodHandles.lookup().findStatic
(Test.class, "foo", MethodType.methodType(void.class, int.class));
handle.invokeGeneric(null);
}
}
------------------------------------------------------
Its output is:
Exception in thread "main" java.lang.NullPointerException
at sun.dyn.FromGeneric$A4.invoke_I4(FromGeneric.java:552)
at sun.dyn.FilterGeneric$F3.invoke_F2(FilterGeneric.java:573)
at Test.main(Test.java:7)