changeset 360:3571357c85a7

Bugfix: Removed endless loop and a bug while iterating over Hibernate results. flys-artifacts/trunk@1768 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 29 Apr 2011 07:22:25 +0000
parents e5ea6a01526c
children 3e3ec9613883
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Apr 28 12:54:11 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Apr 29 07:22:25 2011 +0000
@@ -1,3 +1,9 @@
+2011-04-29  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java:
+	  Bugfix: Removed endless loop and a bug while iterating over Hibernate
+	  results.
+
 2011-04-28  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java	Thu Apr 28 12:54:11 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java	Fri Apr 29 07:22:25 2011 +0000
@@ -160,7 +160,7 @@
         public double interpolateW(double q) {
             if (Double.isNaN(q)) return Double.NaN;
             int index = getQIndex(q);
-            return index >= 0 ? ws[index] : interpolateW(-index -1);
+            return index >= 0 ? ws[index] : interpolateW(-index -1, q);
         }
 
         public int getQIndex(double q) {
@@ -462,8 +462,9 @@
         Double lastQ     = -Double.MAX_VALUE;
         boolean qSorted  = true;
 
-        for (Iterator<Object []> iter = sqlQuery.iterate(); iter.hasNext();) {
-            Object [] result = iter.next();
+        for (Object  r: sqlQuery.list()) {
+            Object[] result = (Object[]) r;
+
             double km    = (Double) result[0];
             Double w     = (Double) result[1];
             Double q     = (Double) result[2];

http://dive4elements.wald.intevation.org