Mercurial > dive4elements > gnv-client
changeset 1109:2b4d197a538c
Fixed the time range validation - introduced an epsilon of one second for valid time ranges (issue286).
gnv-artifacts/trunk@1240 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 Jun 2010 09:07:26 +0000 |
parents | 337727011de0 |
children | c6b2437c0c13 |
files | gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java |
diffstat | 2 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog Tue Jun 29 08:47:46 2010 +0000 +++ b/gnv-artifacts/ChangeLog Tue Jun 29 09:07:26 2010 +0000 @@ -1,3 +1,15 @@ +2010-06-29 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue286 + + * src/main/java/de/intevation/gnv/utils/InputValidator.java: Added a buffer + of 1 second for the valid time range. The valid values that are returnd + from database differ in milliseconds. Example: the lower time returned + from database is 00:00:00.650, the gui will display 00:00:00. This caused + an error because the data given by the user was 650 ms under the lower + bound. With a 1 second range, the lower bound is moved to 23:59:59.650, so + that the time given by the user is in the valid range. + 2010-06-29 Tim Englich <tim.englich@intevation.de> Issue318
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Tue Jun 29 08:47:46 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Tue Jun 29 09:07:26 2010 +0000 @@ -233,7 +233,8 @@ log.debug("-> input data [sec]: " + tmpTime); } - if (tmpTime < tmpLow || tmpTime > tmpUp) { + // XXX There is a buffer of 1 second for the valid range of the time. + if (tmpTime < (tmpLow-1) || tmpTime > (tmpUp+1)) { log.warn( "Date [" + tmp.toString() + "] is out of range [" + lo.toString() + " to "+ up.toString() + "].");