From d52e5c0f1cec1270e4ac69af36727b506b6f209c Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Thu, 15 Jan 2009 16:01:21 +0000 Subject: [PATCH] [260991] - applied patch to prevent parsers throwing exception screw everything else --- .../eclipse/cdt/core/ErrorParserManager.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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 3f1dbd5a4c5..ae38d474801 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 @@ -216,16 +216,22 @@ public class ErrorParserManager extends OutputStream { if (lineTrimmed.length() > 1000) continue; } + // standard behavior (pre 5.1) is to trim the line + String lineToParse = lineTrimmed; if ((types & IErrorParser2.KEEP_UNTRIMMED) !=0 ) { // untrimmed lines - if (curr.processLine(line, this)) { + lineToParse = line; + } + // Protect against rough parsers who may accidentally + // throw an exception on a line they can't handle. + // It should not stop parsing of the rest of output. + try { + if (curr.processLine(lineToParse, this)) { return; } - continue; - } - // standard behavior (pre 5.1) - if (curr.processLine(lineTrimmed, this)) { - return; + } catch (Exception e){ + String message = "Error parsing line [" + lineToParse + "]"; //$NON-NLS-2$ + CCorePlugin.log(message, e); } } }