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.setAccessible(true);
defaultFontName_fid.set(sfm, "Dialog");
Method loadFonts_mid =
SunFontManager.class.getDeclaredMethod("loadFonts");
loadFonts_mid.setAccessible(true);
loadFonts_mid.invoke(sfm);
PhysicalFont physicalFont = sfm.getDefaultPhysicalFont();
System.out.println(physicalFont);
If you want, I can run your (updated) patch through our test system.
Thanks
Christoph
> -----Original Message-----
> From: 2d-dev <[email protected]> On Behalf Of Ichiroh
> Takiguchi
> Sent: Montag, 7. Oktober 2019 09:33
> To: [email protected]
> 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.