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

Groovyc throws exception in code using ASTTransformations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.6.4
    • 1.6.5, 1.7-beta-2
    • Compiler
    • None

    Description

      For the GParallelizer build the tests are not compilable. Neither with Gradle nor with an Ant build. The following ant build:

      <?xml version="1.0"?>
      <project name="sample" default="resolve">
          <target name="clean">
              <delete dir="antbuild/classes"/>
          </target>
          <taskdef name="groovyc"
                   classname="org.codehaus.groovy.ant.Groovyc">
              <classpath>
                  <pathelement path="/Users/hans/checkouts/gparallelizer-read-only/libs/groovy-all-1.6.4.jar"/>
              </classpath>
          </taskdef>
      
          <target name="compile">
              <mkdir dir="antbuild/classes"/>
              <groovyc srcdir="${basedir}/src/main/groovy" destdir="${basedir}/antbuild/classes">
                  <classpath>
                      <pathelement path="/Users/hans/checkouts/gparallelizer-read-only/libs/groovy-all-1.6.4.jar"/>
                      <pathelement path="/Users/hans/checkouts/gparallelizer-read-only/libs/jsr166y-070108.jar"/>
                  </classpath>
                  <javac source="1.5" target="1.5" debug="on"/>
              </groovyc>
          </target>
      
          <target name="compileTests" depends="compile">
              <mkdir dir="antbuild/test-classes"/>
              <groovyc srcdir="${basedir}/src/test/groovy" destdir="${basedir}/antbuild/test-classes">
                  <classpath>
                      <pathelement path="${basedir}/build/classes"/>
                      <pathelement path="/Users/hans/checkouts/gparallelizer-read-only/libs/junit-4.7.jar"/>
                      <pathelement path="/Users/hans/checkouts/gparallelizer-read-only/libs/groovy-all-1.6.4.jar"/>
                      <pathelement path="/Users/hans/checkouts/gparallelizer-read-only/libs/jsr166y-070108.jar"/>
                  </classpath>
                  <javac source="1.5" target="1.5" debug="on"/>
              </groovyc>
          </target>
      </project>
      

      throws an exception when executing ant compileTests. Below is a snippet from the stacktrace. I have attached the full stacktrace of the ant execution. The revision of GParallelizer where we hit this problem is 559.

      compileTests:
        [groovyc] Compiling 158 source files to /Users/hans/checkouts/gparallelizer-read-only/antbuild/test-classes
        [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, General error during semantic analysis: Type ActorMessage not present
        [groovyc] 
        [groovyc] java.lang.TypeNotPresentException: Type ActorMessage not present
        [groovyc]     at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:98)
        [groovyc]     at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
        [groovyc]     at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
        [groovyc]     at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:50)
        [groovyc]     at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:120)
        [groovyc]     at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
        [groovyc]     at sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:67)
        [groovyc]     at java.lang.reflect.Field.getGenericType(Field.java:223)
      

      Attachments

        1. 17x_Patch.txt
          1 kB
          Roshan Dawrani
        2. stack.txt
          69 kB
          Hans Dockter

        Activity

          People

            roshandawrani Roshan Dawrani
            hans_d Hans Dockter
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: