提交 36ad855c 编写于 作者: I igor

6968373: FontUtilities static initializer throws AccessControlException

Reviewed-by: prr
上级 3158e58e
...@@ -60,6 +60,10 @@ public final class FontUtilities { ...@@ -60,6 +60,10 @@ public final class FontUtilities {
static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf"; 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. // This static initializer block figures out the OS constants.
static { static {
...@@ -115,6 +119,25 @@ public final class FontUtilities { ...@@ -115,6 +119,25 @@ public final class FontUtilities {
File lucidaFile = new File(jreFontDirName + File.separator File lucidaFile = new File(jreFontDirName + File.separator
+ LUCIDA_FILE_NAME); + LUCIDA_FILE_NAME);
isOpenJDK = !lucidaFile.exists(); 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; return null;
} }
}); });
...@@ -140,32 +163,6 @@ public final class FontUtilities { ...@@ -140,32 +163,6 @@ public final class FontUtilities {
*/ */
public static final int MAX_LAYOUT_CHARCODE = 0x206F; 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. * Calls the private getFont2D() method in java.awt.Font objects.
* *
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 5010310 6319835 6904882 * @bug 5010310 6319835 6904882 6968373
* @summary test fonts can be created in the presence of a security manager * @summary test fonts can be created in the presence of a security manager
* @run main/othervm/secure=java.lang.SecurityManager FontPrivilege * @run main/othervm/secure=java.lang.SecurityManager FontPrivilege
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册