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

Ichiroh Takiguchi takiguc at linux.vnet.ibm.com
Mon Oct 7 17:15:36 UTC 2019


Hello Christoph.

I appreciate your suggestion.
JTreg testcase could throw ClassCastException instead of 
InvocationTargetException.
JTreg results were in JDK-8221741

Bug:    https://bugs.openjdk.java.net/browse/JDK-8221741
Change: https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.05/

Could you review the fix ?

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2019-10-07 22:53, Langer, Christoph wrote:
> 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 <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