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

3.0 stubs include packages annotations on classes other than package-info.groovy

    XMLWordPrintableJSON

    Details

      Description

      @CustomAnnotation
      package com.foo
      
      class Foo {}
      
      
      @interface CustomAnnotation {}
      

      Generates a stub that has @com.foo.CustomAnnotation package com.foo in Foo.java, which javac won't compile because it requires package annotations to be in package-info.java.  Groovy 2.4 and 2.5 don't include this annotation in the stub.

      Ideally, the annotation would be included if in package-info.groovy, and otherwise omitted.  But if we had to, and always omitted it, it at least wouldn't be a regression (assuming this difference wasn't made on purpose).

      Possibly we should also consider having the Groovy compiler not allow annotations on packages if not in package-info.groovy, though this would have to be a Groovy 4 thing, and only if it makes sense.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              keegan Keegan Witt
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: