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

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-2
    • 1.0-JSR-3
    • groovy-jdk
    • 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

            Unassigned Unassigned
            codevise Dierk König
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: