Pseudo code:
interface I { void m() default {} }
class C implements I {
private void m() {}
}
I o = new C(); o.m();
Observed behavior:
invokeinterface: IAE
MH.invoke* / indy: NPE
For MH.invokeExact case bytecode (Test1_I_C_m.class) is the following:
0: ldc #19 // MethodHandle invokeinterface I.m:()V
2: new #21 // class C
5: dup
6: invokespecial #22 // Method C."<init>":()V
9: astore_1
10: aload_1
11: invokevirtual #28 // Method java/lang/invoke/MethodHandle.invokeExact:(LI;)V
NPE is thrown on bci=11 (MH.invokeExact).
Test case is attached.
How to run:
$ java Test