<i18n dev> RFR: 8280474: Garbage value passed to getLocaleInfoWrapper in HostLocaleProviderAdapter_md
Daniel Jeliński
djelinski at openjdk.java.net
Fri Jan 21 19:47:37 UTC 2022
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.
-------------
Commit messages:
- Update copyright year
- make sure isGenitive is initialized before use
Changes: https://git.openjdk.java.net/jdk/pull/7184/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7184&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8280474
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/7184.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7184/head:pull/7184
PR: https://git.openjdk.java.net/jdk/pull/7184
More information about the i18n-dev
mailing list