[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/31861] New: IdentityHashMap$IdentityIterator.next() throw
From: |
jeroen at frijters dot net |
Subject: |
[Bug classpath/31861] New: IdentityHashMap$IdentityIterator.next() throws ArrayIndexOutOfBoundsException after calling remove() |
Date: |
8 May 2007 06:30:19 -0000 |
The following code throws an ArrayIndexOutOfBoundsException, because remove
disturbes the iterator state.
import java.util.*;
public class test
{
public static void main(String[] args) throws Exception
{
IdentityHashMap m = new IdentityHashMap();
for(int i = 0; i < 10; i++)
{
m.put("foo" + i, "bar" + i);
}
Iterator iter = m.values().iterator();
while(iter.hasNext())
{
System.out.println(iter.next());
iter.remove();
}
}
}
--
Summary: IdentityHashMap$IdentityIterator.next() throws
ArrayIndexOutOfBoundsException after calling remove()
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeroen at frijters dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31861
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/31861] New: IdentityHashMap$IdentityIterator.next() throws ArrayIndexOutOfBoundsException after calling remove(),
jeroen at frijters dot net <=