[PATCH] (issue1753) Use epsilon comparator to compare range km's

Wald Commits scm-commit at wald.intevation.org
Fri Mar 20 16:32:48 CET 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1426865564 -3600
# Node ID 0860e4f642c4068f3509f6d9d8eff1045e40e25e
# Parent  5b568f7f18bc1bda11e3599c9d2b8c801e416044
(issue1753) Use epsilon comparator to compare range km's

diff -r 5b568f7f18bc -r 0860e4f642c4 backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java
--- a/backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java	Fri Mar 20 15:20:32 2015 +0100
+++ b/backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java	Fri Mar 20 16:32:44 2015 +0100
@@ -233,9 +233,9 @@
                 : st.getRange().getB().doubleValue();
 
             // In case river is km_up, station is at larger value of range
-            if (river.getKmUp() && b != null && b == river_km
-                || !river.getKmUp() && a == river_km
-                || b == null && a == river_km // no end km given
+            if (river.getKmUp() && b != null && CMP.compare(b, river_km) == 0
+                || !river.getKmUp() && CMP.compare(a, river_km) == 0
+                || b == null && CMP.compare(a, river_km) == 0 // no end km given
             ) {
                 result.add(st);
             }


More information about the Dive4Elements-commits mailing list