RFR: 8368882: NPE during text drawing on machine with JP locale
Sergey Bylokhov
serb at openjdk.org
Wed Oct 1 19:03:37 UTC 2025
On Mon, 29 Sep 2025 16:15:45 GMT, Sergey Nazarkin <snazarki at openjdk.org> wrote:
> There is a reproducible bug in symbol rendering on Windows machines with [particular](https://github.com/openjdk/jdk/blob/9d71af108ea2cc3682607527246d60a19fd820ba/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsEnv.cpp#L244) default locales. This changeset fixes the deferred font initialisation request, which now skips the last font in the list.
>
> The test (attached to the jira) was performed on a Windows 11 machine with the Japanese locale set as the default. Without the fix, it fails with an NPE. With the fix it displays a window showing glyphs drawn by all the fonts accessible from the Java application.
src/java.desktop/share/classes/sun/font/CompositeFont.java line 117:
> 115: deferredInitialisation = new boolean[numSlots];
> 116: if (defer) {
> 117: for (int i=0; i<numSlots-1; i++) {
Do we have any jtreg tests that can reproduce the bug in the JP locale? If not, it would be good to create one based on the test described in the bug report.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27551#discussion_r2395571658
More information about the client-libs-dev
mailing list