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

Multiple problems with static method invocations and @CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.5, 2.0.6
    • 2.1.0
    • Static compilation
    • None

    Description

      Not sure how to reproduce this in a smaller example, but if I uncomment the @CompileStatic from this line of code:

      https://github.com/grails/grails-core/blob/0e4b23d5691fa71bf47703bfcbd31e511a036848/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/DependencyManagerConfigurer.groovy#L133

      I get the exception:

      (class: org/codehaus/groovy/grails/resolve/DependencyManagerConfigurer, method: createIvyDependencyManager signature: (Lgrails/util/BuildSettings;)Lorg/codehaus/groovy/grails/resolve/IvyDependencyManager;) Expecting to find object/array on stack
      java.lang.VerifyError: (class: org/codehaus/groovy/grails/resolve/DependencyManagerConfigurer, method: createIvyDependencyManager signature: (Lgrails/util/BuildSettings;)Lorg/codehaus/groovy/grails/resolve/IvyDependencyManager;) Expecting to find object/array on stack
      	at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1224)
      	at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1169)
      	at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1065)
      	at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1047)
      

      Possible related, in the same class if I uncomment the @CompileStatic on line:

      https://github.com/grails/grails-core/blob/0e4b23d5691fa71bf47703bfcbd31e511a036848/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/DependencyManagerConfigurer.groovy#L41

      I get a compilation error:

      [ant:groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      [ant:groovyc] General error during class generation: size==0
      [ant:groovyc] 
      [ant:groovyc] java.lang.ArrayIndexOutOfBoundsException: size==0
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.OperandStack.doConvertAndCast(OperandStac
      [ant:groovyc] k.java:312)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.OperandStack.doGroovyCast(OperandStack.java:296)
      [ant:groovyc] 	at org.codehaus.groovy.classg
      [ant:groovyc] en.asm.sc.StaticInvocationWriter.loadArguments(StaticInvocationWriter.java:251)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.InvocationW
      [ant:groovyc] riter.writeDirectMethodCall(InvocationWriter.java:130)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.sc.StaticInvocationWriter.writeDirec
      [ant:groovyc] tMethodCall(StaticInvocationWriter.java:185)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.jav
      [ant:groovyc] a:223)
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: