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

map.findAll() should return a subMap rather than a list of HashMap Entries

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0-JSR-3
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      goal: keep map closed under the operation of findAll()

      map = [a:1, b:2, c:3]

      submap = map.subMap(['a','b'])

      found = map.findAll

      {['a','b'].contains(it.key)}

      // throws java.lang.AssertionError: Expression: (submap == found).
      // Values: submap =

      {a=1,b=2}

      , found = [b=2, a=1]

      assert submap == found

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              codevise Dierk K├Ânig
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: