changeset 2613:2e129754d450

Fixed NPE bug in filter builder for fixings overview. flys-artifacts/trunk@4197 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 04 Apr 2012 14:17:36 +0000
parents 49cfa5c66651
children 036e234c2385
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsFilterBuilder.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Apr 04 10:32:45 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Apr 04 14:17:36 2012 +0000
@@ -1,3 +1,11 @@
+2012-04-04	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java:
+	  Made bullet proof for null filters and ranges.
+
+	* src/main/java/de/intevation/flys/artifacts/model/FixingsFilterBuilder.java:
+	  Fixed bug which leeds to always generating a null range filter.
+
 2012-04-04	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/WaterlevelExporter.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsFilterBuilder.java	Wed Apr 04 10:32:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsFilterBuilder.java	Wed Apr 04 14:17:36 2012 +0000
@@ -50,7 +50,7 @@
     }
 
     public Range getRange() {
-        if (range != null) {
+        if (range == null) {
             range = buildRange();
         }
         return range;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java	Wed Apr 04 10:32:45 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java	Wed Apr 04 14:17:36 2012 +0000
@@ -430,7 +430,7 @@
 
                 for (SectorRange src: sectors) {
                     SectorRange dst = new SectorRange(src);
-                    if (dst.clip(range)) {
+                    if (range == null || dst.clip(range)) {
                         result.add(dst);
                     }
                 }
@@ -555,7 +555,8 @@
             Filter       filter
         ) {
             for (Column column: columns) {
-                if (column.intersects(range) && filter.accept(column)) { 
+                if ((range == null || column.intersects(range)) 
+                && (filter == null || filter.accept(column))) { 
                     allColumns.add(column);
                 }
             }

http://dive4elements.wald.intevation.org