src/java.base/share/classes/java/lang/Boolean.java
changeset 49509 94ca39ef0b39
parent 47216 71c04702a3d5
child 57956 e0b8b019d2f5
equal deleted inserted replaced
49508:8f041818aca9 49509:94ca39ef0b39
   127      *                 representation to be parsed
   127      *                 representation to be parsed
   128      * @return     the boolean represented by the string argument
   128      * @return     the boolean represented by the string argument
   129      * @since 1.5
   129      * @since 1.5
   130      */
   130      */
   131     public static boolean parseBoolean(String s) {
   131     public static boolean parseBoolean(String s) {
   132         return ((s != null) && s.equalsIgnoreCase("true"));
   132         return "true".equalsIgnoreCase(s);
   133     }
   133     }
   134 
   134 
   135     /**
   135     /**
   136      * Returns the value of this {@code Boolean} object as a boolean
   136      * Returns the value of this {@code Boolean} object as a boolean
   137      * primitive.
   137      * primitive.