groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7942) @Lazy transform creates unneeded getter/setter for backing store field
Date Sun, 18 Sep 2016 08:39:21 GMT

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

ASF GitHub Bot commented on GROOVY-7942:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/423


> @Lazy transform creates unneeded getter/setter for backing store field
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-7942
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7942
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>
> The following code:
> {code}
> @Lazy String foo
> {code}
> creates an appropriate {{getFoo}} getter method and a private {{$foo}} backing field
but in renaming the fieldNode to have the dollar prefix, it doesn't remove the corresponding
entry in the ClassNode's properties list. This results in some spurious {{get$Foo}} and {{set$Foo}}
methods being created in later compilation phases. On the one hand these could be regarded
as some backdoor semi-internal way to get access to the backing field but in reality using
those methods would violate the contract that {{@Lazy}} is trying to provide..



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message