Mercurial > dive4elements > river
changeset 6377:fa8425c8694c
Fix typos and NPEs.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 20 Jun 2013 16:10:58 +0200 |
parents | 8d6f23243d1d |
children | 2ad7f3ada1dc |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java Thu Jun 20 11:42:47 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java Thu Jun 20 16:10:58 2013 +0200 @@ -300,7 +300,7 @@ addProblem(km, "missing.data.coarse"); continue; } - if (fraction.getFine_middle() <= 0d && load.hasFineMiddle()) { + if (fraction.getFineMiddle() <= 0d && load.hasFineMiddle()) { addProblem(km, "missing.data.fine_middle"); continue; }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java Thu Jun 20 11:42:47 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java Thu Jun 20 16:10:58 2013 +0200 @@ -388,13 +388,16 @@ Object[] row = results.get(i); double km = (Double)row[3]; MeasurementStation station = stations.get(km); - MeasurementStation nextStation = stations.ceilingEntry(km + 0.1d).getValue(); + MeasurementStation nextStation = null; + if (stations.ceilingEntry(km + 0.1d) != null) { + nextStation = stations.ceilingEntry(km + 0.1d).getValue(); + } Range range = null; if (station == null) { log.warn("No measurement station for " + fraction + " km " + km); } else { - if (nextRange != null) + if (nextStation != null) range = new Range(station.getRange().getA().doubleValue(), nextStation.getRange().getA().doubleValue()); else {