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

Endless-loop with nested 'each'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1-rc-3
    • 1.1-rc-3
    • None
    • None
    • Groovy Trunk: rev 9408 and rev 9467.

    Description

      List list = ['groovy', 'java']
      
      Map map = [a: 1, b: 2]
      
      list.each {
          map.keySet().each {Date d ->
              println d
          }
      }
      

      The script above produces and endless loop (stopped by a StackOverflowError). I guess this should not happen. I would expect the same behavior as when executing solely:

      Map map = [a: 1, b: 2]
      
      map.keySet().each {Date d ->
              println d
       }
      

      which stops with an: Caught: groovy.lang.MissingMethodException: ...

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            hans_d Hans Dockter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: