From 45279d5ffc88c4c9345c9b5c156f962053ff5189 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Thu, 31 May 2018 00:10:14 +0100 Subject: [PATCH] Bug 511161: Early fail on non-absolute URIs when looking for files in workspace Change-Id: Idefa850b3d43e13d878d5a19bd89bd42ee1c534f --- .../providers/AbstractLanguageSettingsOutputScanner.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java index bcc6e87e59b..5df6b5c2d6e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java @@ -651,6 +651,11 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett * to reside in the given project. */ 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; IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IResource[] resources = root.findFilesForLocationURI(uri);