From 3c37594a15cfd98bafbd918f92a0dd6ecfcd84f3 Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Wed, 24 Dec 2025 16:40:31 +0100 Subject: [PATCH] cleanup [commands]: don't do concatenations unless necessary GitOrigin-RevId: fd3e2d05a6dfd3d1d1c132b711bcd343c9b2b7f9 --- .../openapi/command/impl/CoreCommandProcessor.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/core-impl/src/com/intellij/openapi/command/impl/CoreCommandProcessor.java b/platform/core-impl/src/com/intellij/openapi/command/impl/CoreCommandProcessor.java index 9d93f23cb6dc..117bac413227 100644 --- a/platform/core-impl/src/com/intellij/openapi/command/impl/CoreCommandProcessor.java +++ b/platform/core-impl/src/com/intellij/openapi/command/impl/CoreCommandProcessor.java @@ -171,8 +171,10 @@ public class CoreCommandProcessor extends CommandProcessorEx { } if (currentCommand != null) { - LOG.debug("startCommand failed: name = " + name + ", groupId = " + groupId + - ". Another command is already running: name = " + currentCommand.getName() + ", groupId = " + currentCommand.getGroupId()); + if (LOG.isDebugEnabled()) { + LOG.debug("startCommand failed: name = " + name + ", groupId = " + groupId + ". " + + "Another command is already running: name = " + currentCommand.getName() + ", groupId = " + currentCommand.getGroupId()); + } return null; } @@ -209,7 +211,9 @@ public class CoreCommandProcessor extends CommandProcessorEx { @Override public void leaveModal() { ThreadingAssertions.assertEventDispatchThread(); - LOG.assertTrue(currentCommand == null, "Command must not run: " + currentCommand); + if (currentCommand != null) { + LOG.error("Command must not run: " + currentCommand); + } currentCommand = interruptedCommands.pop(); if (currentCommand != null) { fireCommandStarted(); @@ -367,7 +371,9 @@ public class CoreCommandProcessor extends CommandProcessorEx { currentCommand = null; eventPublisher.commandFinished(event); } - LOG.debug("finishCommand: name = " + event.getCommandName() + ", groupId = " + event.getCommandGroupId()); + if (LOG.isDebugEnabled()) { + LOG.debug("finishCommand: name = " + event.getCommandName() + ", groupId = " + event.getCommandGroupId()); + } } private @NotNull CommandEvent createCurrentCommandEvent() {