8201328: SynthParser should use Boolean.parseBoolean
authormartin
Tue, 10 Apr 2018 10:18:01 -0700
changeset 49559 08d1b228e805
parent 49558 b2bd13eafc1c
child 49560 66279035d5e7
8201328: SynthParser should use Boolean.parseBoolean Reviewed-by: serb
src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java	Tue Apr 10 10:17:35 2018 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java	Tue Apr 10 10:18:01 2018 -0700
@@ -746,12 +746,7 @@
                 value = lookup(aValue, Object.class);
                 break;
             case 1: // boolean
-                if (aValue.toUpperCase().equals("TRUE")) {
-                    value = Boolean.TRUE;
-                }
-                else {
-                    value = Boolean.FALSE;
-                }
+                value = Boolean.parseBoolean(aValue);
                 break;
             case 2: // dimension
                 StringTokenizer tok = new StringTokenizer(aValue);
@@ -939,11 +934,11 @@
                   ": destinationInsets must be top left bottom right");
             }
             else if (key.equals(ATTRIBUTE_PAINT_CENTER)) {
-                paintCenter = value.toLowerCase().equals("true");
+                paintCenter = Boolean.parseBoolean(value);
                 paintCenterSpecified = true;
             }
             else if (key.equals(ATTRIBUTE_STRETCH)) {
-                stretch = value.toLowerCase().equals("true");
+                stretch = Boolean.parseBoolean(value);
                 stretchSpecified = true;
             }
             else if (key.equals(ATTRIBUTE_DIRECTION)) {
@@ -989,7 +984,7 @@
                 }
             }
             else if (key.equals(ATTRIBUTE_CENTER)) {
-                center = value.toLowerCase().equals("true");
+                center = Boolean.parseBoolean(value);
             }
         }
         if (painter == null) {