Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.8.1
-
None
-
None
Description
Given this piece of code:
@Test public void testParseLongNumber() { final DateParser fdf = getInstance("yyyy-MM-dd'T'HH:mm:ssZZ"); fdf.parse("999999999999"); // NFE here }
Internally, the FastDateParser.NumberStrategy::parse method parses the year from that number (without maxWidth because the next part is not a number) using Integer::parseInt thus leading to a NumberFormatException.
A quick fix for this would be catching the NFE then return false after setting the error position so that the FastDateParse::Parse method can throw a ParseException correctly.
Edit: the suggested patch is attached below
Attachments
Attachments
Issue Links
- relates to
-
LANG-1440 Predefined ISO_8601_EXTENDED_* patterns use wrong timezone offset formatter
- Closed