diff --git a/java/execution/impl/src/com/intellij/execution/impl/DefaultJavaProgramRunner.java b/java/execution/impl/src/com/intellij/execution/impl/DefaultJavaProgramRunner.java index 27280b193c2c..626a47509144 100644 --- a/java/execution/impl/src/com/intellij/execution/impl/DefaultJavaProgramRunner.java +++ b/java/execution/impl/src/com/intellij/execution/impl/DefaultJavaProgramRunner.java @@ -69,10 +69,7 @@ public class DefaultJavaProgramRunner extends JavaPatchableProgramRunner { } @Override - protected RunContentDescriptor doExecute(@NotNull final Project project, - @NotNull final RunProfileState state, - final RunContentDescriptor contentToReuse, - @NotNull final ExecutionEnvironment env) throws ExecutionException { + protected RunContentDescriptor doExecute(@NotNull final RunProfileState state, @NotNull final ExecutionEnvironment env) throws ExecutionException { FileDocumentManager.getInstance().saveAllDocuments(); ExecutionResult executionResult; @@ -100,11 +97,11 @@ public class DefaultJavaProgramRunner extends JavaPatchableProgramRunner { onProcessStarted(env.getRunnerSettings(), executionResult); final RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, env); - Disposer.register(project, contentBuilder); + Disposer.register(env.getProject(), contentBuilder); if (shouldAddDefaultActions) { addDefaultActions(contentBuilder); } - return contentBuilder.showRunContent(contentToReuse); + return contentBuilder.showRunContent(env.getContentToReuse()); } @Deprecated diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java index d45be42bbbd9..4fc22b2e517b 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java @@ -25,7 +25,6 @@ import com.intellij.execution.runners.GenericProgramRunner; import com.intellij.execution.runners.RunContentBuilder; import com.intellij.execution.ui.RunContentDescriptor; import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; -import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -48,11 +47,8 @@ public class ExternalSystemTaskRunner extends GenericProgramRunner { @Nullable @Override - protected RunContentDescriptor doExecute(@NotNull Project project, - @NotNull RunProfileState state, - RunContentDescriptor contentToReuse, - @NotNull ExecutionEnvironment env) throws ExecutionException { + protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { ExecutionResult executionResult = state.execute(env.getExecutor(), this); - return executionResult == null ? null : new RunContentBuilder(executionResult, env).showRunContent(contentToReuse); + return executionResult == null ? null : new RunContentBuilder(executionResult, env).showRunContent(env.getContentToReuse()); } } 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 5443346c710c..3c59227eb85a 100644 --- a/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java +++ b/platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java @@ -40,15 +40,25 @@ public abstract class GenericProgramRunner exte ExecutionManager.getInstance(environment.getProject()).startRunProfile(new RunProfileStarter() { @Override public RunContentDescriptor execute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { - return postProcess(environment, doExecute(environment.getProject(), state, environment.getContentToReuse(), environment), callback); + 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(); + } } diff --git a/platform/lang-impl/src/com/intellij/execution/runners/DefaultProgramRunner.java b/platform/lang-impl/src/com/intellij/execution/runners/DefaultProgramRunner.java index 5f7321aa8068..f4cae36d1ffe 100644 --- a/platform/lang-impl/src/com/intellij/execution/runners/DefaultProgramRunner.java +++ b/platform/lang-impl/src/com/intellij/execution/runners/DefaultProgramRunner.java @@ -21,25 +21,19 @@ import com.intellij.execution.ExecutionResult; import com.intellij.execution.configurations.RunProfileState; import com.intellij.execution.ui.RunContentDescriptor; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; /** * @author spleaner */ public abstract class DefaultProgramRunner extends GenericProgramRunner { - @Override - protected RunContentDescriptor doExecute(@NotNull final Project project, - @NotNull final RunProfileState state, - final RunContentDescriptor contentToReuse, - @NotNull final ExecutionEnvironment env) throws ExecutionException { + protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { FileDocumentManager.getInstance().saveAllDocuments(); ExecutionResult executionResult = state.execute(env.getExecutor(), this); if (executionResult == null) { return null; } - return new RunContentBuilder(executionResult, env).showRunContent(contentToReuse); + return new RunContentBuilder(executionResult, env).showRunContent(env.getContentToReuse()); } - } diff --git a/plugins/ant/src/com/intellij/lang/ant/config/execution/AntRunner.java b/plugins/ant/src/com/intellij/lang/ant/config/execution/AntRunner.java index 1398718e293a..d66e041f1f16 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/execution/AntRunner.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/execution/AntRunner.java @@ -23,7 +23,6 @@ import com.intellij.execution.runners.ExecutionEnvironment; import com.intellij.execution.runners.GenericProgramRunner; import com.intellij.execution.ui.RunContentDescriptor; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,10 +31,7 @@ public class AntRunner extends GenericProgramRunner { @Nullable @Override - protected 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 { FileDocumentManager.getInstance().saveAllDocuments(); state.execute(environment.getExecutor(), this); return null; diff --git a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/XsltDebuggerRunner.java b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/XsltDebuggerRunner.java index f573f9442e64..5fb6888ec1e2 100644 --- a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/XsltDebuggerRunner.java +++ b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/XsltDebuggerRunner.java @@ -8,7 +8,6 @@ import com.intellij.execution.runners.DefaultProgramRunner; import com.intellij.execution.runners.ExecutionEnvironment; import com.intellij.execution.ui.RunContentDescriptor; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.project.Project; import com.intellij.xdebugger.XDebugProcess; import com.intellij.xdebugger.XDebugProcessStarter; import com.intellij.xdebugger.XDebugSession; @@ -19,11 +18,6 @@ import org.intellij.plugins.xsltDebugger.impl.XsltDebugProcess; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; -/* -* Created by IntelliJ IDEA. -* User: sweinreuter -* Date: 16.11.10 -*/ public class XsltDebuggerRunner extends DefaultProgramRunner { static final ThreadLocal ACTIVE = new ThreadLocal(); @@ -43,26 +37,20 @@ public class XsltDebuggerRunner extends DefaultProgramRunner { } @Override - protected RunContentDescriptor doExecute(@NotNull Project project, - @NotNull RunProfileState state, - RunContentDescriptor contentToReuse, - @NotNull ExecutionEnvironment env) throws ExecutionException { + protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { FileDocumentManager.getInstance().saveAllDocuments(); - return createContentDescriptor(project, state, contentToReuse, env); + return createContentDescriptor(state, env); } - protected RunContentDescriptor createContentDescriptor(Project project, - final RunProfileState runProfileState, - RunContentDescriptor contentToReuse, - final ExecutionEnvironment executionEnvironment) throws ExecutionException { + protected RunContentDescriptor createContentDescriptor(final RunProfileState runProfileState, final ExecutionEnvironment environment) throws ExecutionException { final XDebugSession debugSession = - XDebuggerManager.getInstance(project).startSession(this, executionEnvironment, contentToReuse, new XDebugProcessStarter() { + XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() { @NotNull public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException { ACTIVE.set(Boolean.TRUE); try { final XsltCommandLineState c = (XsltCommandLineState)runProfileState; - final ExecutionResult result = runProfileState.execute(executionEnvironment.getExecutor(), XsltDebuggerRunner.this); + final ExecutionResult result = runProfileState.execute(environment.getExecutor(), XsltDebuggerRunner.this); return new XsltDebugProcess(session, result, c.getExtensionData().getUserData(XsltDebuggerExtension.VERSION)); } finally { ACTIVE.remove();