changeset 6266:c297a61115d0

issue1267: Sort the list of FastCrossSections before binarySearching it.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 11 Jun 2013 11:59:25 +0200
parents 29d6cdcc7e38
children 484a19628b1e
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/FastCrossSectionChunk.java
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FastCrossSectionChunk.java	Tue Jun 11 11:58:54 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FastCrossSectionChunk.java	Tue Jun 11 11:59:25 2013 +0200
@@ -56,6 +56,7 @@
     /** Finds the FastCrossSectionLine at km (null if not found). */
     public FastCrossSectionLine getCrossSectionLine(double km) {
         FastCrossSectionLine key = new FastCrossSectionLine(km);
+        Collections.sort(crossSectionLines, FastCrossSectionLine.KM_CMP);
         int pos = Collections.binarySearch(
             crossSectionLines, key, FastCrossSectionLine.KM_CMP);
         return pos < 0 ? null : crossSectionLines.get(pos);

http://dive4elements.wald.intevation.org