[
https://issues.apache.org/jira/browse/LANG-1718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konrad Windszus updated LANG-1718:
----------------------------------
Description:
The following code piece fails with a ParseException on JDK 21.0.1 but succeeds
with JDK 17.0.7 (and earlier)
{code}
FastDateFormat dateFormat =
FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US);
dateFormat2.parse("11:00 AM");
{code}
The reason for that is that the {{dateFormat.pattern}} with JDK21 is
{code}
[104, 0, 58, 0, 109, 0, 109, 0, 47, 32, 97, 0]
{code}
while with JDK 17 it is
{code}
[104, 58, 109, 109, 32, 97]
{code}
Notice the difference in the separator between the time and the am/pm!
was:
The following code piece fails with a ParseException on JDK 21.0.1 but succeeds
with JDK 17.0.7 (and earlier)
{code}
FastDateFormat dateFormat =
FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US);
dateFormat2.parse("11:00 AM");
{code}
The reason for that is that the dateFormat.pattern with JDK21 is
{code}
[104, 0, 58, 0, 109, 0, 109, 0, 47, 32, 97, 0]
{code}
while with JDK 17 it is
{code}
[104, 58, 109, 109, 32, 97]
{code}
Notice the difference in the separator between the time and the am/pm!
> FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US) uses
> incorrect separator on JDK21
> -------------------------------------------------------------------------------------------------
>
> Key: LANG-1718
> URL: https://issues.apache.org/jira/browse/LANG-1718
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.time.*
> Affects Versions: 3.13.0
> Reporter: Konrad Windszus
> Priority: Major
>
> The following code piece fails with a ParseException on JDK 21.0.1 but
> succeeds with JDK 17.0.7 (and earlier)
> {code}
> FastDateFormat dateFormat =
> FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US);
> dateFormat2.parse("11:00 AM");
> {code}
> The reason for that is that the {{dateFormat.pattern}} with JDK21 is
> {code}
> [104, 0, 58, 0, 109, 0, 109, 0, 47, 32, 97, 0]
> {code}
> while with JDK 17 it is
> {code}
> [104, 58, 109, 109, 32, 97]
> {code}
> Notice the difference in the separator between the time and the am/pm!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)