changeset 8509:32c94ca227bc

(issue1782) Invert artifact range if necessary in officiallinefinder
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 16 Dec 2014 15:58:33 +0100
parents 5160d5f9c65d
children 46221aff8989
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/OfficialLineFinder.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/OfficialLineFinder.java	Tue Dec 16 15:40:00 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/OfficialLineFinder.java	Tue Dec 16 15:58:33 2014 +0100
@@ -247,7 +247,12 @@
             }
         }
         try {
-            return new Range(Double.parseDouble(from), Double.parseDouble(to));
+            double f = Double.parseDouble(from);
+            double t = Double.parseDouble(to);
+            if (f > t) {
+                return new Range(t, f);
+            }
+            return new Range(f, t);
         }
         catch (NumberFormatException nfe) {
             return MAX_RANGE;

http://dive4elements.wald.intevation.org