1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 01:06:01 +02:00

Follow up fix for 202093, compare projects directly.

This commit is contained in:
Markus Schorn 2007-09-04 09:28:28 +00:00
parent fc2132103b
commit eacf4ace70

View file

@ -27,7 +27,6 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@ -121,16 +120,10 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
IPath baseDirectory = fUtil.getBaseDirectory();
boolean isValidPath = baseDirectory.isPrefixOf(pFilePath);
if (!isValidPath) {
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
IFile[] foundOccurrences = wsRoot.findFilesForLocation(pFilePath);
if (foundOccurrences != null) {
for (int j=0; j<foundOccurrences.length; j++) {
IProject foundProject = foundOccurrences[j].getProject();
if (foundProject != null && foundProject.getLocation().equals(baseDirectory)) {
isValidPath = true;
break;
}
}
final IProject prj= fUtil.getProject();
IFile[] foundOccurrences = ((IWorkspaceRoot) prj.getParent()).findFilesForLocation(pFilePath);
for (int j=0; !isValidPath && j<foundOccurrences.length; j++) {
isValidPath= prj.equals(foundOccurrences[j].getProject());
}
}
if (isValidPath) {