You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sean Qiu (JIRA)" <ji...@apache.org> on 2008/05/06 09:01:55 UTC
[jira] Updated: (HARMONY-5808) [classlib][luni] add() method of
listIterator implementation in AbstractList may throw unexpected
ConcurrentModificationException
[ https://issues.apache.org/jira/browse/HARMONY-5808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Qiu updated HARMONY-5808:
------------------------------
Attachment: Harmony-5808.diff
Could someone please try this patch? Thanks
> [classlib][luni] add() method of listIterator implementation in AbstractList may throw unexpected ConcurrentModificationException
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-5808
> URL: https://issues.apache.org/jira/browse/HARMONY-5808
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M6
> Reporter: Sean Qiu
> Fix For: 5.0M6
>
> Attachments: Harmony-5808.diff
>
>
> 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) {
> return list.get(index);
> }
> @Override
> public int size() {
> return list.size();
> }
> @Override
> public void add(int idx, E o) {
> modCount += 10;
> list.add(idx, o);
> }
> }
> }
> Test results:
> RI can pass this test.
> Harmony will throw a ConcurrentModificationException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.