981N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
981N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
981N/A *
981N/A * This code is free software; you can redistribute it and/or modify it
981N/A * under the terms of the GNU General Public License version 2 only, as
981N/A * published by the Free Software Foundation.
981N/A *
981N/A * This code is distributed in the hope that it will be useful, but WITHOUT
981N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
981N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
981N/A * version 2 for more details (a copy is included in the LICENSE file that
981N/A * accompanied this code).
981N/A *
981N/A * You should have received a copy of the GNU General Public License version
981N/A * 2 along with this work; if not, write to the Free Software Foundation,
981N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
981N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
981N/A */
981N/A
981N/A/*
981N/A * @test
981N/A * @bug 6785424
981N/A * @summary Test no SecurityException searching for a font.
981N/A * @run main FontAccess
981N/A *
981N/A * This can only test the specific bug if run on something like
981N/A * Windows Citrix Server where SystemDirectory and WindowsDirectory
981N/A * are different locations.
981N/A */
981N/A
981N/Aimport java.awt.*;
981N/Aimport java.awt.image.*;
981N/A
981N/Apublic class FontAccess {
981N/A
981N/A public static void main(String[] args) {
981N/A System.setSecurityManager(new SecurityManager());
981N/A Font f = new Font("Verdana", Font.PLAIN, 12);
981N/A BufferedImage bi = new BufferedImage(1,1,1);
981N/A Graphics2D g = bi.createGraphics();
981N/A g.setFont(f);
981N/A System.out.println(g.getFontMetrics());
981N/A }
981N/A}