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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.4
    • Fix Version/s: 3.0.0-rc-2
    • Component/s: None
    • Labels:
      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

            • Assignee:
              emilles Eric Milles
              Reporter:
              artsiom.matronkin Artsiom Matronkin

              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

                  Issue deployment