Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Recoskie2009-02-03 13:40:55 -0500
committerChris Recoskie2009-02-03 13:40:55 -0500
commit8d8060f5af82473a1cdad9d052cc61e9f1a75b57 (patch)
treef50f8a44ba305794f02547783f6d4ee0c4659dc9
parent1252c564fe510fe6d29cad04b4b6f7397236d869 (diff)
downloadorg.eclipse.cdt-8d8060f5af82473a1cdad9d052cc61e9f1a75b57.tar.gz
org.eclipse.cdt-8d8060f5af82473a1cdad9d052cc61e9f1a75b57.tar.xz
org.eclipse.cdt-8d8060f5af82473a1cdad9d052cc61e9f1a75b57.zip
Fixing URISyntaxExceptions due to improperly parsed URI.
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/TranslationUnitHelper.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/TranslationUnitHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/TranslationUnitHelper.java
index 0077ee7028..43f3e32ae1 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/TranslationUnitHelper.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/TranslationUnitHelper.java
@@ -15,6 +15,7 @@ package org.eclipse.cdt.internal.ui.refactoring.utils;
import java.net.URI;
import java.net.URISyntaxException;
+import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -56,11 +57,10 @@ public class TranslationUnitHelper {
if (filename != null) {
IFile[] tmpFile = null;
- try {
- tmpFile = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new URI("file://" + filename)); //$NON-NLS-1$
- } catch (URISyntaxException e) {
- throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, e.getMessage(), e));
- }
+
+ tmpFile = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(
+ URIUtil.toURI(filename)); //$NON-NLS-1$
+
return loadTranslationUnit(tmpFile[0], useIndex);
}

Back to the top