Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-2148

Groovy Debugging problem --- cannot evaluate local variables referenced from inside of closures

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Complete
    • 2.8.0.RC1
    • 2.8.0.RC2
    • GRAILS

    Description

      First mentioned on the mailing list:

      http://groovy.329449.n5.nabble.com/Groovy-Eclipse-Debugging-issue-Watch-expression-doesn-t-work-tp4864139p4870464.html

      Trying to debug this script:

      def current = 1
      next = 1
      10.times {
      	print current + ' '
      	newCurrent = next
      	next = next + current
      	current = newCurrent
      }
      println ''
      

      Set a breakpoint inside the closure and try to evaluate next. It is an error. The problem is that we are not properly looking up variables defined in the outer scope of a closure.

      Attachments

        Activity

          People

            aeisenberg Andrew Eisenberg
            aeisenberg Andrew Eisenberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: