Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8930

JVM verification fails when using static interface method from inside CompileStatic groovy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.4
    • 3.0.0-rc-2
    • None
    • None

    Description

      Create and compile java interface containing static method using JDK8

      public interface JavaInterface
      {
        static int doSmth()
        {
          return 42;
        }
      }
      

       javac JavaInterface.java

       

      Open groovyConsole (2.5.4), add folder where JavaInterface.class is located to classpath, check 'Enable indy compilation' and paste following script

       

      import groovy.transform.CompileStatic
      import static JavaInterface.doSmth
      
      @CompileStatic
      void doCall()
      {
        println doSmth()
      }
      

       

       

      Compile and Run the script in groovyConsole. The result is JVM verification failure:

      java.lang.VerifyError: Illegal type at constant pool entry 51 in class Caller
      Exception Details:
      Location:
      Caller.doCall()V @4: invokestatic
      Reason:
      Constant pool index 51 is invalid

      Best Regards

      Artsiom

       

      Attachments

        1. Caller.groovy
          0.1 kB
          Artsiom Matronkin
        2. JavaInterface.class
          0.2 kB
          Artsiom Matronkin
        3. JavaInterface.java
          0.1 kB
          Artsiom Matronkin

        Issue Links

          Activity

            People

              emilles Eric Milles
              artsiom.matronkin Artsiom Matronkin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h