Like the last one, this could use a regression test - even though
there's a JCK failure. FWIW a trivial one like this :-
import java.awt.*;
import java.io.File;
public class CreateFontSMTest {
public static void main(String[] args) throws Exception {
System.setSecurityManager(new SecurityManager());
Font font = new Font("Dialog", Font.PLAIN, 12);
System.out.println(font.getFontName());
}
}
will work, but I also found we already have a test .. which I
guess never got run :-(, called FontPrivilege.java that does
something very similar. Its also in closed and I leave it
up to you whether to open that or add a new one but opening
it would be best.
-phil.
Roman Kennke wrote:
This patches fixes bug #6904882. As suggested by Phil it puts the whole
static initializer in a privileged block, grouping the existing 4
smaller blocks into one, and importantly including the offending
File.exists() call. This requires to make the static fields non-final.
http://cr.openjdk.java.net/~rkennke/6904882/webrev.00/
Ok to commit?
/Roman