ConcurrentModificationException and Iterators
Hi guys.
I want to understand what makes the already cited exception to be raised when I open an Iterator over a Vector which has already been iterated by another method. Here is my situation
I have a Thread:
firstPhase=new ThreadPP();
firstPhase.start();
in this thread, in its method run, I have these two methods:
globalObject.calculateCP();
//discard those which are not adapt
globalObject.discardCP();
These two methods both iterate over the collection CP. Only the second one modifies the content of this collection (a Vector) removing some element.
Hence, the exception is raised only if I use iterators to loop over this set in both methods. If I use a normal loop (e.g for with a counter) the execution is correct and no exception is raised. May you explain to me which is the reason that lies behind this behaviour?
Thanks!

