Skip to content

I20201005-0600

@trancexpress trancexpress tagged this 05 Oct 08:26
Race conditions can occur when
JavaModelManager.PerProjectInfo.indexingSecondaryCache is accessed, e.g.
when deleting Java sources with secondary types, while the indexing of
those secondary types is stil ongoing. In particular, its possible that
a secondary type is being added to a cache "at the same time" as a
secondary type is being removed from the cache, or while the cache is
being iterated over due to a merge operation. Both can result in
concurrent modification exceptions.

This change adds extra synchronization to prevent concurrent container
access and modifications; the cache is changed to a synchronized map and
iterating over it is synchronized on the map.

Change-Id: I5a9889ce914cf4c11e4245ec4891f2f41c2fe07e
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Assets 2
Loading