Mercurial > dive4elements > river
changeset 1983:ddb7b7da6199
Fix/survive certain minor malconditions.
flys-artifacts/trunk@3413 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 14 Dec 2011 10:48:36 +0000 |
parents | 8afd6a9bb244 |
children | 9c0acaa369ea |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java |
diffstat | 3 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Dec 14 10:46:39 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Dec 14 10:48:36 2011 +0000 @@ -1,3 +1,13 @@ +2011-12-14 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + Fix/Guard certain misconditions. + + * src/main/java/de/intevation/flys/exports/XYChartGenerator.java: Do + not crash when given null-range. + + * src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java: + Do not crash when given malformed array. + 2011-12-14 Felix Wolfsteller <felix.wolfsteller@intevation.de> Cosmetics.
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java Wed Dec 14 10:46:39 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java Wed Dec 14 10:48:36 2011 +0000 @@ -30,7 +30,7 @@ * to 2nd dim. */ public static void addPoints(XYSeries series, double[][] points) { - if (points == null || points.length == 0) { + if (points == null || points.length <= 1) { return; } double [] xPoints = points[0];
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Wed Dec 14 10:46:39 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Wed Dec 14 10:48:36 2011 +0000 @@ -425,9 +425,10 @@ /** * Expands a given range if it collapses into one point. + * @param Range to be expanded if upper == lower bound. */ private Range expandPointRange(Range range) { - if (range.getLowerBound() == range.getUpperBound()) { + if (range != null && range.getLowerBound() == range.getUpperBound()) { return expandRange(range, 5); } return range;