tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Kemnade (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-2452) Bug in CaseInsensitiveMap
Date Wed, 25 Feb 2015 15:36:04 GMT

    [ https://issues.apache.org/jira/browse/TAP5-2452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14336636#comment-14336636
] 

Jochen Kemnade commented on TAP5-2452:
--------------------------------------

I started to implement a custom key set with custom mutators but I'm getting the feeling that
I'm taking it too far.
Do you actually need the {{keySet().retainAll(...)}} to work or did you just want to report
this (perfectly valid) bug? In the latter case, I'd prefer the mutators to throw an {{UnsupportedOperationException}}.

> Bug in CaseInsensitiveMap
> -------------------------
>
>                 Key: TAP5-2452
>                 URL: https://issues.apache.org/jira/browse/TAP5-2452
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-ioc
>    Affects Versions: 5.4, 5.3.8
>            Reporter: Alex Lumpov
>
> {code}
> /**
>  *
>  * @author AlexLumpov
>  */
> public class CaseInsensitiveMapTest extends Assert {
> 	@Test
> 	public void testRetainAllKeys() {
> 		Map<String, String> map = new CaseInsensitiveMap<String>();
> 		map.put("1", "1");
> 		map.put("2", "2");
> 		map.put("3", "3");
> 		Collection<String> keysToRetain = Arrays.asList("3", "4", "5");
> 		HashSet<String> expected = new HashSet<String>(Arrays.asList("3"));
> 		boolean modified = map.keySet().retainAll(keysToRetain);
> 		assertEquals(true, modified);
> 		assertEquals(expected, map.keySet());
> 	}
> }
> {code}
> Result:
> {code}
> java.lang.AssertionError: expected:<[3]> but was:<[2, 3]>
> {code}



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

Mime
View raw message