changeset 8602:0860e4f642c4

(issue1753) Use epsilon comparator to compare range km's
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 20 Mar 2015 16:32:44 +0100
parents 5b568f7f18bc
children eed4e31ca1b3
files backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
             }

http://dive4elements.wald.intevation.org