mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
avoid misuse (remove execute(env) from util)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -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(
|
||||
|
||||
+1
-1
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user