< prev index next >

src/java.base/share/classes/java/lang/Boolean.java

Print this page
8199800: Optimize Boolean.parseBoolean(String)
Reviewed-by: alanb
Contributed-by: Sergey Tsypanov <sergei.tsypanov@yandex.ru>

*** 127,137 **** * representation to be parsed * @return the boolean represented by the string argument * @since 1.5 */ public static boolean parseBoolean(String s) { ! return ((s != null) && s.equalsIgnoreCase("true")); } /** * Returns the value of this {@code Boolean} object as a boolean * primitive. --- 127,137 ---- * representation to be parsed * @return the boolean represented by the string argument * @since 1.5 */ public static boolean parseBoolean(String s) { ! return "true".equalsIgnoreCase(s); } /** * Returns the value of this {@code Boolean} object as a boolean * primitive.
< prev index next >