harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "spark shen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4576) [classlib][luni] AbstractList's remove method will throw unexpected ConcurrentModificationException
Date Tue, 31 Jul 2007 01:46:53 GMT

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

spark shen updated HARMONY-4576:
--------------------------------

    Attachment: AbstractListTest-patch.txt

> [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
>         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.


Mime
View raw message