Remove unused modification tracker in KotlinClassInnerStuffCache

'dropCaches()' is not used anywhere both in the compiler and in the IDE.
This commit is contained in:
Yan Zhulanow
2022-03-03 17:14:28 +09:00
parent f237631f05
commit 955d0841bd
5 changed files with 5 additions and 13 deletions
@@ -30,7 +30,7 @@ open class KtLightClassForDecompiledDeclaration(
private val myInnersCache = KotlinClassInnerStuffCache( private val myInnersCache = KotlinClassInnerStuffCache(
myClass = this, myClass = this,
externalDependencies = listOf(KotlinModificationTrackerService.getInstance(manager.project).outOfBlockModificationTracker), dependencies = listOf(KotlinModificationTrackerService.getInstance(manager.project).outOfBlockModificationTracker),
lazyCreator = LightClassesLazyCreator(project) lazyCreator = LightClassesLazyCreator(project)
) )
@@ -66,7 +66,7 @@ abstract class FirLightClassBase protected constructor(manager: PsiManager) : Li
private val myInnersCache = KotlinClassInnerStuffCache( private val myInnersCache = KotlinClassInnerStuffCache(
myClass = this@FirLightClassBase, myClass = this@FirLightClassBase,
externalDependencies = listOf(manager.project.createProjectWideOutOfBlockModificationTracker()), dependencies = listOf(manager.project.createProjectWideOutOfBlockModificationTracker()),
lazyCreator = FirLightClassesLazyCreator(project) lazyCreator = FirLightClassesLazyCreator(project)
) )
@@ -6,7 +6,6 @@
package org.jetbrains.kotlin.asJava.classes package org.jetbrains.kotlin.asJava.classes
import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.util.SimpleModificationTracker
import com.intellij.psi.* import com.intellij.psi.*
import com.intellij.psi.impl.PsiClassImplUtil import com.intellij.psi.impl.PsiClassImplUtil
import com.intellij.psi.impl.PsiImplUtil import com.intellij.psi.impl.PsiImplUtil
@@ -21,12 +20,9 @@ import org.jetbrains.kotlin.utils.SmartList
class KotlinClassInnerStuffCache( class KotlinClassInnerStuffCache(
private val myClass: PsiExtensibleClass, private val myClass: PsiExtensibleClass,
externalDependencies: List<Any>, private val dependencies: List<Any>,
private val lazyCreator: LazyCreator, private val lazyCreator: LazyCreator,
) { ) {
private val myTracker = SimpleModificationTracker()
private val dependencies: List<Any> = externalDependencies + myTracker
abstract class LazyCreator { abstract class LazyCreator {
abstract fun <T : Any> get(initializer: () -> T, dependencies: List<Any>): Lazy<T> abstract fun <T : Any> get(initializer: () -> T, dependencies: List<Any>): Lazy<T>
} }
@@ -182,10 +178,6 @@ class KotlinClassInnerStuffCache(
} }
} }
fun dropCaches() {
myTracker.incModificationCount()
}
companion object { companion object {
private const val VALUES_METHOD = "values" private const val VALUES_METHOD = "values"
private const val VALUE_OF_METHOD = "valueOf" private const val VALUE_OF_METHOD = "valueOf"
@@ -32,7 +32,7 @@ abstract class KtLightClassBase protected constructor(manager: PsiManager)
: AbstractLightClass(manager, KotlinLanguage.INSTANCE), KtLightClass, PsiExtensibleClass { : AbstractLightClass(manager, KotlinLanguage.INSTANCE), KtLightClass, PsiExtensibleClass {
protected open val myInnersCache = KotlinClassInnerStuffCache( protected open val myInnersCache = KotlinClassInnerStuffCache(
myClass = this, myClass = this,
externalDependencies = listOf(KotlinModificationTrackerService.getInstance(manager.project).outOfBlockModificationTracker), dependencies = listOf(KotlinModificationTrackerService.getInstance(manager.project).outOfBlockModificationTracker),
lazyCreator = LightClassesLazyCreator(project) lazyCreator = LightClassesLazyCreator(project)
) )
@@ -74,7 +74,7 @@ abstract class KtLightClassForSourceDeclaration(
override val myInnersCache: KotlinClassInnerStuffCache = KotlinClassInnerStuffCache( override val myInnersCache: KotlinClassInnerStuffCache = KotlinClassInnerStuffCache(
myClass = this, myClass = this,
externalDependencies = classOrObject.getExternalDependencies(), dependencies = classOrObject.getExternalDependencies(),
lazyCreator = LightClassesLazyCreator(project) lazyCreator = LightClassesLazyCreator(project)
) )