Mercurial > dive4elements > river
diff backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java @ 8991:c43d8c1a4455
Parse via decimalformat instead of bigdecimal constructor (to cope with strings with chars after the actual number)
author | mschaefer |
---|---|
date | Tue, 10 Apr 2018 16:43:32 +0200 |
parents | 2693bfaf503d |
children |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Tue Apr 10 16:40:52 2018 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Tue Apr 10 16:43:32 2018 +0200 @@ -12,6 +12,7 @@ import java.io.IOException; import java.math.BigDecimal; import java.text.NumberFormat; +import java.text.ParseException; import java.util.ArrayList; import java.util.List; import java.util.TreeSet; @@ -235,7 +236,7 @@ name, AbstractParser.parseDecimal(qStr) }; } - catch (final NumberFormatException pe) { + catch (final ParseException pe) { log.warn("Could not parse Q value: '" + qStr + "'"); } } @@ -271,7 +272,7 @@ this.kmExists.add(key); } - catch (final NumberFormatException pe) { + catch (final ParseException pe) { log.warn("Unparseable flow velocity values:", pe); } }