LUCENE-4135: checkDateFormatSanity needs to handle ParseException

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1349992 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-06-13 18:59:22 +00:00
parent 6c459114c3
commit ee0d911d77
1 changed files with 6 additions and 3 deletions

View File

@ -88,10 +88,13 @@ public class TestNumericQueryParser extends LuceneTestCase {
private static IndexReader reader = null;
private static IndexSearcher searcher = null;
private static boolean checkDateFormatSanity(DateFormat dateFormat, long date)
throws ParseException {
return date == dateFormat.parse(dateFormat.format(new Date(date)))
private static boolean checkDateFormatSanity(DateFormat dateFormat, long date) {
try {
return date == dateFormat.parse(dateFormat.format(new Date(date)))
.getTime();
} catch (ParseException e) {
return false;
}
}
@BeforeClass