Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8187655

[Nestmates][Testbug] jdk.lambda.separate.ClassToInterfaceConverter needs updating for changed invocation rules

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 11
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            mchung Mandy Chung
            Reporter:
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: