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

Use of nested inner classes produces VerifyError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 11.0.10
    • Fix Version/s: None
    • Component/s: tools
    • CPU:
      x86_64
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Mac OS X, 11.0.10

      A DESCRIPTION OF THE PROBLEM :
      Use of method references and outer variable references in nested inner classes will product VerifyError

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run this program below.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No output or errors
      ACTUAL -
      Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
      Exception Details:
        Location:
          Main$1.lambda$$0([Ljava/lang/String;)LMain$1C; @5: getfield
        Reason:
          Type '[Ljava/lang/String;' (current frame, stack[2]) is not assignable to 'Main$1'
        Current Frame:
          bci: @5
          flags: { }
          locals: { '[Ljava/lang/String;' }
          stack: { uninitialized 0, uninitialized 0, '[Ljava/lang/String;' }
        Bytecode:
          0000000: bb00 0559 2ab4 0001 b700 06b0

      at Main.main(Main.java:9)


      ---------- BEGIN SOURCE ----------
      import java.util.function.Supplier;

      public class Main {
        public static void main(String[] args) {
          class C {
            Object a = args;
          }

          new Object() {
            Supplier<C> s = C::new;
          };
        }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: