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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.8
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: