< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java

Print this page
8201328: SynthParser should use Boolean.parseBoolean
Reviewed-by: serb

*** 744,759 **** switch (iType) { case 0: // idref value = lookup(aValue, Object.class); break; case 1: // boolean ! if (aValue.toUpperCase().equals("TRUE")) { ! value = Boolean.TRUE; ! } ! else { ! value = Boolean.FALSE; ! } break; case 2: // dimension StringTokenizer tok = new StringTokenizer(aValue); value = new DimensionUIResource( nextInt(tok, "Invalid dimension"), --- 744,754 ---- switch (iType) { case 0: // idref value = lookup(aValue, Object.class); break; case 1: // boolean ! value = Boolean.parseBoolean(aValue); break; case 2: // dimension StringTokenizer tok = new StringTokenizer(aValue); value = new DimensionUIResource( nextInt(tok, "Invalid dimension"),
*** 937,951 **** else if (key.equals(ATTRIBUTE_DEST_INSETS)) { destInsets = parseInsets(value, type + ": destinationInsets must be top left bottom right"); } else if (key.equals(ATTRIBUTE_PAINT_CENTER)) { ! paintCenter = value.toLowerCase().equals("true"); paintCenterSpecified = true; } else if (key.equals(ATTRIBUTE_STRETCH)) { ! stretch = value.toLowerCase().equals("true"); stretchSpecified = true; } else if (key.equals(ATTRIBUTE_DIRECTION)) { value = value.toUpperCase().intern(); if (value == "EAST") { --- 932,946 ---- else if (key.equals(ATTRIBUTE_DEST_INSETS)) { destInsets = parseInsets(value, type + ": destinationInsets must be top left bottom right"); } else if (key.equals(ATTRIBUTE_PAINT_CENTER)) { ! paintCenter = Boolean.parseBoolean(value); paintCenterSpecified = true; } else if (key.equals(ATTRIBUTE_STRETCH)) { ! stretch = Boolean.parseBoolean(value); stretchSpecified = true; } else if (key.equals(ATTRIBUTE_DIRECTION)) { value = value.toUpperCase().intern(); if (value == "EAST") {
*** 987,997 **** else { throw new SAXException(type + ": unknown direction"); } } else if (key.equals(ATTRIBUTE_CENTER)) { ! center = value.toLowerCase().equals("true"); } } if (painter == null) { if (type == ELEMENT_PAINTER) { throw new SAXException(type + --- 982,992 ---- else { throw new SAXException(type + ": unknown direction"); } } else if (key.equals(ATTRIBUTE_CENTER)) { ! center = Boolean.parseBoolean(value); } } if (painter == null) { if (type == ELEMENT_PAINTER) { throw new SAXException(type +
< prev index next >