groovy

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

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.2
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

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.

Activity

Hide
Paul King added a comment -

Added, thanks again.

Show
Paul King added a comment - Added, thanks again.
Hide
Paul King added a comment -

close off release 1.5.4

Show
Paul King added a comment - close off release 1.5.4

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: