mirror of https://github.com/apache/lucene.git
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:
parent
6c459114c3
commit
ee0d911d77
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue