7166409: bug4331515.java fail with NullPointerException on ubuntu10.04-x86 for JDK8
authoralexsch
Mon, 14 Jan 2013 08:32:29 -0500
changeset 15315 9db01c15ae0c
parent 14992 e9db4be29324
child 15316 0dcb6f02678d
7166409: bug4331515.java fail with NullPointerException on ubuntu10.04-x86 for JDK8 Reviewed-by: serb
jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Jan 09 16:52:08 2013 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Mon Jan 14 08:32:29 2013 -0500
@@ -2619,13 +2619,15 @@
 
     private static class FocusColorProperty extends DesktopProperty {
         public FocusColorProperty () {
-            // Fallback value is never used bacause of the configureValue method doesn't return null
+            // Fallback value is never used because of the configureValue method doesn't return null
             super("win.3d.backgroundColor", Color.BLACK);
         }
 
         @Override
         protected Object configureValue(Object value) {
-            if (! ((Boolean)Toolkit.getDefaultToolkit().getDesktopProperty("win.highContrast.on")).booleanValue()){
+            Object highContrastOn = Toolkit.getDefaultToolkit().
+                    getDesktopProperty("win.highContrast.on");
+            if (highContrastOn == null || !((Boolean) highContrastOn).booleanValue()) {
                 return Color.BLACK;
             }
             return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK;