From 8d70cfe27b633ade21a19f1f52268ec026027586 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 25 Feb 2006 16:50:29 +0000 Subject: [PATCH] Trapping NumberFormatExceptionsgenerated by unusual error messages from the C compiler. --- app/Compiler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Compiler.java b/app/Compiler.java index 23579110b..72c959320 100644 --- a/app/Compiler.java +++ b/app/Compiler.java @@ -534,7 +534,13 @@ public class Compiler implements MessageConsumer { return; } - int lineNumber = Integer.parseInt(s1.substring(0, colon)); + int lineNumber; + try { + lineNumber = Integer.parseInt(s1.substring(0, colon)); + } catch (NumberFormatException e) { + System.err.print(s1); + return; + } // the "1" corresponds to the amount of lines written to the main code // file by PdePreprocessor's writeHeader() routine before prototypes