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

Method handles of outer classes are resolved via the inner class

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 8u51, 9
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux

      Description

      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 ----------

        Attachments

        1. Example.java
          0.6 kB
          Pardeep Sharma

          Issue Links

            Activity

              People

              • Assignee:
                sadayapalam Srikanth Adayapalam
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: