From abcdae8e694eb09236b9447778b355fb88960988 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 3 Feb 2016 19:24:27 +0300 Subject: [PATCH] Prevent recursion when computing parameter list of KtLightMethod (part 2) Use ClsWrapperStubPsiFactory when building light classes for decompiled kotlin classes --- .../org/jetbrains/kotlin/asJava/ClsWrapperStubPsiFactory.java | 2 +- .../idea/caches/resolve/IDELightClassGenerationSupport.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/ClsWrapperStubPsiFactory.java b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/ClsWrapperStubPsiFactory.java index 1ba10e255f5..321eb338fa6 100644 --- a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/ClsWrapperStubPsiFactory.java +++ b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/ClsWrapperStubPsiFactory.java @@ -29,7 +29,7 @@ import com.intellij.psi.stubs.StubElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -class ClsWrapperStubPsiFactory extends StubPsiFactory { +public class ClsWrapperStubPsiFactory extends StubPsiFactory { public static final Key ORIGIN = Key.create("ORIGIN"); private final StubPsiFactory delegate = new ClsStubPsiFactory(); diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IDELightClassGenerationSupport.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IDELightClassGenerationSupport.kt index 4c654a1e285..ba3a814c922 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IDELightClassGenerationSupport.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IDELightClassGenerationSupport.kt @@ -331,6 +331,7 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG correspondingClassOrObject: KtClassOrObject? ): ClsClassImpl? { val javaFileStub = ClsJavaStubByVirtualFileCache.getInstance(project).get(classFile) ?: return null + javaFileStub.psiFactory = ClsWrapperStubPsiFactory() val manager = PsiManager.getInstance(mirrorFile.project) val fakeFile = object : ClsFileImpl(ClassFileViewProvider(manager, classFile)) { override fun getNavigationElement(): PsiElement {