Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.6
-
None
Description
Consider the following:
Anno.java
import java.lang.annotation.*; @Retention(RetentionPolicy.CLASS) @Repeatable(Annos.class) @interface Anno { String value() default ""; } @Retention(RetentionPolicy.CLASS) @interface Annos { Anno[] value(); }
Pogo.groovy
@Anno @Anno('x') class Pogo {}
When this is compiled, the annotations in the class file are incorrect:
// Compiled from Pogo.groovy (version 1.8 : 52.0, super bit) @Anno@pack.Anno(value="x") public class Pogo implements groovy.lang.GroovyObject {
vs.
// Compiled from Pojo.java (version 1.8 : 52.0, super bit) @Annos(value={@Anno,@Anno(value="x")}) public class Pojo {
See GROOVY-8234 for initial support for @Repeatable.