Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java @ 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 | 64b465699a24 |
children | 74142aa5d938 |
line wrap: on
line diff
--- 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; }