Mercurial > dive4elements > gnv-client
changeset 104:5e086156e3d1
Bugfix: Remove leading- and trailingwhitespaces from Date- and Integervalues
gnv-artifacts/trunk@153 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 29 Sep 2009 12:03:39 +0000 |
parents | 4042844339ee |
children | 11b2d43da90d |
files | gnv-artifacts/Changelog gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/Changelog Tue Sep 29 12:01:41 2009 +0000 +++ b/gnv-artifacts/Changelog Tue Sep 29 12:03:39 2009 +0000 @@ -1,3 +1,8 @@ +2009-09-29 Tim Englich <tim.englich@intevation.de> + + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: + Bugfix: Remove leading- and trailingwhitspaces from Date- and Integervalues + 2009-09-29 Tim Englich <tim.englich@intevation.de> * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileArtifact):
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Tue Sep 29 12:01:41 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Tue Sep 29 12:03:39 2009 +0000 @@ -31,11 +31,11 @@ for (int i = 0; i < values.length; i++){ boolean valid; if ("Integer".equalsIgnoreCase(type)){ - valid = org.apache.commons.validator.GenericValidator.isInt(values[i]); + valid = org.apache.commons.validator.GenericValidator.isInt(values[i].trim()); }else if ("String".equalsIgnoreCase(type)){ valid = org.apache.commons.validator.GenericValidator.matchRegexp(values[i], "[a-zA-Z0-9]"); }else if ("Date".equalsIgnoreCase(type)){ - valid = org.apache.commons.validator.GenericValidator.isDate(values[i], DateUtils.DATE_PATTERN, true); + valid = org.apache.commons.validator.GenericValidator.isDate(values[i].trim(), DateUtils.DATE_PATTERN, true); }else{ valid = false; }