Is iterating over a list retrieved in a synchronized block thread-safe?
问题 I am a bit confused regarding one pattern I have seen in some legacy code of ours. The controller uses a map as a cache, with an approach that should be thread safe, however I am still not confident it indeed is. We have a map, which is properly synchronized during addition and retrieval, however, there is a bit of logic outside of the synchronized block, that does some additional filtering. ( the map itself and the lists are never accessed outside of this method , so concurrent modification