ASF GitHub Bot commented on GROOVY-7942:

GitHub user paulk-asert opened a pull request:


    GROOVY-7942: @Lazy transform creates unneeded getter/setter for backi…

    …ng store field

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paulk-asert/groovy groovy7942

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #423
commit 31ee88edaafd29a85fd85c985f84a1fcea797b2d
Author: paulk <pa...@asert.com.au>
Date:   2016-09-18T00:17:24Z

    GROOVY-7942: @Lazy transform creates unneeded getter/setter for backing 
store field


> @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

Reply via email to