You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/02/01 23:19:07 UTC
[jira] [Closed] (GROOVY-7942) @Lazy transform creates unneeded
getter/setter for backing store field
[ https://issues.apache.org/jira/browse/GROOVY-7942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-7942.
-----------------------------
> @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
> Assignee: Paul King
> Fix For: 2.4.8
>
>
> 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.15#6346)