On Wednesday, March 30, 2011 8:41:24 AM UTC+2, Matthew Farwell wrote: > > ConcurrentModificationExceptions. You can come across this sort of > thing in web servers, admittedly ones badly written. > > This sort of bug is seemingly random and very hard to track down. >
Huh? No it isn't. ConcurrentModificationException has very little to do with 'concurrent' in the sense of threading, i.e. the way java.util.concurrent uses it. CoModExes are not at all hard to track down. You modify a collection in the middle of iterating over it and you get one. Every time. Reliable as clockwork. The exception will occur at the point of the loop (where .hasNext() is called), instead of where you actually modify it, but in the vast majority of these cases its easy to find where inside the loop the list is modified. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
