You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/06/17 01:55:04 UTC

DO NOT REPLY [Bug 29625] New: - FastArrayList iterator method throwing ConcurrentModificationException in 'fast' mode

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