7166409: bug4331515.java fail with NullPointerException on ubuntu10.04-x86 for JDK8
Reviewed-by: serb
--- 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;