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

Method handles of outer classes are resolved via the inner class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8u51, 9
    • tools
    • x86_64
    • linux

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux raftop 3.16.0-34-generic #47-Ubuntu SMP Fri Apr 10 18:02:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      javac references outer classes by their inner class instance when creating a method handle within this inner class. This does not work when requiring the outer instance within a constructor call such as when calling an auxiliary constructor.

      REGRESSION. Last worked in version 8u51

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run this code: https://gist.github.com/raphw/972137a8f5cdcb294c29

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Should not throw an VerifierError.
      ACTUAL -
      Throws an VerifierError.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
      Exception Details:
        Location:
          com/leonhart/javac/issue/reproduce/Example$InnerClass.<init>(Lcom/leonhart/javac/issue/reproduce/Example;Ljava/util/function/Function;)V @4: invokedynamic
        Reason:
          Type uninitializedThis (current frame, stack[3]) is not assignable to 'com/leonhart/javac/issue/reproduce/Example$InnerClass'
        Current Frame:
          bci: @4
          flags: { flagThisUninit }
          locals: { uninitializedThis, 'com/leonhart/javac/issue/reproduce/Example', 'java/util/function/Function' }
          stack: { uninitializedThis, 'com/leonhart/javac/issue/reproduce/Example', 'java/util/function/Function', uninitializedThis }
        Bytecode:
          0x0000000: 2a2b 2c2a ba00 0100 00b9 0002 0200 b700
          0x0000010: 03b1

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Run this code: https://gist.github.com/raphw/972137a8f5cdcb294c29
      ---------- END SOURCE ----------

            sadayapalam Srikanth Adayapalam (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: