Griffon
  1. Griffon
  2. GRIFFON-392

EventPublisher compilation problem

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.9.3-beta-2
    • Fix Version/s: 0.9.5-rc1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Steps to reproduce:

      1. griffon create-app foo
      2. Modify FooController like this:

      @griffon.transform.EventPublisher
      class FooController

      { static final BAR = "" }

      3. Modify FooTests like this:

      class FooTests extends GriffonUnitTestCase {

      void testSomething()

      { println FooController.BAR }

      }

      4. run griffon tA

      Result:

      [griffonc] Compiling 1 source file to
      /home/kostya/.griffon/0.9.3-beta-2/projects/foo/test-classes/integration
      Compilation error: BUG! exception in phase 'class generation' in source unit
      '/home/kostya/projects/groovy/foo/test/integration/foo/FooTests.groovy' Type
      is null. Most probably you let a transform reuse existing ClassNodes with
      generics information, that is now used in a wrong context.

        Activity

        Hide
        Andres Almiray added a comment -

        A temporal workaround is to call the getter explicitly, like this

        class FooTests extends GriffonUnitTestCase {
            void testSomething() { 
                println FooController.getBAR()
            }
        }
        
        Show
        Andres Almiray added a comment - A temporal workaround is to call the getter explicitly, like this class FooTests extends GriffonUnitTestCase { void testSomething() { println FooController.getBAR() } }
        Hide
        Paul King added a comment - - edited

        I can replicate this with the latest 1_8_X branch, and get the following unsanitized stacktrace:

        Starting integration test phase ...
             [copy] Copying 8 files to C:\Users\paulk\.griffon\0.9.3-beta-2\projects\foo\resources\griffon-app\resources
         [griffonc] Compiling 1 source file to C:\Users\paulk\.griffon\0.9.3-beta-2\projects\foo\test-classes\integration
         [griffonc] org.codehaus.groovy.GroovyBugError: Type is null. Most probably you let a transform reuse existing ClassNodes with generics information, that is now used in a wrong context.
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:96)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.configureTypeArguments(Java5.java:158)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.configureParameterizedType(Java5.java:138)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:88)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.makeClassNode(Java5.java:385)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.makeParameter(Java5.java:404)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.makeParameters(Java5.java:397)
         [griffonc]     at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:332)
         [griffonc]     at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:264)
         [griffonc]     at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:358)
         [griffonc]     at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:948)
         [griffonc]     at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:928)
         [griffonc]     at org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:918)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.isGroovyObject(AsmClassGenerator.java:1033)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitPropertyExpression(AsmClassGenerator.java:990)
         [griffonc]     at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:55)
         [griffonc]     at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:301)
         [griffonc]     at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:183)
         [griffonc]     at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:87)
         [griffonc]     at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:71)
         [griffonc]     at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:288)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:662)
         [griffonc]     at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:75)
         [griffonc]     at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:599)
         [griffonc]     at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:350)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:460)
         [griffonc]     at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
         [griffonc]     at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:80)
         [griffonc]     at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:151)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:406)
         [griffonc]     at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
         [griffonc]     at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
         [griffonc]     at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:289)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:268)
         [griffonc]     at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:366)
         [griffonc]     at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1058)
         [griffonc]     at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
         [griffonc]     at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:174)
         [griffonc]     at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:763)
         [griffonc]     at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:957)
         [griffonc]     at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:542)
         [griffonc]     at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:520)
         [griffonc]     at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
         [griffonc]     at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:476)
         [griffonc]     at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:67)
         [griffonc]     at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:180)
         [griffonc]     at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:903)
         [griffonc]     at org.codehaus.griffon.compiler.GriffonCompiler.compile(GriffonCompiler.java:46)
         ...
        
        Show
        Paul King added a comment - - edited I can replicate this with the latest 1_8_X branch, and get the following unsanitized stacktrace: Starting integration test phase ... [copy] Copying 8 files to C:\Users\paulk\.griffon\0.9.3-beta-2\projects\foo\resources\griffon-app\resources [griffonc] Compiling 1 source file to C:\Users\paulk\.griffon\0.9.3-beta-2\projects\foo\test-classes\integration [griffonc] org.codehaus.groovy.GroovyBugError: Type is null. Most probably you let a transform reuse existing ClassNodes with generics information, that is now used in a wrong context. [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:96) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.configureTypeArguments(Java5.java:158) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.configureParameterizedType(Java5.java:138) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:88) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.makeClassNode(Java5.java:385) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.makeParameter(Java5.java:404) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.makeParameters(Java5.java:397) [griffonc] at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:332) [griffonc] at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:264) [griffonc] at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:358) [griffonc] at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:948) [griffonc] at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:928) [griffonc] at org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:918) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.isGroovyObject(AsmClassGenerator.java:1033) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitPropertyExpression(AsmClassGenerator.java:990) [griffonc] at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:55) [griffonc] at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:301) [griffonc] at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:183) [griffonc] at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:87) [griffonc] at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:71) [griffonc] at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:288) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:662) [griffonc] at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:75) [griffonc] at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:599) [griffonc] at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:350) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:460) [griffonc] at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) [griffonc] at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:80) [griffonc] at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:151) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:406) [griffonc] at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) [griffonc] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101) [griffonc] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:289) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:268) [griffonc] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:366) [griffonc] at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1058) [griffonc] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50) [griffonc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:174) [griffonc] at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:763) [griffonc] at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:957) [griffonc] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:542) [griffonc] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:520) [griffonc] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497) [griffonc] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:476) [griffonc] at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:67) [griffonc] at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:180) [griffonc] at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:903) [griffonc] at org.codehaus.griffon.compiler.GriffonCompiler.compile(GriffonCompiler.java:46) ...
        Hide
        Andres Almiray added a comment -

        Apparently the problem was fixed in Groovy 1.8.4 or 1.8.5

        Show
        Andres Almiray added a comment - Apparently the problem was fixed in Groovy 1.8.4 or 1.8.5

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Konstantin Grigoriev
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: