Added date value pruning to prevent insane dates being passed to calendars

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1145453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christopher John Male 2011-07-12 04:44:04 +00:00
parent e007c5ac88
commit f5ea01a5f4
1 changed files with 4 additions and 1 deletions

View File

@ -127,7 +127,10 @@ public class TestNumericQueryParser extends LuceneTestCase {
while ((randomDate = normalizeNumber(Math.abs(random.nextLong()))
.longValue()) < 1000)
;
// prune date value so it doesn't pass in insane values to some calendars.
randomDate = randomDate % 3400000000000l;
// truncate to second
randomDate = (randomDate / 1000) * 1000;