summaryrefslogtreecommitdiff
path: root/platform/lang-api/src/com/intellij/execution/runners
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lang-api/src/com/intellij/execution/runners')
-rw-r--r--platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java13
-rw-r--r--platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java4
2 files changed, 16 insertions, 1 deletions
diff --git a/platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java b/platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java
index ce7145adeaf9..6b63ec402320 100644
--- a/platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java
+++ b/platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java
@@ -21,6 +21,7 @@ import com.intellij.execution.RunProfileStarter;
import com.intellij.execution.configurations.RunProfileState;
import com.intellij.execution.configurations.RunnerSettings;
import com.intellij.execution.ui.RunContentDescriptor;
+import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.AsyncResult;
import com.intellij.util.Consumer;
import com.intellij.util.ui.UIUtil;
@@ -61,7 +62,17 @@ public abstract class AsyncGenericProgramRunner<Settings extends RunnerSettings>
* @return RunProfileStarter async result
*/
@NotNull
- protected abstract AsyncResult<RunProfileStarter> prepare(@NotNull ExecutionEnvironment environment, @NotNull RunProfileState state) throws ExecutionException;
+ protected AsyncResult<RunProfileStarter> prepare(@NotNull ExecutionEnvironment environment, @NotNull RunProfileState state) throws ExecutionException {
+ return prepare(environment.getProject(), environment, state);
+ }
+
+ /**
+ * @deprecated override {@link #prepare(ExecutionEnvironment, com.intellij.execution.configurations.RunProfileState)} instead
+ */
+ @Deprecated
+ protected AsyncResult<RunProfileStarter> prepare(@NotNull Project project, @NotNull ExecutionEnvironment environment, @NotNull RunProfileState state) throws ExecutionException {
+ throw new UnsupportedOperationException();
+ }
private static void startRunProfile(@NotNull ExecutionEnvironment environment,
@NotNull RunProfileState state,
diff --git a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java
index b6c300c3f7e2..5a395ab5dd79 100644
--- a/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java
+++ b/platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java
@@ -112,6 +112,10 @@ public class ExecutionUtil {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
+ if (project.isDisposed()) {
+ return;
+ }
+
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
if (toolWindowManager.canShowNotification(toolWindowId)) {
//noinspection SSBasedInspection