@NotNull'ed for EA-56831 - NPE: RemoteProcessSupport.release

This commit is contained in:
Gregory.Shrago
2014-05-31 02:12:02 +04:00
parent ff49bd11c8
commit e761dd8e97
@@ -151,9 +151,9 @@ public abstract class RemoteProcessSupport<Target, EntryPoint, Parameters> {
public void release(@NotNull Target target, @Nullable Parameters configuration) {
ArrayList<ProcessHandler> handlers = new ArrayList<ProcessHandler>();
synchronized (myProcMap) {
for (Pair<Target, Parameters> pair : myProcMap.keySet()) {
if (pair.first == target && (configuration == null || pair.second == configuration)) {
ContainerUtil.addIfNotNull(myProcMap.get(pair).handler, handlers);
for (Pair<Target, Parameters> key : myProcMap.keySet()) {
if (key.first == target && (configuration == null || key.second == configuration)) {
ContainerUtil.addIfNotNull(myProcMap.get(key).handler, handlers);
}
}
}
@@ -164,7 +164,7 @@ public abstract class RemoteProcessSupport<Target, EntryPoint, Parameters> {
fireModificationCountChanged();
}
private void startProcess(Target target, Parameters configuration, Pair<Target, Parameters> key) {
private void startProcess(Target target, Parameters configuration, @NotNull Pair<Target, Parameters> key) {
ProgramRunner runner = new DefaultProgramRunner() {
@Override
@NotNull
@@ -196,7 +196,7 @@ public abstract class RemoteProcessSupport<Target, EntryPoint, Parameters> {
protected abstract RunProfileState getRunProfileState(Target target, Parameters configuration, Executor executor)
throws ExecutionException;
private boolean getExistingInfo(Ref<RunningInfo> ref, Pair<Target, Parameters> key) {
private boolean getExistingInfo(@NotNull Ref<RunningInfo> ref, @NotNull Pair<Target, Parameters> key) {
Info info;
synchronized (myProcMap) {
info = myProcMap.get(key);
@@ -254,7 +254,7 @@ public abstract class RemoteProcessSupport<Target, EntryPoint, Parameters> {
return (T)(to.isInstance(remote) ? remote : PortableRemoteObject.narrow(remote, to));
}
private ProcessListener getProcessListener(final Pair<Target, Parameters> key) {
private ProcessListener getProcessListener(@NotNull final Pair<Target, Parameters> key) {
return new ProcessListener() {
@Override
public void startNotified(ProcessEvent event) {