From bd8c6c1ffcf9bef51fcd7ef82e952c61ada3e9f6 Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 15 Jan 2009 15:05:19 +0000 Subject: [PATCH] [260991] - applied patch to prevent class cast exception --- .../src/org/eclipse/cdt/core/ErrorParserManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java index f8b639db3ae..3f1dbd5a4c5 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java @@ -261,7 +261,13 @@ public class ErrorParserManager extends OutputStream { } if(matchingFile == null) { - return (IFile) fFilesInProject.get(path.lastSegment()); // last ditch attempt... look for a file with that name in the project + // one more attempt... look for a file with that name in the project + Object candidateFile = fFilesInProject.get(path.lastSegment()); + if (candidateFile instanceof IFile) { + return (IFile) candidateFile; + } + // not found or getting list of files which is ambiguous + return null; } return matchingFile;