Bug 428417 - ConcurrentModificationException in
AbstractMarkerAnnotationModel

The fDeletedAnnotations field in AbstractMarkerAnnotationModel uses
ArrayList, which is not thread safe and does not allow concurrent
modification and iteration. Introducing new locks around
fDeletedAnnotations seem to be dangerous. Replacing this with
CopyOnWriteArrayList however seem to be a better solution - it does not
add any new locks and should allow safe iteration while other thread
modifies the list. Looking at the usage of fDeletedAnnotations, it
should be OK to iterate on "old" state.

Change-Id: I17fea70fcccf578212e9fdb557a9f0f68aa64dc4
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
1 file changed