diff options
Diffstat (limited to 'platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java')
-rw-r--r-- | platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java index adbd04e822e6..3c59227eb85a 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java +++ b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java @@ -18,7 +18,6 @@ package com.intellij.execution.runners; import com.intellij.execution.ExecutionException; import com.intellij.execution.ExecutionManager; -import com.intellij.execution.Executor; import com.intellij.execution.RunProfileStarter; import com.intellij.execution.configurations.RunProfileState; import com.intellij.execution.configurations.RunnerSettings; @@ -36,24 +35,30 @@ public abstract class GenericProgramRunner<Settings extends RunnerSettings> exte public static final String CONTENT_TO_REUSE = CONTENT_TO_REUSE_DATA_KEY.getName(); @Override - protected void execute(@NotNull ExecutionEnvironment environment, @Nullable final Callback callback, @NotNull Project project, @NotNull RunProfileState state) + protected void execute(@NotNull ExecutionEnvironment environment, @Nullable final Callback callback, @NotNull RunProfileState state) throws ExecutionException { - ExecutionManager.getInstance(project).startRunProfile(new RunProfileStarter() { + ExecutionManager.getInstance(environment.getProject()).startRunProfile(new RunProfileStarter() { @Override - public RunContentDescriptor execute(@NotNull Project project, - @NotNull Executor executor, - @NotNull RunProfileState state, - @Nullable RunContentDescriptor contentToReuse, - @NotNull ExecutionEnvironment environment) throws ExecutionException { - return postProcess(environment, doExecute(project, state, contentToReuse, environment), callback); + public RunContentDescriptor execute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { + return postProcess(environment, doExecute(state, environment), callback); } }, state, environment); } @Nullable - protected abstract RunContentDescriptor doExecute(@NotNull Project project, - @NotNull RunProfileState state, - @Nullable RunContentDescriptor contentToReuse, - @NotNull ExecutionEnvironment environment) throws ExecutionException; + protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { + return doExecute(environment.getProject(), state, environment.getContentToReuse(), environment); + } + @Deprecated + @Nullable + /** + * @deprecated to remove in IDEA 16 + */ + protected RunContentDescriptor doExecute(@NotNull Project project, + @NotNull RunProfileState state, + @Nullable RunContentDescriptor contentToReuse, + @NotNull ExecutionEnvironment environment) throws ExecutionException { + throw new AbstractMethodError(); + } } |