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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to