Mercurial > dive4elements > river
diff flys-backend/src/main/java/de/intevation/flys/importer/AtFileParser.java @ 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 |
parents | b35c5dc0f8b7 |
children | 23fe9ac1c3b4 |
line wrap: on
line diff
--- 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 {