[decompiler] add missing cache to annotation loader
it was missed during moving the code from intellij repository ^KTIJ-21613 fixed
This commit is contained in:
+8
-1
@@ -31,6 +31,8 @@ import org.jetbrains.kotlin.resolve.constants.ClassLiteralValue
|
||||
import org.jetbrains.kotlin.resolve.constants.ConstantValue
|
||||
import org.jetbrains.kotlin.resolve.constants.KClassValue
|
||||
import org.jetbrains.kotlin.serialization.deserialization.getClassId
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
|
||||
open class KotlinClsStubBuilder : ClsStubBuilder() {
|
||||
override fun getStubVersion() = ClassFileStubBuilder.STUB_VERSION + KotlinStubVersions.CLASSFILE_STUB_VERSION
|
||||
@@ -128,8 +130,13 @@ private class AnnotationLoaderForClassFileStubBuilder(
|
||||
private val cachedFileContent: ByteArray
|
||||
) : AbstractBinaryClassAnnotationLoader<ClassId, AnnotationLoaderForClassFileStubBuilder.AnnotationsClassIdContainer>(kotlinClassFinder) {
|
||||
|
||||
private val storage =
|
||||
LockBasedStorageManager.NO_LOCKS.createMemoizedFunction<KotlinJvmBinaryClass, AnnotationsClassIdContainer> { kotlinClass ->
|
||||
loadAnnotationsAndInitializers(kotlinClass)
|
||||
}
|
||||
|
||||
override fun getAnnotationsContainer(binaryClass: KotlinJvmBinaryClass): AnnotationsClassIdContainer {
|
||||
return loadAnnotationsAndInitializers(binaryClass)
|
||||
return storage(binaryClass)
|
||||
}
|
||||
|
||||
override fun getCachedFileContent(kotlinClass: KotlinJvmBinaryClass): ByteArray? {
|
||||
|
||||
Reference in New Issue
Block a user