The spec for ConcurrentModificationException says:
"Some Iterator implementations (including those of all the collection
implementations provided by the JRE) may choose to throw this exception
if this behavior is detected"
However, several new collections ((EnumSet, CopyOnWriteArrayList, CopyOnWriteArraySet) have "snapshot iterators" that do not throw ConcurrentModificationException under these circumstances. Thus, we should add some "wiggle words" to the above spec. Suggested change:
"Some Iterator implementations (including those of all the *general purpose*
collection implementations provided by the JRE) may choose to throw this
exception if this behavior is detected"
(The asterisks denote added prose, not emphasis; they should not be present
in the documentation.)
"Some Iterator implementations (including those of all the collection
implementations provided by the JRE) may choose to throw this exception
if this behavior is detected"
However, several new collections ((EnumSet, CopyOnWriteArrayList, CopyOnWriteArraySet) have "snapshot iterators" that do not throw ConcurrentModificationException under these circumstances. Thus, we should add some "wiggle words" to the above spec. Suggested change:
"Some Iterator implementations (including those of all the *general purpose*
collection implementations provided by the JRE) may choose to throw this
exception if this behavior is detected"
(The asterisks denote added prose, not emphasis; they should not be present
in the documentation.)