From 6875e287df14a80e58994d8be46b3ae453bb3b1c Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Thu, 24 Apr 2008 15:45:37 +0000 Subject: [PATCH] Fix warnings. --- .../cdt/internal/core/win32/ProcessList.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java index d5f1513ac76..c8182920983 100644 --- a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java +++ b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java @@ -22,6 +22,7 @@ import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.IProcessInfo; import org.eclipse.cdt.core.IProcessList; import org.eclipse.cdt.utils.spawner.ProcessFactory; +import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; @@ -44,17 +45,19 @@ public class ProcessList implements IProcessList { Bundle bundle = Platform.getBundle(CCorePlugin.PLUGIN_ID); try { - URL url = Platform.find(bundle, new Path("$os$/listtasks.exe")); //$NON-NLS-1$ - url = Platform.resolve(url); - String path = url.getFile(); - File file = new File(path); - if (file.exists()) { - command = file.getCanonicalPath(); - if (command != null) { - p = ProcessFactory.getFactory().exec(command); - in = p.getInputStream(); - InputStreamReader reader = new InputStreamReader(in); - return parseListTasks(reader); + URL url = FileLocator.find(bundle, new Path("$os$/listtasks.exe"), null); //$NON-NLS-1$ + if (url != null) { + url = FileLocator.resolve(url); + String path = url.getFile(); + File file = new File(path); + if (file.exists()) { + command = file.getCanonicalPath(); + if (command != null) { + p = ProcessFactory.getFactory().exec(command); + in = p.getInputStream(); + InputStreamReader reader = new InputStreamReader(in); + return parseListTasks(reader); + } } } } catch (IOException e) {