1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 02:35:37 +02:00

Bug 511161: Early fail on non-absolute URIs when looking for files in workspace

Change-Id: Idefa850b3d43e13d878d5a19bd89bd42ee1c534f
This commit is contained in:
Jonah Graham 2018-05-31 00:10:14 +01:00
parent 93cfa42618
commit 45279d5ffc

View file

@ -651,6 +651,11 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
* to reside in the given project. * to reside in the given project.
*/ */
private static IResource findFileForLocationURI(URI uri, IProject preferredProject, boolean checkExistence) { private static IResource findFileForLocationURI(URI uri, IProject preferredProject, boolean checkExistence) {
if (!uri.isAbsolute()) {
// IWorkspaceRoot.findFilesForLocationURI(URI) below requires an absolute URI
// therefore we haven't/aren't going to find the file based on this URI.
return null;
}
IResource sourceFile = null; IResource sourceFile = null;
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource[] resources = root.findFilesForLocationURI(uri); IResource[] resources = root.findFilesForLocationURI(uri);