You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When designing the libraries, we decided not to do defensive checks in the iterators and iteration methods in case the collection is changed while iterating. That may be poorly documented though.
The rationale behind that decision is that we expect most uses of iteration methods to not require these checks. And we don't want to pay the price of runtime checks due to a minority of uses.
So when a concurrent modification happens, the behavior is unspecified.
Should we throw a ConcurrentModificationException if a list is modified in such a way that an active iteration becomes corrupted?
See implementation of DoubleLinkedQueue.
The text was updated successfully, but these errors were encountered: