Mercurial > dive4elements > river
changeset 4769:92a08725bc63
Do not die in W80 parser id invalid date is given.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 04 Jan 2013 15:46:33 +0100 |
parents | 99f9e371371b |
children | 28fa48986ae9 |
files | flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java Fri Jan 04 15:35:51 2013 +0100 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java Fri Jan 04 15:46:33 2013 +0100 @@ -82,6 +82,9 @@ /** Get the year of this cross sections measurement. */ @Override public Integer getYear() { + if (anchorDate == null) { + return Integer.valueOf(0); + } Calendar dateCalendar = Calendar.getInstance(); dateCalendar.setTime(anchorDate); return dateCalendar.get(Calendar.YEAR); @@ -222,7 +225,12 @@ currentLine = new ArrayList<XY>(); data.put(stationKm, currentLine); currentLine.add(new XY(0d, heightM,0)); - anchorDate = DateGuesser.guessDate(date); + try { + anchorDate = DateGuesser.guessDate(date); + } + catch (IllegalArgumentException iae) { + logger.warn("W80: Invalid date '" + date + "'."); + } } else { addPoint(gkRightKm, gkHighKm, heightM, pointIndex);