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

Repeatable annotation not wrapped with container type in class file

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.6
    • Fix Version/s: 3.0.0-beta-1, 2.5.7
    • Component/s: Compiler
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: