From 397cafcbe8954ec6542d295e9438a86ca679d235 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 2 Jan 2023 23:56:14 +0100 Subject: [PATCH] Remove unneeded runReadAction in getExceptionMessage Read action is not needed because at the only call site where we try to read the PSI element text we do it via `Document.getCharsSequence` which does not require read action. #KT-54971 Fixed --- .../frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt index 60fced5577a..0f70fd34693 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt @@ -5,14 +5,12 @@ package org.jetbrains.kotlin.util -import com.intellij.openapi.application.ApplicationManager - fun getExceptionMessage( subsystemName: String, message: String, cause: Throwable?, location: String? -): String = ApplicationManager.getApplication().runReadAction { +): String = buildString { append(subsystemName).append(" Internal error: ").appendLine(message) @@ -27,4 +25,3 @@ fun getExceptionMessage( append(cause.stackTrace?.firstOrNull()?.toString() ?: "unknown") } } -}