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

Nested calls between @Lazy static properties throws MissingPropertyException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.8
    • Component/s: None
    • Labels:
      None

      Description

      This piece of code throws MissingPropertyException

      class LazyTesting {
        @Lazy static final Set<String> STRING_SET = ['a', 'b', 'c'] as Set
        @Lazy static final Set<String> BIGGER_STRING_SET = (['d', 'e', 'f'] + STRING_SET) as Set
      }
      println LazyTesting.BIGGER_STRING_SET
      
      java.lang.ExceptionInInitializerError
      	at LazyTesting.getBIGGER_STRING_SET(test.groovy)
      	at test.run(test.groovy:6)
      Caused by: groovy.lang.MissingPropertyException: No such property: STRING_SET for class: LazyTesting$SetHolder_BIGGER_STRING_SET
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                endSly Endika GutiƩrrez
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: