changeset 384:da2da7bb1aa1

Fixed a bug in DefaultResult when querying an index out of bounds. geo-backend/trunk@445 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Dec 2009 11:14:45 +0000
parents 0b813ae17173
children 27082b83c267
files geo-backend/ChangeLog geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/geo-backend/ChangeLog	Tue Dec 15 10:02:24 2009 +0000
+++ b/geo-backend/ChangeLog	Thu Dec 17 11:14:45 2009 +0000
@@ -1,3 +1,8 @@
+2009-12-17  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java:
+	  Fixed bug in DefaultResult when querying an index out of bounds.
+
 2009-12-15  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java (executeQuery): 
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java	Tue Dec 15 10:02:24 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java	Thu Dec 17 11:14:45 2009 +0000
@@ -87,7 +87,10 @@
      * @see de.intevation.gnv.geobackend.base.Result#getInteger(java.lang.String)
      */
     public Integer getInteger(String columnName) {
-        return getInteger(resultDescriptor.getColumnIndex(columnName));
+        int idx = resultDescriptor.getColumnIndex(columnName);
+
+        return idx > -1 ? getInteger(idx) : -1;
+        //return getInteger(resultDescriptor.getColumnIndex(columnName));
     }
 
     public Integer getInteger(int column) {

http://dive4elements.wald.intevation.org