On Fri, 6 Nov 2020 03:00:52 GMT, Naoto Sato <na...@openjdk.org> wrote:

>> test/jdk/java/time/tck/java/time/format/TCKDateTimeParseResolver.java line 
>> 858:
>> 
>>> 856:         return new Object[][]{
>>> 857:                 {STRICT, 0, LocalTime.of(6, 0), 0},
>>> 858:                 {STRICT, 1, LocalTime.of(18, 0), 1},
>> 
>> As mentioned in my other comment, this seems odd in STRICT mode.
>
> Did you mean in STRICT mode, HOUR_OF_AMPM should default to 0, and to 6 in 
> SMART/LENIENT modes?

No. I mean that when resolving AMPM/dayPeriod in strict mode, and there is no 
HOUR_OF_DAY or HOUR_OF_AMPM, then do not resolve using "half way between"(ie. 
fail). This will produce a result where `LocalTime` cannot be obtained.

var f = 
DateTimeFormatter.ofPattern("B").withResolverStyle(ResolverStyle.STRICT);
var t = LocalTime.from("at night", f);
would throw an exception in STRICT mode (whereas SMART or LENIENT would return 
a `LocalTime`). Same with pattern "a".

-------------

PR: https://git.openjdk.java.net/jdk/pull/938

Reply via email to