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

global properties referenced from closure that are declared later cause early NullPointer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-5
    • class generator
    • None
    • CVS HEAD

    Description

      this code
      ---- CUT HERE ----
      ONE = {
      println "one"
      println "TWO=" + TWO
      }

      TWO = "two"

      println "three"

      ONE();
      ---- CUT HERE ----
      causes a NullPointer in Line 6 - what makes no sense at all

      If you insert

      TWO=null

      at the beginning everything works as expected.

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              jakob Jakob Frank
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: