You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/09/05 10:08:00 UTC
[jira] [Resolved] (GROOVY-9717) 3.0 stubs include packages
annotations on classes other than package-info.groovy
[ https://issues.apache.org/jira/browse/GROOVY-9717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-9717.
-------------------------------
Fix Version/s: 3.0.6
4.0.0-alpha-1
Assignee: Paul King
Resolution: Fixed
> 3.0 stubs include packages annotations on classes other than package-info.groovy
> --------------------------------------------------------------------------------
>
> Key: GROOVY-9717
> URL: https://issues.apache.org/jira/browse/GROOVY-9717
> Project: Groovy
> Issue Type: Bug
> Components: Stub generator / Joint compiler
> Reporter: Keegan Witt
> Assignee: Paul King
> Priority: Major
> Fix For: 4.0.0-alpha-1, 3.0.6
>
>
> {code:java}
> @CustomAnnotation
> package com.foo
> class Foo {}
> @interface CustomAnnotation {}
> {code}
> 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 not only if it makes sense.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)