avoid misuse (remove execute(env) from util)

This commit is contained in:
Vladimir Krivosheev
2014-08-14 08:15:35 +02:00
parent 460f62fbdd
commit 66f67529fa
8 changed files with 15 additions and 15 deletions
@@ -59,7 +59,7 @@ public class JavaExecutionUtil {
final DefaultRunProfile profile = new DefaultRunProfile(project, cmdLine, contentName, icon, filters);
ExecutionEnvironmentBuilder builder = ExecutionEnvironmentBuilder.createOrNull(project, DefaultRunExecutor.getRunExecutorInstance(), profile);
if (builder != null) {
ExecutionUtil.execute(builder.build());
builder.buildAndExecute();
return true;
}
return false;
@@ -80,7 +80,7 @@ public final class JavadocGenerationManager implements PersistentStateComponent<
public void generateJavadoc(AnalysisScope scope) {
myConfiguration.setGenerationScope(scope);
try {
ExecutionUtil.execute(ExecutionEnvironmentBuilder.create(myProject, DefaultRunExecutor.getRunExecutorInstance(), myConfiguration).build());
ExecutionEnvironmentBuilder.create(myProject, DefaultRunExecutor.getRunExecutorInstance(), myConfiguration).buildAndExecute();
}
catch (ExecutionException e) {
ExecutionErrorDialog.show(e, CommonBundle.getErrorTitle(), myProject);
@@ -256,4 +256,9 @@ public final class ExecutionEnvironmentBuilder {
}
return environment;
}
public void buildAndExecute() throws ExecutionException {
ExecutionEnvironment environment = build();
myRunner.execute(environment);
}
}
@@ -169,9 +169,4 @@ public class ExecutionUtil {
return null;
}
}
public static void execute(@NotNull ExecutionEnvironment environment) throws ExecutionException {
//noinspection ConstantConditions
environment.getRunner().execute(environment);
}
}
@@ -241,11 +241,11 @@ public class AbstractRerunFailedTestsAction extends AnAction implements AnAction
private void performAction(ProgramRunner runner, MyRunProfile profile, Executor executor) {
try {
runner.execute(new ExecutionEnvironmentBuilder(myEnvironment)
.runner(runner)
.executor(executor)
.runProfile(profile)
.build());
new ExecutionEnvironmentBuilder(myEnvironment)
.runner(runner)
.executor(executor)
.runProfile(profile)
.buildAndExecute();
}
catch (ExecutionException e1) {
LOG.error(e1);
@@ -439,7 +439,7 @@ public class TestPackage extends TestObject {
try {
Executor executor = myConsoleProperties.isDebug() ? DefaultDebugExecutor.getDebugExecutorInstance()
: DefaultRunExecutor.getRunExecutorInstance();
ExecutionUtil.execute(ExecutionEnvironmentBuilder.create(myProject, executor, myConfiguration).contentToReuse(null).build());
ExecutionEnvironmentBuilder.create(myProject, executor, myConfiguration).contentToReuse(null).buildAndExecute();
Balloon balloon = myToolWindowManager.getToolWindowBalloon(myTestRunDebugId);
if (balloon != null) {
balloon.hide();
@@ -316,7 +316,7 @@ public final class PreviewFormAction extends AnAction{
try {
RunProfile profile = new MyRunProfile(module, parameters, tempPath,
UIDesignerBundle.message("progress.preview.started", formFile.getPresentableUrl()));
ExecutionUtil.execute(ExecutionEnvironmentBuilder.create(module.getProject(), DefaultRunExecutor.getRunExecutorInstance(), profile).build());
ExecutionEnvironmentBuilder.create(module.getProject(), DefaultRunExecutor.getRunExecutorInstance(), profile).buildAndExecute();
}
catch (ExecutionException e) {
Messages.showErrorDialog(
@@ -172,7 +172,7 @@ public class CreateSnapShotAction extends AnAction {
});
try {
ExecutionUtil.execute(ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), snapshotConfiguration).build());
ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), snapshotConfiguration).buildAndExecute();
}
catch (ExecutionException ex) {
Messages.showMessageDialog(project, UIDesignerBundle.message("snapshot.run.error", ex.getMessage()),