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

AnnotationCollector unusable in external jar when used in stub generation

    XMLWordPrintableJSON

Details

    Description

      In the attached test case (cd mod; gradle clean build), I have a parent module with two child modules. The first module simply defines a simple AnnotationCollector. The second module is structured so that it will generate a java stub for a groovy file that uses the 'external' annotation collector. When the generated java stub for ParentG is compiled, it throws the following exception:
      :mod2:compileGroovyC:\sand\nca\javacommons\nca\harmonytest\mod\mod2\build\tmp\groovy-java-stubs\mod2\ParentG.java:10: error: incompatible types: ExternalAnnotationCollector cannot be converted to Annotation
      @mod1.ExternalAnnotationCollector() public class ParentG

      It appears that the java compilation of the groovy stub does not have the external AnnotationCollector 'in scope' of the compiler, and thus barfs. However, if the AnnocationCollector is in the same module as where it used, the compilation works (uncomment the obvious line in ParentG and rebuild).

      This seems related to https://jira.codehaus.org/browse/GRECLIPSE-1679

      Added Sept. 4th:
      Also related to http://jira.codehaus.org/browse/GROOVY-6635 which was closed as 'not reproducible' - believe the test case with this issue effectively reproduces the issue (and 6635's as well)

      Attachments

        1. mod.zip
          4 kB

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              ilbmiller Brad Miller
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: