6850398: Allow GraphicsEnvironment to be loaded by system classloader (edit)
authorjgodinez
Mon, 22 Jun 2009 09:47:50 -0700
changeset 3016 2b51287517f1
parent 3015 1f05569195f0
child 3017 217bf37bb0ea
6850398: Allow GraphicsEnvironment to be loaded by system classloader (edit) Reviewed-by: campbell, prr
jdk/src/share/classes/java/awt/GraphicsEnvironment.java
--- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java	Mon Jun 15 09:59:03 2009 -0700
+++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java	Mon Jun 22 09:47:50 2009 -0700
@@ -79,8 +79,9 @@
 
             try {
 //                      long t0 = System.currentTimeMillis();
-                localEnv =
-                    (GraphicsEnvironment) Class.forName(nm).newInstance();
+                ClassLoader cl = ClassLoader.getSystemClassLoader();
+                Class geCls = Class.forName(nm, true, cl);
+                localEnv = (GraphicsEnvironment)geCls.newInstance();
 //              long t1 = System.currentTimeMillis();
 //              System.out.println("GE creation took " + (t1-t0)+ "ms.");
                 if (isHeadless()) {