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

Allow Map.eachWithIndex to be called with a three-arg closure

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.2
    • None
    • None
    • Patch

    Description

      If eachWithIndex is called on a Map with a three-arg closure, a MissingMethodException is thrown. It would be better if the closure was passed the key, value, and index, similar to the change in behavior of Map.each when called with a one or two-arg closure.

      I've attached a patch that makes this change and adds tests for eachWithIndex on a Map.

      Attachments

        1. eachWithIndex-key-value.diff
          3 kB
          Mike Dillon

        Activity

          People

            paulk Paul King
            md5 Mike Dillon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: