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

jdk.lambda.vm.InterfaceAccessFlagsTest.testPrivateMethodCall needs update after nestmates support

    XMLWordPrintable

Details

    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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: