commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COLLECTIONS-250) containsKey on MultiHashMap seems incorrect
Date Sun, 29 Apr 2007 20:11:15 GMT

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

Henri Yandell commented on COLLECTIONS-250:
-------------------------------------------

It seems very correct to me - putAll(key, EMPTY_LIST) is a no-op. I'm not sure what behaviour
has changed here - these methods haven't changed since they were added in r131607.

> containsKey on MultiHashMap seems incorrect
> -------------------------------------------
>
>                 Key: COLLECTIONS-250
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-250
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 3.1, 3.2
>            Reporter: Nikhil G. Daddikar
>            Priority: Critical
>
> MultiHashMap m = new MultiHashMap();
> m.putAll("key", Collections.EMPTY_LIST);
> System.out.println(m.containsKey("key")) 
> It says false, when it should have printed true. 
> The problem is that the code in MultiHashMap and even MultiValueMap has in putAll():
> if (values == null || values.size() == 0) 
> {
>             return false;
> }
> This means that they key is never being entered into the Map. This is causing a huge
problem because the behaviour has changed.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message