RFR: JDK-8304054: Linux: NullPointerException from FontConfiguration.getVersion in case no fonts are installed

Phil Race prr at openjdk.org
Fri Apr 7 02:35:45 UTC 2023


On Thu, 16 Mar 2023 09:15:50 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> src/java.desktop/share/classes/sun/awt/FontConfiguration.java line 1256:
>> 
>>> 1254:         if (head == null) {
>>> 1255:             throw new RuntimeException("Fontconfig head is null, check your fonts or fonts configuration");
>>> 1256:         }
>> 
>> should it be unspecified RuntimeException or InternalError?
>
> Hi Sergey, when looking through  the java.desktop codebase I see both used quite a lot,  so probably both would be okay.

I interpret InternalError as meaning something wrong with the JDK itself, not something in the environment causing
a problem, so RTE would be fine here.

But this NPE is coming from a field (head) that is initialised by code that reads a binary font configuration file.
Are you quite sure you've diagnosed the root of the problem ? Or that this message is really in the right place ?

What does -Dsun.java2d.debugfonts=true reveal ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13045#discussion_r1160391507



More information about the client-libs-dev mailing list