JDK-8157142 : Verifier error when using a lambda in super constructor call
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2016-05-17
  • Updated: 2016-05-25
  • Resolved: 2016-05-25
Related Reports
Duplicate :  
Relates :  
Description
I get the following verify error:

java.lang.VerifyError: Bad type on operand stack

Exception Details:

  Location:

    org/jetbrains/plugins/ruby/ruby/run/configuration/RubyRunConfigurationType$RubyRunConfigurationFactory.<init>(Lorg/jetbrains/plugins/ruby/ruby/run/configuration/RubyRunConfigurationType;)V @8: invokedynamic

  Reason:

    Type uninitializedThis (current frame, stack[2]) is not assignable to 'org/jetbrains/plugins/ruby/ruby/run/configuration/RubyRunConfigurationType$RubyRunConfigurationFactory'

  Current Frame:

    bci: @8

    flags: { flagThisUninit }

    locals: { uninitializedThis, 'org/jetbrains/plugins/ruby/ruby/run/configuration/RubyRunConfigurationType' }

    stack: { uninitializedThis, 'org/jetbrains/plugins/ruby/ruby/run/configuration/RubyRunConfigurationType', uninitializedThis }

  Bytecode:

    0x0000000: 2a2b b500 012a 2b2a ba00 0200 00b7 0003

    0x0000010: b1                                    

 

                at org.jetbrains.plugins.ruby.ruby.run.configuration.RubyRunConfigurationType.<init>(RubyRunConfigurationType.java:46)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

 

 

when I convert anonymous class to lambda inside super constructor call in inner class. (myRubyScriptFactory  - is a final field of the outer class.)

 

Before (works normally):

public RubyRunConfigurationFactory() {
  super(RubyRunConfigurationType.this, new Function<Project, AbstractRubyRunConfiguration>() {
    public AbstractRubyRunConfiguration fun(Project project) {
      return new RubyRunConfiguration(project, myRubyScriptFactory);
    }
  });
}

 

After (verify error):

public RubyRunConfigurationFactory() {
  super(RubyRunConfigurationType.this, project -> new RubyRunConfiguration(project, myRubyScriptFactory));
}
Comments
Same as JDK-8129740. I am working on backporting this to 8u.
25-05-2016

Looks similar to JDK-8129740. Please investigate.
17-05-2016