src/share/classes/java/awt/GraphicsEnvironment.java

Print this page

        

*** 93,114 **** private static GraphicsEnvironment createGE() { GraphicsEnvironment ge; String nm = AccessController.doPrivileged(new GetPropertyAction("java.awt.graphicsenv", null)); try { // long t0 = System.currentTimeMillis(); ! Class geCls; try { // First we try if the bootclassloader finds the requested // class. This way we can avoid to run in a privileged block. ! geCls = Class.forName(nm); } catch (ClassNotFoundException ex) { // If the bootclassloader fails, we try again with the // application classloader. ClassLoader cl = ClassLoader.getSystemClassLoader(); ! geCls = Class.forName(nm, true, cl); } ! ge = (GraphicsEnvironment) geCls.newInstance(); // long t1 = System.currentTimeMillis(); // System.out.println("GE creation took " + (t1-t0)+ "ms."); if (isHeadless()) { ge = new HeadlessGraphicsEnvironment(ge); } --- 93,114 ---- private static GraphicsEnvironment createGE() { GraphicsEnvironment ge; String nm = AccessController.doPrivileged(new GetPropertyAction("java.awt.graphicsenv", null)); try { // long t0 = System.currentTimeMillis(); ! Class<GraphicsEnvironment> geCls; try { // First we try if the bootclassloader finds the requested // class. This way we can avoid to run in a privileged block. ! geCls = (Class<GraphicsEnvironment>)Class.forName(nm); } catch (ClassNotFoundException ex) { // If the bootclassloader fails, we try again with the // application classloader. ClassLoader cl = ClassLoader.getSystemClassLoader(); ! geCls = (Class<GraphicsEnvironment>)Class.forName(nm, true, cl); } ! ge = geCls.newInstance(); // long t1 = System.currentTimeMillis(); // System.out.println("GE creation took " + (t1-t0)+ "ms."); if (isHeadless()) { ge = new HeadlessGraphicsEnvironment(ge); }
*** 159,169 **** * @since 1.4 */ private static boolean getHeadlessProperty() { if (headless == null) { java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction() { public Object run() { String nm = System.getProperty("java.awt.headless"); if (nm == null) { /* No need to ask for DISPLAY when run in a browser */ --- 159,169 ---- * @since 1.4 */ private static boolean getHeadlessProperty() { if (headless == null) { java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<Object>() { public Object run() { String nm = System.getProperty("java.awt.headless"); if (nm == null) { /* No need to ask for DISPLAY when run in a browser */