EA-899581 - REWA: ThreadingAssertions.createThreadAccessException

GitOrigin-RevId: e70ffff1110e2daa3870436890067e22b0f58eee
This commit is contained in:
Egor Ushakov
2023-09-01 12:33:30 +00:00
committed by intellij-monorepo-bot
parent 5ab7a59d0e
commit 5cdf2aaee7
@@ -1,10 +1,11 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.debugger.core.breakpoints
import com.intellij.debugger.engine.DebugProcess
import com.intellij.debugger.impl.DebuggerUtilsEx
import com.intellij.debugger.ui.breakpoints.LineBreakpoint
import com.intellij.openapi.application.ReadAction
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.project.Project
import com.intellij.xdebugger.XSourcePosition
@@ -64,10 +65,9 @@ class KotlinLineBreakpoint(
}
override fun getMethodName(): String? {
val element = sourcePosition?.elementAt?.getNonStrictParentOfType<KtElement>()
if (element is KtElement) {
element.containingNonLocalDeclaration()?.name?.let { return it }
}
ReadAction.compute<String, Throwable> {
sourcePosition?.elementAt?.getNonStrictParentOfType<KtElement>()?.containingNonLocalDeclaration()?.name
}?.let { return it }
return super.getMethodName()
}