JDK 7 b73 : PASSES
JDK 7 b74 : FAILS
Platform: Windows, Solaris
The following code minimized from JCK test that instantiates java.awt.Font from "A.ttf" file (attached to CR)
(IMPORTANT) executed with "-Djava.security.manager" option
---------------------------------------------------------------------------
import java.awt.*;
import java.io.File;
public class MiniTest {
public static void main(String[] args) throws Exception {
Font font = Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf"));
}
}
---------------------------------------------------------------------------
Fails with (on Windows):
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.font.FontManagerFactory.<clinit>(FontManagerFactory.java:54)
at java.awt.Font.<init>(Font.java:608)
at java.awt.Font.createFont(Font.java:1018)
at MiniTest.main(MiniTest.java:6)
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "D:\devenv\jdk7b76\jre\lib\fonts\LucidaSansRegular.ttf" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:345)
at java.security.AccessController.checkPermission(AccessController.java:555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at java.io.File.exists(File.java:772)
at sun.font.FontUtilities.<clinit>(FontUtilities.java:117)
... 4 more