8267521: Post JEP 411 refactoring: maximum covering > 50K

Reviewed-by: dfuchs, prr
This commit is contained in:
Weijun Wang 2021-06-02 15:48:50 +00:00
parent 40d23a0c0b
commit 508cec7535
18 changed files with 205 additions and 104 deletions

View file

@ -62,7 +62,6 @@ import sun.util.logging.PlatformLogger;
* implementations. The platform specific parts are declared as abstract
* methods that have to be implemented by specific implementations.
*/
@SuppressWarnings("removal")
public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private static class TTFilter implements FilenameFilter {
@ -266,6 +265,11 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private static int maxSoftRefCnt = 10;
static {
initStatic();
}
@SuppressWarnings("removal")
private static void initStatic() {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
FontManagerNativeLibrary.load();
@ -306,6 +310,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
/* Initialise ptrs used by JNI methods */
private static native void initIDs();
@SuppressWarnings("removal")
protected SunFontManager() {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
@ -1112,6 +1117,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private boolean haveCheckedUnreferencedFontFiles;
@SuppressWarnings("removal")
private String[] getFontFilesFromPath(boolean noType1) {
final FilenameFilter filter;
if (noType1) {
@ -1446,6 +1452,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
return new HashMap<>(0);
}
@SuppressWarnings("removal")
Font2D findFontFromPlatformMap(String lcName, int style) {
HashMap<String, FamilyDescription> platformFontMap = SunFontManager.platformFontMap;
if (platformFontMap == null) {
@ -1739,6 +1746,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
} else if (pathDirs.length==1) {
return pathDirs[0] + File.separator + s;
} else {
@SuppressWarnings("removal")
String path = AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
@ -2204,6 +2212,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private int createdFontCount = 0;
@SuppressWarnings("removal")
public Font2D[] createFont2D(File fontFile, int fontFormat, boolean all,
boolean isCopy, CreatedFontTracker tracker)
throws FontFormatException {
@ -2952,6 +2961,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
return fontPath;
}
@SuppressWarnings("removal")
protected void loadFonts() {
if (discoveredAllFonts) {
return;
@ -3069,6 +3079,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
return defaultFontName;
}
@SuppressWarnings("removal")
public void loadFontFiles() {
loadFonts();
if (loadedAllFontFiles) {
@ -3433,6 +3444,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
// Provides an aperture to add native font family names to the map
protected void addNativeFontFamilyNames(TreeMap<String, String> familyNames, Locale requestedLocale) { }
@SuppressWarnings("removal")
public void register1dot0Fonts() {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
@ -3472,6 +3484,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
* on windows and uses that if set.
*/
private static Locale systemLocale = null;
@SuppressWarnings("removal")
private static Locale getSystemStartupLocale() {
if (systemLocale == null) {
systemLocale = AccessController.doPrivileged(new PrivilegedAction<Locale>() {