added NotNull annotations for EA-28713 - NPE: DefaultJavaProgramRunner.addDefaultActions

This commit is contained in:
nik
2011-08-09 11:25:25 +04:00
parent c3e24a2c3b
commit 2f10237569
12 changed files with 12 additions and 5 deletions
@@ -103,6 +103,7 @@ public class AppletConfiguration extends ModuleBasedConfiguration<JavaRunConfigu
return params;
}
@NotNull
protected OSProcessHandler startProcess() throws ExecutionException {
final OSProcessHandler handler = super.startProcess();
final AppletHtmlFile htmlUrl = myHtmlURL;
@@ -262,6 +262,7 @@ public class ApplicationConfiguration extends ModuleBasedConfiguration<JavaRunCo
return params;
}
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
final OSProcessHandler handler = super.startProcess();
@@ -37,6 +37,7 @@ public abstract class JavaCommandLineState extends CommandLineState implements J
return myParams;
}
@NotNull
protected OSProcessHandler startProcess() throws ExecutionException {
return JavaCommandLineStateUtil.startProcess(createCommandLine());
}
@@ -28,6 +28,7 @@ public class JavaCommandLineStateUtil {
private JavaCommandLineStateUtil() {
}
@NotNull
public static OSProcessHandler startProcess(@NotNull final GeneralCommandLine commandLine) throws ExecutionException {
final DefaultJavaProcessHandler processHandler = new DefaultJavaProcessHandler(commandLine);
ProcessTerminatedListener.attach(processHandler);
@@ -42,11 +42,9 @@ import com.intellij.openapi.projectRoots.ex.PathUtilEx;
import com.intellij.openapi.roots.*;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.jsp.JspFile;
import com.intellij.util.Function;
import com.intellij.util.PathsList;
import com.intellij.util.containers.HashSet;
import org.jdom.Element;
@@ -303,6 +301,7 @@ public class JavadocConfiguration implements ModuleRunProfile, JDOMExternalizabl
}
}
@NotNull
protected OSProcessHandler startProcess() throws ExecutionException {
final OSProcessHandler handler = JavaCommandLineStateUtil.startProcess(createCommandLine());
ProcessTerminatedListener.attach(handler, myProject, JavadocBundle.message("javadoc.generate.exited"));
@@ -60,6 +60,7 @@ public abstract class CommandLineState implements RunnableState {
return new DefaultExecutionResult(console, processHandler, createActions(console, processHandler, executor));
}
@NotNull
protected abstract ProcessHandler startProcess() throws ExecutionException;
protected AnAction[] createActions(final ConsoleView console, final ProcessHandler processHandler) {
@@ -17,11 +17,9 @@
package com.intellij.execution.configurations;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.CommandLineState;
import com.intellij.execution.process.OSProcessHandler;
import com.intellij.execution.runners.ExecutionEnvironment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author oleg
@@ -32,7 +30,6 @@ public class MockCommandLineState extends CommandLineState {
super(env);
}
@Nullable
protected OSProcessHandler startProcess() throws ExecutionException {
return null;
}
@@ -82,6 +82,7 @@ public class ToolRunProfile implements ModuleRunProfile{
return myCommandLine;
}
@NotNull
protected OSProcessHandler startProcess() throws ExecutionException {
final GeneralCommandLine commandLine = createCommandLine();
final OSProcessHandler processHandler = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
@@ -268,6 +268,7 @@ public abstract class MvcRunConfiguration extends ModuleBasedConfiguration<RunCo
MvcFramework.addJavaHome(params, myModule);
}
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
final OSProcessHandler handler = super.startProcess();
@@ -73,6 +73,7 @@ public class MavenRunConfiguration extends RunConfigurationBase implements Locat
.createJavaParameters(env.getProject(), mySettings.myRunnerParameters, mySettings.myGeneralSettings, mySettings.myRunnerSettings);
}
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
OSProcessHandler result = super.startProcess();
@@ -198,6 +198,7 @@ public class MavenServerManager extends RemoteObjectWrapper<MavenServer> {
return new DefaultExecutionResult(null, processHandler, AnAction.EMPTY_ARRAY);
}
@NotNull
protected OSProcessHandler startProcess() throws ExecutionException {
SimpleJavaParameters params = createJavaParameters();
Sdk sdk = params.getJdk();
@@ -44,6 +44,7 @@ import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.util.net.NetUtils;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.io.File;
@@ -69,6 +70,7 @@ class XsltCommandLineState extends CommandLineState {
myIsDebugger = settings != null && "Debug".equals(settings.getRunnerId());
}
@NotNull
protected OSProcessHandler startProcess() throws ExecutionException {
final OSProcessHandler osProcessHandler = createJavaParameters().createOSProcessHandler();
osProcessHandler.putUserData(STATE, this);