Temporarily caching resolved classes in the trace (for existing code in the IDE to be happy)
This commit is contained in:
+7
-2
@@ -151,11 +151,16 @@ public class LazyJavaClassMemberScope(
|
||||
val jNestedClass = nestedClassIndex()[name]
|
||||
if (jNestedClass == null)
|
||||
null
|
||||
else
|
||||
LazyJavaClassDescriptor(c,
|
||||
else {
|
||||
// TODO: this caching is a temporary workaround, should be replaced with properly caching the whole LazyJavaSubModule
|
||||
val alreadyResolved = c.javaResolverCache.getClass(jNestedClass)
|
||||
if (alreadyResolved != null)
|
||||
alreadyResolved
|
||||
else LazyJavaClassDescriptor(c,
|
||||
getContainingDeclaration(),
|
||||
DescriptorUtils.getFQName(getContainingDeclaration()).child(name).toSafe(),
|
||||
jNestedClass)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getClassifier(name: Name): ClassifierDescriptor? = if (enumClassObject) null else nestedClasses(name)
|
||||
|
||||
+8
-2
@@ -27,8 +27,14 @@ public abstract class LazyJavaPackageFragmentScope(
|
||||
val javaClass = c.finder.findClass(fqName)
|
||||
if (javaClass == null)
|
||||
c.javaClassResolver.resolveClassByFqName(fqName)
|
||||
else
|
||||
LazyJavaClassDescriptor(c.withTypes(TypeParameterResolver.EMPTY), packageFragment, fqName, javaClass)
|
||||
else {
|
||||
// TODO: this caching is a temporary workaround, should be replaced with properly caching the whole LazyJavaSubModule
|
||||
val cached = c.javaResolverCache.getClass(javaClass)
|
||||
if (cached != null)
|
||||
cached
|
||||
else
|
||||
LazyJavaClassDescriptor(c.withTypes(TypeParameterResolver.EMPTY), packageFragment, fqName, javaClass)
|
||||
}
|
||||
}
|
||||
|
||||
protected fun computeMemberIndexForSamConstructors(delegate: MemberIndex): MemberIndex = object : MemberIndex by delegate {
|
||||
|
||||
Reference in New Issue
Block a user