# HG changeset patch # User Ingo Weinzierl # Date 1277802446 0 # Node ID 2b4d197a538c5424767daa153a92e3e105572b07 # Parent 337727011de0067327e03d02b93b91119eda8f34 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 diff -r 337727011de0 -r 2b4d197a538c gnv-artifacts/ChangeLog --- 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 + + 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 Issue318 diff -r 337727011de0 -r 2b4d197a538c gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java --- 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() + "].");