commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29625] New: - FastArrayList iterator method throwing ConcurrentModificationException in 'fast' mode
Date Wed, 16 Jun 2004 23:55:04 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29625>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29625

FastArrayList iterator method throwing ConcurrentModificationException in 'fast' mode

           Summary: FastArrayList iterator method throwing
                    ConcurrentModificationException in 'fast' mode
           Product: Commons
           Version: 3.1
          Platform: All
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: Other
         Component: Collections
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: cooker123456@yahoo.com


Please review the below code, I was under the impression that this not throw an
exception.

 

Thanks,

Rob Cooke.

 

----------------------------

 

 

import org.apache.commons.collections.FastArrayList;

import java.util.Iterator;

 

public class Test2 extends Thread{

  public static void main(String argv[]) throws Exception{

    FastArrayList array=new FastArrayList();

    array.add("this");

    array.add("is");

    array.add("a");

    new Test2(array).start();

    array.setFast(true);

    Thread.sleep(2000);

    array.add("test");

  }

  protected FastArrayList array;

  public Test2(FastArrayList array){

    this.array=array;

  }

  public void run(){

    for(Iterator i=array.iterator();i.hasNext();){

      try{Thread.sleep(1000);}catch(Exception e){}

      System.out.println(i.next());

    }

  }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message