From 70745f233f336cc4007fa5ae0a7a0b98534f0e15 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 24 Jul 2019 17:07:31 +0900 Subject: [PATCH] Debugger: Fix reference value evaluation in Java contexts Before this commit, Kotlin evaluator used the precise value type for variable finding. As a result, VariableFinder often failed to find such a variable (cause the real one has a super type). --- .../kotlin/idea/debugger/evaluate/FrameInfo.kt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/idea/jvm-debugger/jvm-debugger-evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameInfo.kt b/idea/jvm-debugger/jvm-debugger-evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameInfo.kt index c3ab84a2ea4..b6c4ccbc514 100644 --- a/idea/jvm-debugger/jvm-debugger-evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameInfo.kt +++ b/idea/jvm-debugger/jvm-debugger-evaluation/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameInfo.kt @@ -12,14 +12,8 @@ import com.intellij.psi.PsiNameHelper import com.intellij.psi.PsiType import com.intellij.psi.search.GlobalSearchScope import com.sun.jdi.* -import org.jetbrains.eval4j.jdi.asValue -import org.jetbrains.kotlin.idea.debugger.getClassDescriptor import org.jetbrains.kotlin.idea.j2k.j2k -import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers import org.jetbrains.kotlin.psi.KtProperty -import org.jetbrains.kotlin.psi.KtPsiFactory -import org.jetbrains.kotlin.psi.psiUtil.quoteIfNeeded -import org.jetbrains.kotlin.types.typeUtil.makeNullable class FrameInfo private constructor(val project: Project, thisObject: Value?, variables: Map) { val thisObject = run { @@ -44,12 +38,6 @@ class FrameInfo private constructor(val project: Project, thisObject: Value?, va } private fun createKotlinProperty(project: Project, name: String, typeName: String, value: Value?): KtProperty? { - val actualClassDescriptor = value.asValue().asmType.getClassDescriptor(GlobalSearchScope.allScope(project)) - if (actualClassDescriptor != null && actualClassDescriptor.defaultType.arguments.isEmpty()) { - val renderedType = IdeDescriptorRenderers.SOURCE_CODE.renderType(actualClassDescriptor.defaultType.makeNullable()) - return KtPsiFactory(project).createProperty(name.quoteIfNeeded(), renderedType, false) - } - val className = typeName.replace("$", ".").substringBefore("[]") val classType = PsiType.getTypeByName(className, project, GlobalSearchScope.allScope(project))