Issue 336 - CopyOnWriteArrayList.subList() ConcurrentModificationException (opens in new tab)
Java's CopyOnWriteArrayList gives us a snapshot iterator for fast reading. However, its subList() is not snapshot, and will break if the list is changed. In this newsletter we look at a way to make a safe subList() copy, using the iterator and an AbstractList.
Read the original article