Details
-
Bug
-
Resolution: Fixed
-
P3
-
hs25, 8
-
b119
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8029242 | hs25 | David Chase | P3 | Resolved | Fixed | b61 |
Description
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
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
Attachments
Issue Links
- backported by
-
JDK-8029242 JSR292: AME instead of IAE when calling a method
- Resolved
- relates to
-
JDK-8025260 Methodhandles/JSR292: NullPointerException (NPE) thrown instead of AbstractMethodError (AME)
- Resolved
-
JDK-8029351 assert(bt != T_OBJECT) failed: Guard is incorrect in VM:defmeth
- Closed