On Fri, 21 Jan 2022 19:28:21 GMT, Daniel JeliƄski <djelin...@openjdk.org> wrote:

> Reported by clang-tidy. Verified manually by running
> 
>         Calendar c = Calendar.getInstance();
>         System.out.println (c.getDisplayNames(Calendar.MONTH, 
> Calendar.SHORT_STANDALONE, Locale.getDefault()));
> 
> with `-Djava.locale.providers=HOST`
> 
> Without the fix the WINAPI functions fail, and [this 
> block](https://github.com/openjdk/jdk/blame/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c#L857)
>  is never entered. With the fix this block is entered and sensible values are 
> stored in the returned array.
> 
> No test because the observable effect with and without the fix was the same; 
> apparently there's a fallback to another provider that works.

Looks good. The difference would be observable for locales that have different 
month names for standalone/format, such as Polish 😀
I'd add `noreg-hard` label to the JBS issue, as it would require Windows to be 
set to those locales.

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

Marked as reviewed by naoto (Reviewer).

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

Reply via email to