On Fri, 6 Nov 2020 09:12:38 GMT, Stephen Colebourne <scolebou...@openjdk.org> 
wrote:

>> 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".

Changed to throw an exception in STRICT mode.

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

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

Reply via email to