You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2015/11/27 22:12:14 UTC

[jira] [Closed] (COLLECTIONS-553) TransformedMultiValuedMap.equals() fails when comparing the value with itself

     [ https://issues.apache.org/jira/browse/COLLECTIONS-553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart closed COLLECTIONS-553.
---------------------------------------

> TransformedMultiValuedMap.equals() fails when comparing the value with itself
> -----------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-553
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-553
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 4.0
>            Reporter: M Kim
>             Fix For: 4.1
>
>
> TransformedMultiValuedMap.equals() does not return true when comparing a value of a Collection key with itself. Is it allowed to put Collection as a key in TransformedMultiValuedMap at all? If not, I think it should be specified in the document. Or, equals() should be fixed accordingly. 
> Reproduce step
> {code:title=Test.java|borderStyle=solid}
> public void test()
> {
>   TransformedMultiValuedMap map = TransformedMultiValuedMap.transformingMap((MultiValuedMap)new MultiValuedHashMap(),TransformerUtils.stringValueTransformer(),  TransformerUtils.stringValueTransformer());
>   
>   MultiValuedHashMap helperMap = new MultiValuedHashMap();
>   helperMap.put("KEY", "Value");
>   Collection key = helperMap.keySet();
>   map.put(key, "Hi");
>   Collection value = map.get(key);
>   assertTrue("Contract failed: value.equals(value)", value.equals(value));
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)