changeset 1648:d1d6fd8cfbb2

Improved regex used to track WSPLGEN errors - will now match critical errors as well. flys-artifacts/trunk@2835 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Sep 2011 10:53:41 +0000
parents 103205742e02
children 74142aa5d938
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java
diffstat 2 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Sep 27 10:18:06 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Sep 27 10:53:41 2011 +0000
@@ -1,3 +1,8 @@
+2011-09-27  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java: Track
+	  critical errors as well (improved regular expression for errors).
+
 2011-09-27	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* ChangeLog: Fixed whitespace usage.
--- a/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java	Tue Sep 27 10:18:06 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java	Tue Sep 27 10:53:41 2011 +0000
@@ -15,11 +15,11 @@
 
 
     public static final Pattern WSPLGEN_ERROR_START = Pattern.compile(
-        ".*->Fehler\\s*\\((\\d+)\\).*",
+        ".*->(.*Fehler)(\\s*\\((\\d+)\\).*)*",
         Pattern.DOTALL);
 
     public static final Pattern WSPLGEN_ERROR_END = Pattern.compile(
-        ".*<-Fehler .*",
+        ".*<-(.*Fehler).*",
         Pattern.DOTALL);
 
     public static final Pattern WSPLGEN_WARNING_START = Pattern.compile(
@@ -62,7 +62,18 @@
     protected void update(String log) {
         Matcher startError = WSPLGEN_ERROR_START.matcher(log);
         if (startError.matches()) {
-            error = Integer.parseInt(startError.group(1));
+            if (startError.groupCount() >= 2) {
+                String tmp = startError.group(2);
+
+                if (tmp != null && tmp.length() > 0) {
+                    error = Integer.parseInt(tmp);
+                }
+                else error = 1;
+            }
+            else {
+                error = 1;
+            }
+
             return;
         }
 

http://dive4elements.wald.intevation.org