[FE] Do not repeatedly load inner classes from class files.
Java protobufs generate a lot of inner classes and when compiling Kotlin wrappers for those Java protobufs the inner classes can be loaded hundreds of times leading to out of memory. This change avoids reloading by fixing a bug in the cache implementation that caused inner classes to not be cached.
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ
|
||||
classId.outerClassId?.let { outerClassId ->
|
||||
val outerClass = outerClassFromRequest ?: findClass(outerClassId, searchScope)
|
||||
|
||||
return if (outerClass is BinaryJavaClass)
|
||||
return@getOrPut if (outerClass is BinaryJavaClass)
|
||||
outerClass.findInnerClass(classId.shortClassName, classFileContentFromRequest)
|
||||
else
|
||||
outerClass?.findInnerClass(classId.shortClassName)
|
||||
|
||||
Reference in New Issue
Block a user