protected boolean strictParseBoolean(String s){
  if (s == null || s.isEmpty()) {
    throw new IllegalArgumentException("empty string does not represent a valid boolean");
  }
  if (s.equalsIgnoreCase("true")) {
    return true;
  }
  if (s.equalsIgnoreCase("false")) {
    return false;
  }
  throw new IllegalArgumentException("Invalid string representing a boolean: " + s);
}

protected boolean strictParseBoolean ( String s ) { if ( s == null || s . isEmpty ( ) ) { throw new IllegalArgumentException ( "empty string does not represent a valid boolean" ) ; } if ( s . equalsIgnoreCase ( "true" ) ) { return true ; } if ( s . equalsIgnoreCase ( "false" ) ) { return false ; } throw new IllegalArgumentException ( "Invalid string representing a boolean: " + s ) ; }
we need this strict function because boolean . parseboolean silently ignores malformed strings
