From 05e3463f192efcc4ba774520eddf195fee50a2d3 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Mon, 15 Aug 2022 21:18:44 +0400 Subject: [PATCH] report EDT activity for slow EDT actions 2 GitOrigin-RevId: 96124815091ca7106cc8c7e4f8954be545f944cc --- .../openapi/actionSystem/impl/ActionUpdater.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionUpdater.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionUpdater.java index 2b99f6f816a1..34379d888726 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionUpdater.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionUpdater.java @@ -232,10 +232,17 @@ final class ActionUpdater { } if (myCurEDTPerformMillis > 200) { Throwable throwable = new Throwable(elapsedReport(myCurEDTPerformMillis, true, operationName) + OLD_EDT_MSG_SUFFIX); - for (Throwable trace : Objects.requireNonNullElse(edtTracesRef.get(), FList.emptyList())) { - throwable.addSuppressed(trace); + FList edtTraces = edtTracesRef.get(); + // do not report pauses without EDT traces (e.g. due to debugging) + if (edtTraces != null && edtTraces.size() > 0) { + for (Throwable trace : edtTraces) { + throwable.addSuppressed(trace); + } + LOG.error(throwable); + } + else { + LOG.warn(throwable); } - LOG.error(throwable); } myCurEDTWaitMillis = myCurEDTPerformMillis = 0L; }