[PATCH 2 of 2] (issue1448) Actually filter out not matching sq_time_interval_ids

Wald Commits scm-commit at wald.intevation.org
Mon Sep 8 19:48:23 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1410198497 -7200
# Node ID 61fd22f65bd459b99ea2e142e31cf55db85d8dfc
# Parent  b207eeb66edd51864b17f735cef78e85c8b9c86c
(issue1448) Actually filter out not matching sq_time_interval_ids

diff -r b207eeb66edd -r 61fd22f65bd4 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java	Mon Sep 08 19:47:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java	Mon Sep 08 19:48:17 2014 +0200
@@ -16,6 +16,7 @@
 import java.util.List;
 import java.util.TreeMap;
 import java.util.TreeSet;
+import java.util.Iterator;
 
 import org.apache.log4j.Logger;
 
@@ -463,6 +464,15 @@
             }
         });
 
+        /* This may not be the most beautiful thing to do but well,.. */
+        for (Iterator<Load> it = loads.iterator(); it.hasNext();) {
+            Integer obj = it.next().getSQRelationTimeIntervalId();
+            if ((obj == null && sqRelationTimeInterval != null) ||
+                    (obj != null && !obj.equals(sqRelationTimeInterval))) {
+                it.remove();
+            }
+        }
+
         return loads;
     }
 


More information about the Dive4Elements-commits mailing list