# HG changeset patch # User Ingo Weinzierl # Date 1317392966 0 # Node ID 09c1292cf36d5aee4958e9fef804a8045c7865a4 # Parent 0ebce697adcc9f0d11e637665b6b363b30453441 Bugfix: #351 Modified determination of single values specified by min/max values and an interval. flys-artifacts/trunk@2874 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0ebce697adcc -r 09c1292cf36d flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Sep 30 09:41:22 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Sep 30 14:29:26 2011 +0000 @@ -1,3 +1,12 @@ +2011-09-30 Ingo Weinzierl + + flys/issue351 (W-INFO / Wasserspiegellagenberechnungen) + + * src/main/java/de/intevation/flys/utils/DoubleUtil.java: Modified the + explode() function that returns a list of values specified by min, max + and an interval. If the last value, determined by the interval, is + bigger than the max value, it is not included in the result list. + 2011-09-30 Felix Wolfsteller flys/issue334 (Querprofil-Diagramm: Ausgabe dieses Diagrammtyps diff -r 0ebce697adcc -r 09c1292cf36d flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java --- a/flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java Fri Sep 30 09:41:22 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java Fri Sep 30 14:29:26 2011 +0000 @@ -1,5 +1,8 @@ package de.intevation.flys.utils; +import java.util.Arrays; + + public class DoubleUtil { public static final double DEFAULT_STEP_PRECISION = 1e6; @@ -37,7 +40,13 @@ step = -step; } + double max = Math.max(from, to); + for (int idx = 0; idx < num; idx++) { + if (lower > max) { + return Arrays.copyOfRange(values, 0, idx); + } + values[idx] = round(lower, precision); lower += step; }