-
Bug
-
Resolution: Fixed
-
P4
-
11
-
b24
The ClassToInterfaceConverter tries to mechanically convert a classfile for a Class into an in-memory class representation of an equivalent Interface. For example the flags mark it as an interface, MethodRefs become InterfaceMethodRefs etc.
The problem lies with the invocation bytecode that has been used to invoke a private method. Currently invoking a private class method and a private interface method both use Invokespecial. However with the nestmate changes the class uses invokevirtual but the interface must use invokeinterface! There is no conversion applied to the invokevirtual and so we get a verification failure:
java.lang.VerifyError: Illegal type at constant pool entry 2 in class I
Exception Details:
Location:
I.m()I @1: invokevirtual
Reason:
Constant pool index 2 is invalid
Bytecode:
0000000: 2ab6 0002 ac
Arguably we should be able to produce a more specific error message here as well.
The problem lies with the invocation bytecode that has been used to invoke a private method. Currently invoking a private class method and a private interface method both use Invokespecial. However with the nestmate changes the class uses invokevirtual but the interface must use invokeinterface! There is no conversion applied to the invokevirtual and so we get a verification failure:
java.lang.VerifyError: Illegal type at constant pool entry 2 in class I
Exception Details:
Location:
I.m()I @1: invokevirtual
Reason:
Constant pool index 2 is invalid
Bytecode:
0000000: 2ab6 0002 ac
Arguably we should be able to produce a more specific error message here as well.
There are no Sub-Tasks for this issue.