Mercurial > dive4elements > river
changeset 4163:2b4f78ccfbaa
Made DoubleUtil.explode() more robust against invalid result array sizes.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 17 Oct 2012 01:12:19 +0200 |
parents | debd1a706469 |
children | 8d3e8cb54e4c |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Tue Oct 16 18:52:11 2012 +0200 +++ b/flys-artifacts/ChangeLog Wed Oct 17 01:12:19 2012 +0200 @@ -1,3 +1,10 @@ +2012-10-17 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/utils/DoubleUtil.java(explode): + Return empty double array if we are up to create a negative + result array. This should fix some problems in + "Fixierungsanalyse/Auslagerung von Wasserspiegellagen". + 2012-10-16 Björn Ricks <bjoern.ricks@intevation.de> * doc/conf/default-themes.xml,
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java Tue Oct 16 18:52:11 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java Wed Oct 17 01:12:19 2012 +0200 @@ -43,6 +43,10 @@ double tmp = diff / step; int num = (int)Math.abs(Math.ceil(tmp)) + 1; + if (num < 1) { + return new double[0]; + } + double [] values = new double[num]; if (from > to) {