# HG changeset patch # User Ingo Weinzierl # Date 1260528318 0 # Node ID 4af6379ac20b2d0e0b6cc9491877cc1be552ec99 # Parent 4a874c66412323a64d389ede26d7e03ad9f15dde Changed exception handling if a the value of a column, which is not contained in Result, is requested. Will not throw an exception but return null. geo-backend/trunk@417 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 4a874c664123 -r 4af6379ac20b geo-backend/ChangeLog --- a/geo-backend/ChangeLog Fri Dec 11 10:34:36 2009 +0000 +++ b/geo-backend/ChangeLog Fri Dec 11 10:45:18 2009 +0000 @@ -1,3 +1,10 @@ +2009-12-11 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java: + DefaultResult will return null if it doesn't contain the specified column + name in method getString(String columnName), instead of throwing an + exception. + 2009-12-11 Sascha L. Teichmann * src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java, diff -r 4a874c664123 -r 4af6379ac20b geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Fri Dec 11 10:34:36 2009 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Fri Dec 11 10:45:18 2009 +0000 @@ -108,7 +108,9 @@ * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String) */ public String getString(String columnName) { - return getString(resultDescriptor.getColumnIndex(columnName)); + int idx = resultDescriptor.getColumnIndex(columnName); + + return idx > -1 ? getString(idx) : null; } public String getString(int column) {