Skip to content

Commit 2eef7a5

Browse files
committed
Fix #1742 (kind of sort of)
1 parent 8fda858 commit 2eef7a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/fasterxml/jackson/databind/util/StdDateFormat.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ protected Date parseAsISO8601(String dateStr, ParsePosition pos)
596596
}
597597
}
598598

599-
protected Date _parseAsISO8601(String dateStr, ParsePosition pos)
599+
protected Date _parseAsISO8601(String dateStr, ParsePosition bogus)
600600
throws IllegalArgumentException, ParseException
601601
{
602602
final int totalLen = dateStr.length();
@@ -680,8 +680,7 @@ protected Date _parseAsISO8601(String dateStr, ParsePosition pos)
680680
throw new ParseException(String.format(
681681
"Cannot parse date \"%s\": invalid fractional seconds '%s'; can use at most 9 digits",
682682
dateStr, m.group(1).substring(1)
683-
),
684-
pos.getErrorIndex());
683+
), start);
685684
}
686685
// fall through
687686
case 3:
@@ -704,7 +703,9 @@ protected Date _parseAsISO8601(String dateStr, ParsePosition pos)
704703
throw new ParseException
705704
(String.format("Cannot parse date \"%s\": while it seems to fit format '%s', parsing fails (leniency? %s)",
706705
dateStr, formatStr, _lenient),
707-
pos.getErrorIndex());
706+
// [databind#1742]: Might be able to give actual location, some day, but for now
707+
// we can't give anything more indicative
708+
0);
708709
}
709710

710711
private static int _parse4D(String str, int index) {

0 commit comments

Comments
 (0)