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

Annotation causes @CompileStatic to fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.6, 2.1.0-beta-1
    • 2.0.6
    • Compiler
    • None
    • Groovy 2.0.6 SNAPSHOT

    Description

      If I add @CompileStatic to a class that already has an @Entity gaelyk annotation. I get a compilation error.

      :compileGroovy
      startup failed:
      General error during class generation: size==0
      
      java.lang.ArrayIndexOutOfBoundsException: size==0
      	at org.codehaus.groovy.classgen.asm.OperandStack.doConvertAndCast(OperandStack.java:312)
      	at org.codehaus.groovy.classgen.asm.OperandStack.doGroovyCast(OperandStack.java:296)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWriter.java:592)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:505)
      	at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:81)
      	at org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:49)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:455)
      	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:319)
      
      
      the EntityTransformation#visit(nodes, source) method runs well but StaticCompileTransformation#visit(nodes, source) fails
      

      Attachments

        1. static-compile-fail.zip
          358 kB
          Scott Murphy

        Activity

          People

            melix Cédric Champeau
            sdmurphy Scott Murphy
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: