Groovy
  1. Groovy
  2. GROOVY-2904

[ [a:1, b:2, c:3] ].flatten() -> [ 1, 2, 3 ], but should be [ [a:1, b:2, c:3] ]

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6-beta-1
    • Fix Version/s: 1.6-rc-2, 1.5.8, 1.7-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Patch relative to SVN revision 12775.
    • Flags:
      Patch

      Description

      Updated list#flatten/set#flatten so that maps are unadulterated.

      Going with this approach means that maps can safely be used in lists. This is commonly done as a kind of "pseudobean" for unit testing – it's how I first encountered this behavior.

        Issue Links

          Activity

            People

            • Assignee:
              Paul King
              Reporter:
              Robert Fischer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development