diff --git a/plugins/allopen/allopen-ide/build.gradle.kts b/plugins/allopen/allopen-ide/build.gradle.kts index 1ad5dd989a3..4febb10fb60 100644 --- a/plugins/allopen/allopen-ide/build.gradle.kts +++ b/plugins/allopen/allopen-ide/build.gradle.kts @@ -14,7 +14,7 @@ dependencies { compile(project(":idea:idea-jvm")) compile(project(":idea:idea-jps-common")) compile(project(":plugins:annotation-based-compiler-plugins-ide-support")) - compileOnly(intellijDep()) { includeJars("openapi", "idea") } + compileOnly(intellijDep()) { includeJars("openapi", "idea", "util") } excludeInAndroidStudio(rootProject) { compileOnly(intellijPluginDep("maven")) { includeJars("maven") } } compileOnly(intellijPluginDep("gradle")) { includeJars("gradle-tooling-api", "gradle", rootProject = rootProject) } } diff --git a/plugins/allopen/allopen-ide/src/IdeAllOpenDeclarationAttributeAltererExtension.kt b/plugins/allopen/allopen-ide/src/IdeAllOpenDeclarationAttributeAltererExtension.kt index 26f6751f462..b418ca988db 100644 --- a/plugins/allopen/allopen-ide/src/IdeAllOpenDeclarationAttributeAltererExtension.kt +++ b/plugins/allopen/allopen-ide/src/IdeAllOpenDeclarationAttributeAltererExtension.kt @@ -24,20 +24,24 @@ import com.intellij.openapi.roots.ProjectRootModificationTracker import com.intellij.psi.util.CachedValue import com.intellij.psi.util.CachedValueProvider import com.intellij.psi.util.CachedValuesManager +import com.intellij.util.containers.ContainerUtil import org.jetbrains.kotlin.allopen.AbstractAllOpenDeclarationAttributeAltererExtension import org.jetbrains.kotlin.psi.KtModifierListOwner import org.jetbrains.kotlin.allopen.AllOpenCommandLineProcessor.Companion.PLUGIN_ID import org.jetbrains.kotlin.allopen.AllOpenCommandLineProcessor.Companion.ANNOTATION_OPTION import org.jetbrains.kotlin.annotation.plugin.ide.getSpecialAnnotations -import java.util.* +import java.util.concurrent.ConcurrentMap class IdeAllOpenDeclarationAttributeAltererExtension(val project: Project) : AbstractAllOpenDeclarationAttributeAltererExtension() { private companion object { val ANNOTATION_OPTION_PREFIX = "plugin:$PLUGIN_ID:${ANNOTATION_OPTION.name}=" } - private val cache: CachedValue>> = cachedValue(project) { - CachedValueProvider.Result.create(WeakHashMap>(), ProjectRootModificationTracker.getInstance(project)) + private val cache: CachedValue>> = cachedValue(project) { + CachedValueProvider.Result.create( + ContainerUtil.createConcurrentWeakMap>(), + ProjectRootModificationTracker.getInstance(project) + ) } override fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner?): List { diff --git a/plugins/noarg/noarg-ide/build.gradle.kts b/plugins/noarg/noarg-ide/build.gradle.kts index 34bb969dd46..1bf77f4c2b7 100644 --- a/plugins/noarg/noarg-ide/build.gradle.kts +++ b/plugins/noarg/noarg-ide/build.gradle.kts @@ -15,7 +15,7 @@ dependencies { compile(project(":idea")) compile(project(":idea:idea-jps-common")) compile(project(":plugins:annotation-based-compiler-plugins-ide-support")) - compileOnly(intellijDep()) { includeJars("openapi", "idea") } + compileOnly(intellijDep()) { includeJars("openapi", "idea", "util") } excludeInAndroidStudio(rootProject) { compileOnly(intellijPluginDep("maven")) { includeJars("maven") } } compileOnly(intellijPluginDep("gradle")) { includeJars("gradle-tooling-api", "gradle", rootProject = rootProject) } } diff --git a/plugins/noarg/noarg-ide/src/IdeNoArgDeclarationChecker.kt b/plugins/noarg/noarg-ide/src/IdeNoArgDeclarationChecker.kt index f39aa122fd1..8e68eb485d4 100644 --- a/plugins/noarg/noarg-ide/src/IdeNoArgDeclarationChecker.kt +++ b/plugins/noarg/noarg-ide/src/IdeNoArgDeclarationChecker.kt @@ -23,20 +23,24 @@ import com.intellij.openapi.roots.ProjectRootModificationTracker import com.intellij.psi.util.CachedValue import com.intellij.psi.util.CachedValueProvider import com.intellij.psi.util.CachedValuesManager +import com.intellij.util.containers.ContainerUtil import org.jetbrains.kotlin.annotation.plugin.ide.getSpecialAnnotations import org.jetbrains.kotlin.noarg.NoArgCommandLineProcessor.Companion.ANNOTATION_OPTION import org.jetbrains.kotlin.noarg.NoArgCommandLineProcessor.Companion.PLUGIN_ID import org.jetbrains.kotlin.noarg.diagnostic.AbstractNoArgDeclarationChecker import org.jetbrains.kotlin.psi.KtModifierListOwner -import java.util.* +import java.util.concurrent.ConcurrentMap class IdeNoArgDeclarationChecker(val project: Project) : AbstractNoArgDeclarationChecker() { private companion object { val ANNOTATION_OPTION_PREFIX = "plugin:$PLUGIN_ID:${ANNOTATION_OPTION.name}=" } - private val cache: CachedValue>> = cachedValue(project) { - CachedValueProvider.Result.create(WeakHashMap>(), ProjectRootModificationTracker.getInstance(project)) + private val cache: CachedValue>> = cachedValue(project) { + CachedValueProvider.Result.create( + ContainerUtil.createConcurrentWeakMap>(), + ProjectRootModificationTracker.getInstance(project) + ) } override fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner?): List { diff --git a/plugins/sam-with-receiver/sam-with-receiver-ide/src/IdeSamWithReceiverComponentContributor.kt b/plugins/sam-with-receiver/sam-with-receiver-ide/src/IdeSamWithReceiverComponentContributor.kt index ac4e664085f..82c42ed0d3d 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-ide/src/IdeSamWithReceiverComponentContributor.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-ide/src/IdeSamWithReceiverComponentContributor.kt @@ -21,6 +21,7 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ProjectRootModificationTracker import com.intellij.psi.util.CachedValueProvider.Result import com.intellij.psi.util.CachedValuesManager +import com.intellij.util.containers.ContainerUtil import org.jetbrains.kotlin.analyzer.ModuleInfo import org.jetbrains.kotlin.annotation.plugin.ide.getSpecialAnnotations import org.jetbrains.kotlin.container.StorageComponentContainer @@ -43,7 +44,12 @@ class IdeSamWithReceiverComponentContributor(val project: Project) : StorageComp } private val cache = CachedValuesManager.getManager(project).createCachedValue({ - Result.create(WeakHashMap>(), ProjectRootModificationTracker.getInstance(project)) + Result.create( + ContainerUtil.createConcurrentWeakMap>(), + ProjectRootModificationTracker.getInstance( + project + ) + ) }, /* trackValue = */ false) private fun getAnnotationsForModule(module: Module): List {