commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (COLLECTIONS-474) Exception in ListOrderedMap
Date Mon, 24 Jun 2013 19:22:20 GMT


Sebb commented on COLLECTIONS-474:

I've just added two tests - one uses null values (as per the issue description) and the other
uses non-null values.

Only the null value test fails, so I think there is a bug; easy to fix.
Just replace

final V old = put(index, entry.getKey(), entry.getValue());
if (old == null) {


final boolean contains = containsKey(entry.getKey());
put(index, entry.getKey(), entry.getValue());
if (!contains) {

> Exception in ListOrderedMap
> ---------------------------
>                 Key: COLLECTIONS-474
>                 URL:
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 4.0
>         Environment: java 1.7.0_09
>            Reporter: Ning Chen
>         Attachments:
> Dear apache developers, thanks for the great project. Recently, I encountered an IndexOutOfBoundsException
in ListOrderedMap in the latest revision (r1495998) with the crash stack trace: 
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
> 	at java.util.ArrayList.add(
> 	at
> 	at
> 	at Test.main(
> I've also attached a test case that can reproduce this crash.
> I think this test case actually reveals the bug reported in COLLECTIONS-411 (
However, it seems that the original patch for COLLECTIONS-411 missed a corner case.
> Could you please check if this is indeed a bug? Thanks!

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message