Description
add() method of listIterator implementation in AbstractList may throw unexpected ConcurrentModificationException.
Its behavior is different from the one of RI.
Here is the test case:
public class AbstractListTest extends junit.framework.TestCase {
public void test_listIterator()
{ list = new MockArrayList(); ListIterator it = list.listIterator(); it.add("one"); it.add("two"); assertEquals(2,list.size()); }class MockArrayList<E> extends AbstractList<E> {
ArrayList<E> list = new ArrayList<E>();
public E remove(int idx)
{ modCount++; return list.remove(idx); } @Override
public E get(int index)
@Override
public int size()
@Override
public void add(int idx, E o)
}
}
Test results:
RI can pass this test.
Harmony will throw a ConcurrentModificationException.