changeset 2248:e1eaf9c2b5bf

Fix. flys-artifacts/trunk@3897 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 03 Feb 2012 13:33:58 +0000
parents 7a1166758d24
children 997df76c6f58
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Feb 03 13:06:23 2012 +0000
+++ b/flys-artifacts/ChangeLog	Fri Feb 03 13:33:58 2012 +0000
@@ -1,3 +1,8 @@
+2012-02-03  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java:
+	  Fix.
+
 2012-02-03  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/resources/messages.properties,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java	Fri Feb 03 13:06:23 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java	Fri Feb 03 13:33:58 2012 +0000
@@ -798,6 +798,8 @@
         if (rowIndex < 0) {
             rowIndex = -rowIndex -1;
         }
+
+        // TODO Beyond definition, we could stop more clever.
         if (rowIndex >= rows.size()) {
             rowIndex = rows.size() -1;
         }
@@ -821,10 +823,12 @@
                     break;
                 }
             }
-            for (int after = rowIndex, R = rows.size(); after < R; after++) {
-                if (!Double.isNaN(rows.get(after).ws[col])) {
-                    rowAfter = rows.get(after);
-                    break;
+            if (rowBefore != null) {
+                for (int after = rowIndex, R = rows.size(); after < R; after++) {
+                    if (!Double.isNaN(rows.get(after).ws[col])) {
+                        rowAfter = rows.get(after);
+                        break;
+                    }
                 }
             }
 
@@ -915,7 +919,7 @@
             return new double[2][0];
         }
 
-        SplineFunction sf2 = createSpline(km1, errors);
+        SplineFunction sf2 = createSpline(km2, errors);
         if (sf2 == null) {
             return new double[2][0];
         }

http://dive4elements.wald.intevation.org