8132408: Check os.name before os.version in SunGraphicsEnvironment constructor
authorsimonis
Wed, 29 Jul 2015 11:43:44 +0200
changeset 31900 b6961b1116d0
parent 31899 9ab5e8d7d116
child 31901 8724b15d3679
8132408: Check os.name before os.version in SunGraphicsEnvironment constructor Reviewed-by: prr
jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java
--- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java	Wed Jul 29 09:47:54 2015 +0400
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java	Wed Jul 29 11:43:44 2015 +0200
@@ -84,6 +84,8 @@
         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);
@@ -117,7 +119,7 @@
                         }
                     } catch (Exception e) {
                     }
-
+                }
                 /* Establish the default font to be used by SG2D etc */
                 defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12);