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:
parent
1252c564fe
commit
8d8060f5af
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue