Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Raynaud2012-05-09 14:10:46 +0000
committerXavier Raynaud2012-05-09 14:10:46 +0000
commit989608f714cbc71dddf354bfdd4c2f688204906f (patch)
treedb1530aa7d669549073847c9c30253fb23eb5e99 /profiling/org.eclipse.linuxtools.tools.launch.core
parent404dd4e617e59372e27e4fba3008b316d13d7bb4 (diff)
downloadorg.eclipse.linuxtools-989608f714cbc71dddf354bfdd4c2f688204906f.tar.gz
org.eclipse.linuxtools-989608f714cbc71dddf354bfdd4c2f688204906f.tar.xz
org.eclipse.linuxtools-989608f714cbc71dddf354bfdd4c2f688204906f.zip
just return command if the project is null
Diffstat (limited to 'profiling/org.eclipse.linuxtools.tools.launch.core')
-rw-r--r--profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java35
1 files changed, 18 insertions, 17 deletions
diff --git a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java
index b95b02fe6f..723e851ef1 100644
--- a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java
+++ b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java
@@ -66,25 +66,26 @@ public class RuntimeProcessFactory extends LinuxtoolsProcessFactory {
public String whichCommand(String command, IProject project) throws IOException {
String[] envp = updateEnvironment(null, project);
-
- try {
- proxy = RemoteProxyManager.getInstance().getFileProxy(project);
- URI whichUri = URI.create(WHICH_CMD);
- IPath whichPath = new Path(proxy.toPath(whichUri));
- IRemoteCommandLauncher launcher = RemoteProxyManager.getInstance().getLauncher(project);
- envp = updateEnvironment(envp, project);
- Process pProxy = launcher.execute(whichPath, new String[]{command}, envp, null, new NullProgressMonitor());
- if (pProxy != null){
- BufferedReader error = new BufferedReader(new InputStreamReader(pProxy.getErrorStream()));
- if(error.readLine() != null){
- throw new IOException(error.readLine());
+ if (project != null) {
+ try {
+ proxy = RemoteProxyManager.getInstance().getFileProxy(project);
+ URI whichUri = URI.create(WHICH_CMD);
+ IPath whichPath = new Path(proxy.toPath(whichUri));
+ IRemoteCommandLauncher launcher = RemoteProxyManager.getInstance().getLauncher(project);
+ envp = updateEnvironment(envp, project);
+ Process pProxy = launcher.execute(whichPath, new String[]{command}, envp, null, new NullProgressMonitor());
+ if (pProxy != null){
+ BufferedReader error = new BufferedReader(new InputStreamReader(pProxy.getErrorStream()));
+ if(error.readLine() != null){
+ throw new IOException(error.readLine());
+ }
+ BufferedReader reader = new BufferedReader(new InputStreamReader(pProxy.getInputStream()));
+ String readLine = reader.readLine();
+ command = readLine;
}
- BufferedReader reader = new BufferedReader(new InputStreamReader(pProxy.getInputStream()));
- String readLine = reader.readLine();
- command = readLine;
+ } catch (CoreException e) {
+ e.printStackTrace();
}
- } catch (CoreException e) {
- e.printStackTrace();
}
return command;
}

Back to the top