Cleanup (unneeded exception)

This commit is contained in:
Roman Shevchenko
2017-04-19 09:24:52 +02:00
parent 2d91b2dd53
commit ff32aa6040
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.OutputStream;
import java.io.PrintWriter;
@@ -87,20 +86,22 @@ public class RunnerMediator {
if (!SystemInfo.isWindows) {
throw new IllegalStateException("There is no need of runner under unix based OS");
}
final String path = System.getenv(IDEA_RUNNERW);
String path = System.getenv(IDEA_RUNNERW);
if (path != null) {
if (new File(path).exists()) {
return path;
}
LOG.warn("Cannot locate " + STANDARD_RUNNERW + " by " + IDEA_RUNNERW + " environment variable (" + path + ")");
LOG.warn("Cannot locate " + STANDARD_RUNNERW + " by " + IDEA_RUNNERW + "=" + path);
}
try {
return PathManager.findBinFileWithException(STANDARD_RUNNERW).getPath();
}
catch (FileNotFoundException e) {
LOG.warn(e);
return null;
File runnerw = PathManager.findBinFile(STANDARD_RUNNERW);
if (runnerw != null && runnerw.exists()) {
return runnerw.getPath();
}
LOG.warn("Cannot locate " + STANDARD_RUNNERW + " in " + PathManager.getBinPath());
return null;
}
static boolean injectRunnerCommand(@NotNull GeneralCommandLine commandLine) {