Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7942

@Lazy transform creates unneeded getter/setter for backing store field

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.8
    • None
    • None

    Description

      The following code:

      @Lazy String foo
      

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

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: