You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2019/04/25 19:34:00 UTC

[jira] [Created] (GROOVY-9095) Default retention policy not implemented for annotation

Eric Milles created GROOVY-9095:
-----------------------------------

             Summary: Default retention policy not implemented for annotation
                 Key: GROOVY-9095
                 URL: https://issues.apache.org/jira/browse/GROOVY-9095
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 2.5.6
            Reporter: Eric Milles


Consider the following:
Anno.java
{code:java}
public @interface Anno {}
{code}
Pogo.groovy
{code:groovy}
@Anno public class Pogo {}
{code}
Pojo.java
{code:java}
@Anno public class Pojo {}
{code}


When compiled, Pogo lacks the annotation in its class file.
{code}
// Compiled from Pogo.groovy (version 1.8 : 52.0, super bit)
public class Pogo implements groovy.lang.GroovyObject {
{code}
vs.
{code}
// Compiled from Pojo.java (version 1.8 : 52.0, super bit)
@Anno
public class Pojo {
{code}

The default for an annotation that lacks an {{@Retention}} annotation is {{@Retention(RetentionPolicy.CLASS)}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)