[
https://issues.apache.org/jira/browse/COLLECTIONS-553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Neidhart resolved COLLECTIONS-553.
-----------------------------------------
Resolution: Fixed
Fix Version/s: 4.1
Problem solved after fixing COLLECTIONS-543.
> 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)