1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

Fixing URISyntaxExceptions due to improperly parsed URI.

This commit is contained in:
Chris Recoskie 2009-02-03 18:40:55 +00:00
parent 1252c564fe
commit 8d8060f5af

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.internal.ui.refactoring.utils;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -56,11 +57,10 @@ public class TranslationUnitHelper {
if (filename != null) { if (filename != null) {
IFile[] tmpFile = null; IFile[] tmpFile = null;
try {
tmpFile = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new URI("file://" + filename)); //$NON-NLS-1$ tmpFile = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(
} catch (URISyntaxException e) { URIUtil.toURI(filename)); //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, e.getMessage(), e));
}
return loadTranslationUnit(tmpFile[0], useIndex); return loadTranslationUnit(tmpFile[0], useIndex);
} }