groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Milles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8897) Methods generated for Groovy properties do not carry over annotations
Date Thu, 22 Nov 2018 15:42:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16696033#comment-16696033
] 

Eric Milles commented on GROOVY-8897:
-------------------------------------

{code:groovy}
import com.fasterxml.jackson.annotation.JsonProperty
class X {
  @JsonProperty('whatever')
  String value
}
{code}

I'm not sure if the expectation would be to copy this annotation to the generated methods
or leave it on the field only.

> Methods generated for Groovy properties do not carry over annotations
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-8897
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8897
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.4.15, 2.5.4
>            Reporter: Eric Milles
>            Priority: Major
>
> Consider the following:
> {code:groovy}
> class C {
>   @Deprecated
>   boolean condition
> }
> {code}
> Methods {{isCondition}}, {{getCondition}}, {{setCondition}} that are added by {{Verifier.visitProperty}}
do not have the {{java.lang.Deprecated}} annotation.  The PropertyNode has a link to the {{FieldNode}}
so deprecated can be checked for there.  But the generated methods do not have this link.



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

Mime
View raw message