< prev index next >

src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java

Print this page
rev 12441 : 8132408: Check os.name before os.version in SunGraphicsEnvironment constructor

@@ -82,10 +82,12 @@
 
     public SunGraphicsEnvironment() {
         java.security.AccessController.doPrivileged(
                                     new java.security.PrivilegedAction<Object>() {
             public Object run() {
+                String osName = System.getProperty("os.name");
+                if ("SunOS".equals(osName)) {
                     String version = System.getProperty("os.version", "0.0");
                     try {
                         float ver = Float.parseFloat(version);
                         if (ver > 5.10f) {
                             File f = new File("/etc/release");

@@ -115,11 +117,11 @@
                             }
                             fis.close();
                         }
                     } catch (Exception e) {
                     }
-
+                }
                 /* Establish the default font to be used by SG2D etc */
                 defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12);
 
                 return null;
             }
< prev index next >