From f060604d98226e3b9b8f470edd512e98d95077b4 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 22 Mar 2018 13:05:00 +0300 Subject: [PATCH] Add a cache for KtImportDirective::importedFqName It's very useful for Spring users because KotlinAnnotatedElementsSearcher calls PsiBasedClassResolver::canBeTargetReference rather frequently on a file and the latter function retreives importedFqName for each import in the file that becomes a problem because computing fq-name from PSI is a heavy computation #KT-23380 In Progress --- .../kotlin/psi/KtImportDirective.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtImportDirective.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtImportDirective.java index 73bb8a92f7c..bbbdb04172b 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtImportDirective.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtImportDirective.java @@ -37,6 +37,8 @@ public class KtImportDirective extends KtElementImplStub R accept(@NotNull KtVisitor visitor, D data) { return visitor.visitImportDirective(this, data); @@ -78,7 +80,16 @@ public class KtImportDirective extends KtElementImplStub