[SLC] fix leak from annotations
^KT-54051
This commit is contained in:
committed by
Space Team
parent
012152e7b6
commit
1d62445b88
+7
-5
@@ -51,8 +51,8 @@ internal open class SymbolLightClass(classOrObject: KtClassOrObject, ktModule: K
|
||||
}
|
||||
|
||||
private val _modifierList: PsiModifierList? by lazyPub {
|
||||
withNamedClassOrObjectSymbol { classOrObjectSymbol ->
|
||||
val lazyModifiers = lazy {
|
||||
val lazyModifiers = lazy {
|
||||
withNamedClassOrObjectSymbol { classOrObjectSymbol ->
|
||||
buildSet {
|
||||
add(classOrObjectSymbol.toPsiVisibilityForClass(isNested = !isTopLevel))
|
||||
addIfNotNull(classOrObjectSymbol.computeSimpleModality())
|
||||
@@ -61,17 +61,19 @@ internal open class SymbolLightClass(classOrObject: KtClassOrObject, ktModule: K
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val lazyAnnotations = lazyPub {
|
||||
val lazyAnnotations = lazyPub {
|
||||
withNamedClassOrObjectSymbol { classOrObjectSymbol ->
|
||||
classOrObjectSymbol.computeAnnotations(
|
||||
parent = this@SymbolLightClass,
|
||||
nullability = NullabilityType.Unknown,
|
||||
annotationUseSiteTarget = null,
|
||||
)
|
||||
}
|
||||
|
||||
SymbolLightClassModifierList(this@SymbolLightClass, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
SymbolLightClassModifierList(this@SymbolLightClass, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
override fun getModifierList(): PsiModifierList? = _modifierList
|
||||
|
||||
+5
-5
@@ -69,20 +69,20 @@ class SymbolLightClassForFacade(
|
||||
|
||||
val lazyModifiers = lazyOf(setOf(PsiModifier.PUBLIC, PsiModifier.FINAL))
|
||||
|
||||
withFileSymbols { fileSymbols ->
|
||||
val lazyAnnotations = lazyPub {
|
||||
val lazyAnnotations = lazyPub {
|
||||
withFileSymbols { fileSymbols ->
|
||||
fileSymbols.flatMap {
|
||||
it.computeAnnotations(
|
||||
this@SymbolLightClassForFacade,
|
||||
NullabilityType.Unknown,
|
||||
AnnotationUseSiteTarget.FILE,
|
||||
includeAnnotationsWithoutSite = false
|
||||
includeAnnotationsWithoutSite = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SymbolLightClassModifierList(this@SymbolLightClassForFacade, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
SymbolLightClassModifierList(this@SymbolLightClassForFacade, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
override fun getModifierList(): PsiModifierList = _modifierList
|
||||
|
||||
+7
-5
@@ -25,8 +25,8 @@ internal abstract class SymbolLightInterfaceOrAnnotationClass(classOrObject: KtC
|
||||
}
|
||||
|
||||
private val _modifierList: PsiModifierList? by lazyPub {
|
||||
withNamedClassOrObjectSymbol { classOrObjectSymbol ->
|
||||
val lazyModifiers = lazy {
|
||||
val lazyModifiers = lazy {
|
||||
withNamedClassOrObjectSymbol { classOrObjectSymbol ->
|
||||
buildSet {
|
||||
add(classOrObjectSymbol.toPsiVisibilityForClass(isNested = !isTopLevel))
|
||||
add(PsiModifier.ABSTRACT)
|
||||
@@ -35,17 +35,19 @@ internal abstract class SymbolLightInterfaceOrAnnotationClass(classOrObject: KtC
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val lazyAnnotations = lazyPub {
|
||||
val lazyAnnotations = lazyPub {
|
||||
withNamedClassOrObjectSymbol { classOrObjectSymbol ->
|
||||
classOrObjectSymbol.computeAnnotations(
|
||||
parent = this@SymbolLightInterfaceOrAnnotationClass,
|
||||
nullability = NullabilityType.Unknown,
|
||||
annotationUseSiteTarget = null,
|
||||
)
|
||||
}
|
||||
|
||||
SymbolLightClassModifierList(this@SymbolLightInterfaceOrAnnotationClass, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
SymbolLightClassModifierList(this@SymbolLightInterfaceOrAnnotationClass, lazyModifiers, lazyAnnotations)
|
||||
}
|
||||
|
||||
override fun isInterface(): Boolean = true
|
||||
|
||||
Reference in New Issue
Block a user