alhudz opened a new pull request, #1743:
URL: https://github.com/apache/commons-lang/pull/1743
Repro: parse an unparseable date under the `JAPANESE_IMPERIAL` locale
(`ja_JP_JP`), e.g. `FastDateFormat.getInstance("yyyy", TimeZones.GMT, new
Locale("ja", "JP", "JP")).parse("not-a-date")`.
Cause: `parse(String)` builds `msg` = `Unparseable date: '<source>', parse
position = <pp>`, then for the imperial locale throws `String.format("; the %s
locale does not support dates before 1868-01-01.", locale, msg)`. The template
holds a single `%s`, bound to `locale`, so the second argument `msg` is
silently ignored: the whole `Unparseable date` diagnostic (source text and
parse position) is dropped and the message begins with a stray `; `, unlike the
non-imperial branch which throws `msg`.
Fix: give the template a leading `%s` for `msg` so the diagnostic survives,
matching the non-imperial branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]