Mercurial > dive4elements > gnv-client
changeset 530:d2c68f2f619b
Fixed an ArrayIndexOutOfBounds-exceptions which occured if there are less than two data points for chart creation.
gnv-artifacts/trunk@626 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 26 Jan 2010 10:07:44 +0000 |
parents | 846e6f8d3d9c |
children | b80940231f6e |
files | gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java |
diffstat | 2 files changed, 27 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog Tue Jan 26 10:02:49 2010 +0000 +++ b/gnv-artifacts/ChangeLog Tue Jan 26 10:07:44 2010 +0000 @@ -1,3 +1,16 @@ +2010-01-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java: Fixed an + ArrayIndexOutOfBounds-exception which occured if there are less than two + data points. + +2010-01-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue161 + + * doc/conf/products/verticalprofile/conf_mesh.xml: Adapted transition model. + Splitted date selection into two steps. + 2010-01-25 Sascha L. Teichmann <sascha.teichmann@intevation.de> Fix/Workaround for gnv/issue159
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java Tue Jan 26 10:02:49 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java Tue Jan 26 10:07:44 2010 +0000 @@ -25,6 +25,8 @@ public class VerticalProfileChart extends AbstractXYLineChart { + public static final String DEFAULT_AXIS = "KPOSITION"; + private static Logger log = Logger.getLogger(VerticalProfileChart.class); protected final double PERCENTAGE = 5.0; @@ -228,10 +230,18 @@ int startPos, int endPos ) { - String axis = getDependendAxisName( - results[startPos], - results[startPos+1] - ); + String axis = null; + + if (results.length > (startPos+1)) { + axis = getDependendAxisName( + results[startPos], + results[startPos+1] + ); + } + else { + axis = DEFAULT_AXIS; + } + double range = 0; int last = 0; int current = 0;