Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java @ 1919:9bec7d2f8c35
Prevent ArrayIndexOutOfBounds, log method entry.
flys-artifacts/trunk@3279 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 17 Nov 2011 09:14:42 +0000 |
parents | 6c7fdfd262ac |
children | f07d64d5cbe1 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java Thu Nov 17 09:13:26 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java Thu Nov 17 09:14:42 2011 +0000 @@ -658,6 +658,7 @@ * @return [[q0, q1, .. qx] , [w0, w1, .. wx]] (can contain NaNs) */ public double [][] interpolateWQColumnwise(double km) { + log.debug("WstValueTable.interpolateWQColumnwise"); double [] qs = new double[columns.length]; double [] ws = new double[columns.length]; @@ -667,6 +668,8 @@ if (rowIndex < 0) { rowIndex = -rowIndex -1; } + if (rowIndex >= rows.size()) + rowIndex = rows.size() -1; Row startRow = rows.get(rowIndex);