changeset 4134:9c78264109ad

AFT: Ignored tables with unset GUELTIG_VON or GUELTIG_BIS values.
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 15 Oct 2012 12:00:28 +0200
parents c722c08cf502
children ac93f397018d
files .hgignore flys-aft/ChangeLog flys-aft/src/main/java/de/intevation/aft/DischargeTable.java
diffstat 3 files changed, 28 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Mon Oct 15 09:31:50 2012 +0200
+++ b/.hgignore	Mon Oct 15 12:00:28 2012 +0200
@@ -14,6 +14,11 @@
 flys-client/\.project   # eclipse
 flys-client/\.settings  # eclipse
 flys-client/test-output # eclipse junit/testng plugin output
+flys-aft/target      # maven output
+flys-aft/\.classpath # eclipse
+flys-aft/\.project   # eclipse
+flys-aft/\.settings  # eclipse
+flys-aft/test-output # eclipse junit/testng plugin output
 flys-client/src/main/webapp/OpenLayers-2.11
 \.swp
 \.swo
--- a/flys-aft/ChangeLog	Mon Oct 15 09:31:50 2012 +0200
+++ b/flys-aft/ChangeLog	Mon Oct 15 12:00:28 2012 +0200
@@ -1,3 +1,10 @@
+2012-09-15	Sascha L. Teichmann	<sascha.teichmann@inteavtion.de>
+
+	* ../.hgignore: Add ignores for flys-aft, too.
+
+	* src/main/java/de/intevation/aft/DischargeTable.java: Ignore
+	  tables with unset GUELTIG_VON or GUELTIG_BIS values.
+
 2012-09-11	Sascha L. Teichmann	<sascha.teichmann@inteavtion.de>
 
 	* README.txt: Added infos how to build.
--- a/flys-aft/src/main/java/de/intevation/aft/DischargeTable.java	Mon Oct 15 09:31:50 2012 +0200
+++ b/flys-aft/src/main/java/de/intevation/aft/DischargeTable.java	Mon Oct 15 12:00:28 2012 +0200
@@ -228,7 +228,21 @@
             Date from = rs.getDate("GUELTIG_VON");
             Date to   = rs.getDate("GUELTIG_BIS");
 
-            if (from != null && to != null && from.compareTo(to) > 0) {
+            if (from == null) {
+                log.warn("AFT: ABFLUSSTAFEL_NR = "
+                    + dtId + ": GUELTIG_VON = NULL -> ignored.");
+            }
+
+            if (to == null) {
+                log.warn("AFT: ABFLUSSTAFEL_NR = "
+                    + dtId + ": GUELTIG_BIS = NULL -> ignored.");
+            }
+
+            if (from == null || to == null) {
+                continue;
+            }
+
+            if (from.compareTo(to) > 0) {
                     log.warn("AFT: ABFLUSSTAFEL_NR = " 
                     + dtId + ": " + from + " > " + to + ". -> swap");
                 Date temp = from;
@@ -252,9 +266,7 @@
             double datumValue = rs.getDouble("PEGELNULLPUNKT");
             Double datum = rs.wasNull() ? null : datumValue;
 
-            TimeInterval timeInterval = from == null
-                ? null
-                : new TimeInterval(from, to);
+            TimeInterval timeInterval = new TimeInterval(from, to);
 
             DischargeTable dt = new DischargeTable(
                 dtId,

http://dive4elements.wald.intevation.org