jdk/src/share/classes/sun/font/FontManagerFactory.java
changeset 4824 791405fa20ff
parent 3929 de1a48b7aa41
child 5506 202f599c92aa
--- a/jdk/src/share/classes/sun/font/FontManagerFactory.java	Thu Jan 28 11:26:54 2010 -0800
+++ b/jdk/src/share/classes/sun/font/FontManagerFactory.java	Tue Feb 02 16:38:26 2010 +0100
@@ -68,38 +68,34 @@
             return instance;
         }
 
-        String fmClassName = AccessController.doPrivileged(
-                new GetPropertyAction("sun.font.fontmanager",
-                                      DEFAULT_CLASS));
-
-        try {
-            @SuppressWarnings("unchecked")
-            ClassLoader cl = (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        return ClassLoader.getSystemClassLoader();
-                    }
-                });
+        AccessController.doPrivileged(new PrivilegedAction() {
 
-            @SuppressWarnings("unchecked")
-            Class fmClass = Class.forName(fmClassName, true, cl);
-            instance = (FontManager) fmClass.newInstance();
-
-        } catch (ClassNotFoundException ex) {
-            InternalError err = new InternalError();
-            err.initCause(ex);
-            throw err;
+            public Object run() {
+                try {
+                    String fmClassName =
+                            System.getProperty("sun.font.fontmanager",
+                                               DEFAULT_CLASS);
+                    ClassLoader cl = ClassLoader.getSystemClassLoader();
+                    Class fmClass = Class.forName(fmClassName, true, cl);
+                    instance = (FontManager) fmClass.newInstance();
+                } catch (ClassNotFoundException ex) {
+                    InternalError err = new InternalError();
+                    err.initCause(ex);
+                    throw err;
 
-        } catch (InstantiationException ex) {
-            InternalError err = new InternalError();
-            err.initCause(ex);
-            throw err;
+                } catch (InstantiationException ex) {
+                    InternalError err = new InternalError();
+                    err.initCause(ex);
+                    throw err;
 
-        } catch (IllegalAccessException ex) {
-            InternalError err = new InternalError();
-            err.initCause(ex);
-            throw err;
-        }
+                } catch (IllegalAccessException ex) {
+                    InternalError err = new InternalError();
+                    err.initCause(ex);
+                    throw err;
+                }
+                return null;
+            }
+        });
 
         return instance;
     }