6968373: FontUtilities static initializer throws AccessControlException
Reviewed-by: prr
This commit is contained in:
parent
37f89e6be6
commit
9ab742ede8
@ -60,6 +60,10 @@ public final class FontUtilities {
|
||||
|
||||
static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf";
|
||||
|
||||
private static boolean debugFonts = false;
|
||||
private static PlatformLogger logger = null;
|
||||
private static boolean logging;
|
||||
|
||||
// This static initializer block figures out the OS constants.
|
||||
static {
|
||||
|
||||
@ -115,6 +119,25 @@ public final class FontUtilities {
|
||||
File lucidaFile = new File(jreFontDirName + File.separator
|
||||
+ LUCIDA_FILE_NAME);
|
||||
isOpenJDK = !lucidaFile.exists();
|
||||
|
||||
String debugLevel =
|
||||
System.getProperty("sun.java2d.debugfonts");
|
||||
|
||||
if (debugLevel != null && !debugLevel.equals("false")) {
|
||||
debugFonts = true;
|
||||
logger = PlatformLogger.getLogger("sun.java2d");
|
||||
if (debugLevel.equals("warning")) {
|
||||
logger.setLevel(PlatformLogger.WARNING);
|
||||
} else if (debugLevel.equals("severe")) {
|
||||
logger.setLevel(PlatformLogger.SEVERE);
|
||||
}
|
||||
}
|
||||
|
||||
if (debugFonts) {
|
||||
logger = PlatformLogger.getLogger("sun.java2d");
|
||||
logging = logger.isEnabled();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
@ -140,32 +163,6 @@ public final class FontUtilities {
|
||||
*/
|
||||
public static final int MAX_LAYOUT_CHARCODE = 0x206F;
|
||||
|
||||
private static boolean debugFonts = false;
|
||||
private static PlatformLogger logger = null;
|
||||
private static boolean logging;
|
||||
|
||||
static {
|
||||
|
||||
String debugLevel =
|
||||
System.getProperty("sun.java2d.debugfonts");
|
||||
|
||||
if (debugLevel != null && !debugLevel.equals("false")) {
|
||||
debugFonts = true;
|
||||
logger = PlatformLogger.getLogger("sun.java2d");
|
||||
if (debugLevel.equals("warning")) {
|
||||
logger.setLevel(PlatformLogger.WARNING);
|
||||
} else if (debugLevel.equals("severe")) {
|
||||
logger.setLevel(PlatformLogger.SEVERE);
|
||||
}
|
||||
}
|
||||
|
||||
if (debugFonts) {
|
||||
logger = PlatformLogger.getLogger("sun.java2d");
|
||||
logging = logger.isEnabled();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the private getFont2D() method in java.awt.Font objects.
|
||||
*
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 5010310 6319835 6904882
|
||||
* @bug 5010310 6319835 6904882 6968373
|
||||
* @summary test fonts can be created in the presence of a security manager
|
||||
* @run main/othervm/secure=java.lang.SecurityManager FontPrivilege
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user