From 88847465de22fcaff94803bc15edbfaec2c7715b Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Thu, 16 Aug 2018 23:41:04 +0300 Subject: [PATCH] IDEA-197127 Restart tests opens a new tab instead of reusing current tab After-review refactoring --- .../com/intellij/execution/impl/ExecutionManagerImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java index b2d40cdf7539..bc14f84518b7 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java @@ -84,12 +84,12 @@ public abstract class ExecutionManagerImpl extends ExecutionManager implements D return processHandler != null && !processHandler.isProcessTerminated(); } - private static void start(@NotNull ExecutionEnvironment environment) { + private static void restart(@NotNull ExecutionEnvironment environment) { //start() can be called during restartRunProfile() after pretty long 'awaitTermination()' so we have to check if the project is still here if (environment.getProject().isDisposed()) return; RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings(); - ProgramRunnerUtil.executeConfiguration(environment, settings != null && settings.isEditBeforeRun(), environment.getExecutionId() == 0); + ProgramRunnerUtil.executeConfiguration(environment, settings != null && settings.isEditBeforeRun(), true); } private static boolean userApprovesStopForSameTypeConfigurations(Project project, String configName, int instancesCount) { @@ -418,8 +418,7 @@ public abstract class ExecutionManagerImpl extends ExecutionManager implements D } } myAwaitingRunProfiles.remove(environment.getRunProfile()); - environment.setExecutionId(0);// At restart we have to assign new execution ID and therefore reuse 'just stopped' contents if any - start(environment); + restart(environment); } }, 50); }