[ 
https://issues.apache.org/jira/browse/COLLECTIONS-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529378
 ] 

Alan Mehio commented on COLLECTIONS-237:
----------------------------------------

<quoted-statement>
The value returned for the key is an ArrayList, and not the value of the entry 
which was put into the map
</quoted-statement>
What if we overload the method below 

public Iterator iterator(Object key) 
           
with 

   public Iterator iterator() {
       return getMap().entrySet().iterator();
    }


otherwise I am in favour of point one 
<point-one>
1/ We define entrySet as matching keySet and mark this issue WONTFIX.
</point-one>


Regards,
Alan Mehio
London, UK





> MultiValueMap: behavior of entrySet().iterator() is not the expected one
> ------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-237
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-237
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 3.2
>            Reporter: Nils Kaiser
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to