Mercurial > dive4elements > river
changeset 504:ee693b8fbb55
Fixed flys/issue11 and flys51.
flys-backend/trunk@1890 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 10 May 2011 17:31:10 +0000 (2011-05-10) |
parents | bcc18293a547 |
children | ce9c6f05f464 |
files | flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/importer/AtFileParser.java |
diffstat | 2 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Mon May 09 10:04:23 2011 +0000 +++ b/flys-backend/ChangeLog Tue May 10 17:31:10 2011 +0000 @@ -1,3 +1,8 @@ +2011-05-10 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/importer/AtFileParser.java: + Fixed flys/issue11 and flys51. + 2011-05-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/importer/ValueKey.java:
--- a/flys-backend/src/main/java/de/intevation/flys/importer/AtFileParser.java Mon May 09 10:04:23 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/AtFileParser.java Tue May 10 17:31:10 2011 +0000 @@ -6,8 +6,6 @@ import java.io.InputStreamReader; import java.io.IOException; import java.math.BigDecimal; -import java.text.NumberFormat; -import java.text.ParseException; import org.apache.log4j.Logger; @@ -26,8 +24,6 @@ private static Logger logger = Logger.getLogger(AtFileParser.class); - private static NumberFormat nf = NumberFormat.getInstance(); - // regular expression from hell to find out time range public static final Pattern DATE_LINE = Pattern.compile( @@ -107,7 +103,7 @@ } String strW = splits[0].trim(); - double W = nf.parse(strW).doubleValue(); + double W = Double.parseDouble(strW); /* shift is used to differenciate between lines with * exactly 10 Qs and lines with less than 10 Qs. The shift @@ -122,7 +118,7 @@ for (int i = 1; i < splits.length; i++) { double iW = W + shift + i; - double iQ = nf.parse(splits[i].trim()).doubleValue(); + double iQ = Double.parseDouble(splits[i].trim()); dischargeTable.addDischargeTableValue( new ImportDischargeTableValue( @@ -133,7 +129,7 @@ beginning = false; } } - catch (ParseException pe) { + catch (NumberFormatException pe) { logger.warn(pe.getMessage()); } finally {