changeset 1167:f1c9bfb07ba7

Fix crash when StickyAxisAnnotation should be drawn without proper axis information. User-directed issues remain ( flys/issue303 ). flys-artifacts/trunk@2712 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 13 Sep 2011 06:30:10 +0000
parents 865ee1e19c62
children ace192d3283d
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Sep 13 05:25:09 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Sep 13 06:30:10 2011 +0000
@@ -1,3 +1,13 @@
+2011-09-13  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+ Fix crash when drawing StickyAxisAnnotation when no range was given.
+ User-directed issues remain ( flys/issue303 ).
+
+	* src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java
+	  (draw):
+	  Guard access to domainAxis, rangeAxis and the corresponding ranges.
+	  Warn and exit if any was null.
+
 2011-09-13  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue290 (Karte: Eingabe von Differenzen zw. WSP und Gelände findet
@@ -30,6 +40,7 @@
 	  calculation has been added to the scheduler AND if there are digitized
 	  geometries existing.
 
+>>>>>>> .r2711
 2011-09-12  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
  Copied and slightly modified implementation of guessWaterIncreasing from
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java	Tue Sep 13 05:25:09 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/StickyAxisAnnotation.java	Tue Sep 13 06:30:10 2011 +0000
@@ -231,6 +231,14 @@
         if (info == null)
             return;
 
+        if (domainAxis == null || rangeAxis == null
+                || domainAxis.getRange()    == null
+                || rangeAxis.getRange()     == null
+                ) {
+            logger.error("Annotation cannot be drawn (missing axis).");
+            return;
+        }
+
         // Calculate the bounding box.
         ChartRenderingInfo chartInfo = info.getOwner();
 

http://dive4elements.wald.intevation.org