Skip to content

Commit

Permalink
Don't need to create another string to check isBlank
Browse files Browse the repository at this point in the history
  • Loading branch information
altro3 committed Oct 29, 2023
1 parent 87fd4ed commit 50a4705
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ final class InternalConstraintValidators {

final ConstraintValidator<NotBlank, CharSequence> notBlankValidator =
(value, annotationMetadata, context) ->
StringUtils.isNotEmpty(value) && value.toString().trim().length() > 0;
StringUtils.isNotEmpty(value) && !value.toString().isBlank();

final ConstraintValidator<NotNull, Object> notNullValidator =
(value, annotationMetadata, context) -> value != null;
Expand Down

0 comments on commit 50a4705

Please sign in to comment.