[Dive4elements-commits] [PATCH] Insert Double.NaN for missing values in bed height factory
Wald Commits
scm-commit at wald.intevation.org
Mon Jun 17 16:19:04 CEST 2013
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1371478720 -7200
# Node ID f1a3ea7fb3b64aa51ff49c7fe717bcdb72d06124
# Parent 2c7a16d59f67c7dbad1b3b925530fbd0f65b85e9
Insert Double.NaN for missing values in bed height factory.
diff -r 2c7a16d59f67 -r f1a3ea7fb3b6 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Mon Jun 17 15:37:26 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Mon Jun 17 16:18:40 2013 +0200
@@ -154,12 +154,11 @@
for (int i = 0; i < results.size(); i++) {
Object[] row = results.get(i);
log.debug("got station: " + (Double)row[1]);
- height.add(
- (Double) row[0],
- (Double) row[1],
- (Double) row[2],
- (Double) row[3],
- (Integer) row[4]);
+ Double row0 = row[0] != null ? (Double)row[0] : Double.NaN;
+ Double row1 = row[1] != null ? (Double)row[1] : Double.NaN;
+ Double row2 = row[2] != null ? (Double)row[2] : Double.NaN;
+ Double row3 = row[3] != null ? (Double)row[3] : Double.NaN;
+ height.add(row0, row1, row2, row3, (Integer) row[4]);
}
return height;
}
More information about the Dive4elements-commits
mailing list