Skip to content

Commit

Permalink
simplifying null or not balnk check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim Alzant committed Jan 19, 2018
1 parent e54354b commit 393fa58
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public boolean isValid(String value, ConstraintValidatorContext constraintValida
}

private boolean hasValidLength(String value){
boolean isAllWhitespace = value.matches("^\\s*$");
return !isAllWhitespace && (value.length() > 0);
return (value.trim().length() > 0);
}
}

0 comments on commit 393fa58

Please sign in to comment.