[PATCH 5 of 6] (Issue1357) Pull river name into getReferenceGauge

Wald Commits scm-commit at wald.intevation.org
Thu Aug 15 16:51:17 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1376576810 -7200
# Node ID ddb0ed040209c0ad71ffcb57dbd88e699b769272
# Parent  233a1b04fb8a65f18b30ed0ab850331ce6f0f931
(Issue1357) Pull river name into getReferenceGauge

    This fixes the timerange state on rivers with multiple gauges of
    the same id

diff -r 233a1b04fb8a -r ddb0ed040209 artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Thu Aug 15 16:25:50 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Thu Aug 15 16:26:50 2013 +0200
@@ -491,10 +491,14 @@
 
     public static Gauge getReferenceGauge(D4EArtifact flys) {
         Long officialNumber = flys.getDataAsLong("reference_gauge");
+        String river = getRivername(flys);
 
-        return officialNumber != null
-            ? Gauge.getGaugeByOfficialNumber(officialNumber)
-            : null;
+        if (officialNumber != null && river != null) {
+            return Gauge.getGaugeByOfficialNumber(officialNumber, river);
+        } else if (officialNumber != null) {
+            return Gauge.getGaugeByOfficialNumber(officialNumber);
+        }
+        return null;
     }
 
 


More information about the Dive4elements-commits mailing list