From cd5e4068762207fcae5c5de5ad4fb80a2ed9dbdd Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Mon, 30 Nov 2015 13:58:13 +0300 Subject: [PATCH] Minor: fix warnings --- .../idea/debugger/evaluate/FrameVisitor.kt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameVisitor.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameVisitor.kt index 2920a2c0559..7f414df9d10 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameVisitor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/FrameVisitor.kt @@ -33,8 +33,8 @@ import org.jetbrains.kotlin.resolve.jvm.AsmTypes import org.jetbrains.org.objectweb.asm.Type class FrameVisitor(context: EvaluationContextImpl) { - private val project = context.getDebugProcess().getProject() - private val frame = context.getFrameProxy()?.getStackFrame() + private val project = context.debugProcess.project + private val frame = context.frameProxy?.stackFrame public fun findValue(name: String, asmType: Type?, checkType: Boolean, failIfNotFound: Boolean): Value? { if (frame == null) return null @@ -100,13 +100,12 @@ class FrameVisitor(context: EvaluationContextImpl) { } private fun isFunctionType(type: Type?): Boolean { - return type?.getSort() == Type.OBJECT && - type!!.getInternalName().startsWith(InlineCodegenUtil.NUMBERED_FUNCTION_PREFIX) + return type?.sort == Type.OBJECT && + type!!.internalName.startsWith(InlineCodegenUtil.NUMBERED_FUNCTION_PREFIX) } private fun findLocalVariable(name: String, asmType: Type?, checkType: Boolean): Value? { - val localVariable = frame!!.visibleVariableByName(name) - if (localVariable == null) return null + val localVariable = frame!!.visibleVariableByName(name) ?: return null val eval4jValue = frame.getValue(localVariable).asValue() val sharedVarValue = getValueIfSharedVar(eval4jValue, asmType, checkType) @@ -148,7 +147,7 @@ class FrameVisitor(context: EvaluationContextImpl) { if (!shouldCheckType || asmType == null || value.asmType == asmType) return true if (project == null) return false - if ((value.obj() as? com.sun.jdi.ObjectReference)?.referenceType().isSubclass(asmType.getClassName())) { + if ((value.obj() as? com.sun.jdi.ObjectReference)?.referenceType().isSubclass(asmType.className)) { return true } @@ -163,8 +162,7 @@ class FrameVisitor(context: EvaluationContextImpl) { if (obj !is ObjectReference) return null val _class = obj.referenceType() - val field = _class.fieldByName(name) - if (field == null) return null + val field = _class.fieldByName(name) ?: return null val fieldValue = obj.getValue(field).asValue() if (isValueOfCorrectType(fieldValue, asmType, checkType)) return fieldValue @@ -176,7 +174,7 @@ class FrameVisitor(context: EvaluationContextImpl) { } private fun Value.isSharedVar(): Boolean { - return this.asmType.getSort() == Type.OBJECT && this.asmType.getInternalName().startsWith(AsmTypes.REF_TYPE_PREFIX) + return this.asmType.sort == Type.OBJECT && this.asmType.internalName.startsWith(AsmTypes.REF_TYPE_PREFIX) } fun getValueIfSharedVar(value: Value, expectedType: Type?, checkType: Boolean): Value? {