From 4baaaf3c10fea2f501b799ea91c8a136ddd38125 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Thu, 4 Sep 2003 15:37:08 +0000 Subject: [PATCH] Fix PR 42501. Make: *** Warning: File .. has modification time in the future This is now a warning in the Task bar. --- .../errorparsers/MakeErrorParser.java | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java index ea68180ccfd..05a75cf5713 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java @@ -17,23 +17,26 @@ public class MakeErrorParser implements IErrorParser { static int getDirectoryLevel(String line) { int s = line.indexOf('['); + int num = 0; if (s != -1) { int e = line.indexOf(']'); - String number = line.substring(s + 1, e); - int num= Integer.parseInt(number); - return num; + String number = line.substring(s + 1, e).trim(); + try { + num = Integer.parseInt(number); + } catch (NumberFormatException exc) { + } } - return 0; + return num; } public boolean processLine(String line, ErrorParserManager eoParser) { // make\[[0-9]*\]: error_desc int firstColon= line.indexOf(':'); - if (firstColon != -1 && line.startsWith("make")) { + if (firstColon != -1 && line.startsWith("make")) { //$NON-NLS-1$ boolean enter = false; - String msg= line.substring(firstColon + 1); - if ((enter = msg.startsWith(" Entering directory")) || - (msg.startsWith(" Leaving directory"))) { + String msg= line.substring(firstColon + 1).trim(); + if ((enter = msg.startsWith("Entering directory")) || //$NON-NLS-1$ + (msg.startsWith("Leaving directory"))) { //$NON-NLS-1$ int s = msg.indexOf('`'); int e = msg.indexOf('\''); if (s != -1 && e != -1) { @@ -54,8 +57,17 @@ public class MakeErrorParser implements IErrorParser { /* Could check to see if they match */ } } - } else if (msg.startsWith(" ***")) { - eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null); + } else if (msg.startsWith("***")) { //$NON-NLS-1$ + boolean warning = false; + if (msg.length() > 4) { + String s = msg.substring(3).trim(); + warning = s.startsWith("Warning"); //$NON-NLS-1$ + } + if (warning) { + eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_WARNING, null); + } else { + eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null); + } } } return false;