changeset 4227:8138a90a674a

Be more tolerant with empty time intervals in discharge tables while comparing discharge tables.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 23 Oct 2012 15:46:31 +0200
parents cb9f22c3553f
children fcdc0d2fdf8f
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DischargeTablesOverview.java flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DischargeTablesOverview.java	Tue Oct 23 15:05:17 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DischargeTablesOverview.java	Tue Oct 23 15:46:31 2012 +0200
@@ -151,6 +151,11 @@
     protected String createSeriesTitle(CallMeta callMeta, DischargeTable dt)
         throws IllegalArgumentException {
         TimeInterval timeInterval = dt.getTimeInterval();
+
+        if (timeInterval == null) {
+            return Resources.format(callMeta, DEFAULT_CHART_SERIES_TITLE);
+        }
+
         Date start = timeInterval.getStartTime();
         Date end = timeInterval.getStopTime();
 
--- a/flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java	Tue Oct 23 15:05:17 2012 +0200
+++ b/flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java	Tue Oct 23 15:46:31 2012 +0200
@@ -124,6 +124,15 @@
         }
 
         TimeInterval other = o.getTimeInterval();
+        if (other == null && timeInterval == null) {
+            return 1;
+        }
+        else if (other == null) {
+            return -1;
+        }
+        else if (timeInterval == null) {
+            return 1;
+        }
 
         Date otherStartTime = other.getStartTime();
         Date thisStartTime  = timeInterval.getStartTime();

http://dive4elements.wald.intevation.org