JDK-8273581 : Change the mechanism by which JDK loads the platform-specific FontManager class
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 13,17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-09-10
  • Updated: 2021-10-04
  • Resolved: 2021-09-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b17Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Description
sun.font.FontManagerFactory uses reflection to load platform specific sun.font.FontManager class from "sun.font.fontmanager" system property.

https://github.com/openjdk/jdk/blob/c81690d7166c32caff6ef3a55fe9b157049e2b56/src/java.desktop/share/classes/sun/font/FontManagerFactory.java#L79

The "sun.font.fontmanager" property can be one of:
"sun.awt.Win32FontManager"
"sun.font.CFontManager"
 "sun.awt.X11FontManager"

sun.font.FontManager is internal JDK class and JDK modularization feature prevents a user from providing custom FontManager class.

It would be good to avoid using reflection in this case and create corresponding platform specific classes directly.
Comments
Changeset: 961dcffc Author: Alexander Scherbatiy <alexsch@openjdk.org> Date: 2021-09-28 09:26:51 +0000 URL: https://git.openjdk.java.net/jdk/commit/961dcffc862a4830fbf26791835a98c12d4b513e
28-09-2021