# HG changeset patch # User Felix Wolfsteller # Date 1377684176 -7200 # Node ID 4c0222d9405532efbc07a465afb039bb614cb548 # Parent 0a3dd5be6f818865c78b3849aedf987a8d2a14e3 issue1436: Exploit validity-rule of sedimentdensities. diff -r 0a3dd5be6f81 -r 4c0222d94055 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java Wed Aug 28 11:55:14 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java Wed Aug 28 12:02:56 2013 +0200 @@ -80,14 +80,10 @@ for (int i = 0; i < years.size() -1; i++) { int y1 = years.get(i); int y2 = years.get(i + 1); - int mid = Math.round((y1 + y2) / 2); - if (year < mid) { + if (year >= y1 && year < y2) { return getDensityAtKm(densities.get(y1), km); } - else if (i == years.size() -1) { - continue; - } - else { + else if (year >= y2 && i == years.size() -1) { return getDensityAtKm(densities.get(y2), km); } }