[OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when fontconfig.properties was used

Langer, Christoph christoph.langer at sap.com
Mon Oct 7 13:53:02 UTC 2019

Hi Ichiroh,

this is great, thanks for doing this. We regularly see this and just stumbled over it the other day where the fontconfig of our test user was corrupted somehow.

As for the test, I would reduce the amount of reflection a little bit. It should not be necessary to access SunFontManager via Class.forName, you already exported it to the test via the @modules statement. You can probably use this coding (please try as I didn't test it��):

        SunFontManager sfm = SunFontManager.getInstance();
        Field defaultFontName_fid = SunFontManager.class.getDeclaredField("defaultFontName");
        defaultFontName_fid.set(sfm, "Dialog");
        Method loadFonts_mid = SunFontManager.class.getDeclaredMethod("loadFonts");
        PhysicalFont physicalFont = sfm.getDefaultPhysicalFont();

If you want, I can run your (updated) patch through our test system.


> -----Original Message-----
> From: 2d-dev <2d-dev-bounces at openjdk.java.net> On Behalf Of Ichiroh
> Takiguchi
> Sent: Montag, 7. Oktober 2019 09:33
> To: 2d-dev at openjdk.java.net
> Subject: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when
> fontconfig.properties was used
> Hello.
> Could you review the fix ?
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8221741
> Change: https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.04/
> JTreg testcase and results are including JDK-8221741 [1].
> [1] https://bugs.openjdk.java.net/browse/JDK-8221741
> Thanks,
> Ichiroh Takiguchi
> IBM Japan, Ltd.

More information about the 2d-dev mailing list