changeset 6444:4faaaf5027a5

7166409: bug4331515.java fail with NullPointerException on ubuntu10.04-x86 for JDK8 Reviewed-by: serb
author alexsch
date Mon, 14 Jan 2013 08:32:29 -0500
parents d54922883f4c
children 9c6ca265b4a1
files src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Jan 09 16:52:08 2013 +0400
+++ b/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;