diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FixationArtifactAccess.java @ 3025:5d286d7e54cd

FixA: Prevent duplicates in analysis periods. flys-artifacts/trunk@4592 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 05 Jun 2012 15:37:38 +0000
parents e5e6363e6cba
children 77b5f5a26700
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FixationArtifactAccess.java	Tue Jun 05 15:28:32 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FixationArtifactAccess.java	Tue Jun 05 15:37:38 2012 +0000
@@ -320,7 +320,10 @@
                     try {
                         Date from = new Date(Long.parseLong(fromTo[0]));
                         Date to   = new Date(Long.parseLong(fromTo[1]));
-                        aPs.add(new DateRange(from, to));
+                        DateRange aP = new DateRange(from, to);
+                        if (!aPs.contains(aP)) {
+                            aPs.add(aP);
+                        }
                     }
                     catch (NumberFormatException nfe) {
                         log.warn("ana_data contains no long values.", nfe);

http://dive4elements.wald.intevation.org