You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Leo Li (JIRA)" <ji...@apache.org> on 2007/07/31 03:48:52 UTC

[jira] Assigned: (HARMONY-4576) [classlib][luni] AbstractList's remove method will throw unexpected ConcurrentModificationException

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

Leo Li reassigned HARMONY-4576:
-------------------------------

    Assignee: Leo Li

> [classlib][luni] AbstractList's remove method will throw unexpected ConcurrentModificationException
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4576
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4576
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: spark shen
>            Assignee: Leo Li
>         Attachments: AbstractList-patch.txt, AbstractListTest-patch.txt
>
>
> The following test case will fail on harmony, but pass on RI.
> class MockRemoveFailureArrayList<E> extends AbstractList<E> {
> 		@Override
> 		public E get(int location) {
> 			// TODO Auto-generated method stub
> 			return null;
> 		}
> 		@Override
> 		public int size() {
> 			// TODO Auto-generated method stub
> 			return 0;
> 		}
> 		
> 		public E remove(int idx) {
>     		modCount+=2;
>     		return null;
>     	}
> 		
> 		public int getModCount(){
> 			return modCount;
> 		}
>     }
>     
>     //test remove for failure by inconsistency of modCount and expectedModCount 
>     public void test_remove(){
>     	MockRemoveFailureArrayList<String> mrfal = new MockRemoveFailureArrayList<String>();
>     	Iterator<String> imrfal= mrfal.iterator();
>     	imrfal.next();
>     	imrfal.remove();
>     	try{
>     		imrfal.remove();
>                 fail("Should throw IllegalStateException");
>     	}
>     	catch(IllegalStateException e){
>     		//Excepted to catch IllegalStateException here
>     	}
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.