mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 03:45: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.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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue