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:48:12 UTC

[jira] [Closed] (COLLECTIONS-279) LRUMap: moveToMRU is not invoked for new entry

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

Thomas Neidhart closed COLLECTIONS-279.
---------------------------------------

> LRUMap: moveToMRU is not invoked for new entry
> ----------------------------------------------
>
>                 Key: COLLECTIONS-279
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-279
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 3.2
>            Reporter: Andrey Andreev
>            Priority: Blocker
>         Attachments: AbstractLinkedMap.java.diff
>
>
> 	@Test
> 	public void testFirst() {
> 		LRUMap map = new LRUMap();
> 		String key = "key1";
> 		String value = "value1";
> 		map.put(key, value);
> 		Assert.assertEquals(map.get(key), value);
> 		Assert.assertEquals(map.get(map.firstKey()), value);
> 		
> 		key = "key2";
> 		value = "value2";
> 		map.put(key, value);
> 		// here it fails
> 		Assert.assertEquals(map.get(map.firstKey()), value);
> 	}



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