From 8d8060f5af82473a1cdad9d052cc61e9f1a75b57 Mon Sep 17 00:00:00 2001 From: Chris Recoskie Date: Tue, 3 Feb 2009 18:40:55 +0000 Subject: [PATCH] Fixing URISyntaxExceptions due to improperly parsed URI. --- .../ui/refactoring/utils/TranslationUnitHelper.java | 10 +++++----- 1 file 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 0077ee70285..43f3e32ae15 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); }