JS: fix concurrent access to NameSuggestion.cache

This commit is contained in:
Anton Bannykh
2018-11-06 18:36:29 +03:00
parent 5dae00182d
commit 82268cd95d
@@ -40,7 +40,7 @@ import java.util.*
* [NameSuggestion] supports caching. * [NameSuggestion] supports caching.
*/ */
class NameSuggestion { class NameSuggestion {
private val cache: MutableMap<DeclarationDescriptor, SuggestedName?> = WeakHashMap() private val cache: MutableMap<DeclarationDescriptor, SuggestedName?> = Collections.synchronizedMap(WeakHashMap())
/** /**
* Generates names for declarations. Name consists of the following parts: * Generates names for declarations. Name consists of the following parts: