private boolean isValidShardDate ( String shardDate ) { try { // If the format is invalid, a ParseException is thrown. Utils . dateFromString ( shardDate ) ; return true ; } catch ( IllegalArgumentException ex ) { return false ; } }
is bad just return false .