Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-237

MultiValueMap: behavior of entrySet().iterator() is not the expected one

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2
    • 4.0-alpha1, 4.0
    • Map
    • None

    Description

      The entrySet() method of the MultiValueMap delegates the entrySet() call to the decorated map, which is HashMap by default. The default hashmap iterator is used, which causes the iterator to return one Map.Entry for every key. The value returned for the key is an ArrayList, and not the value of the entry which was put into the map.

      The expected behavior would be the iterator to return the whole set of entries in the map, which requires iteration over the different array lists contained in the decorated map.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nika Nils Kaiser
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: