Skip to content

Commit

Permalink
remove overhead methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Jun 11, 2024
1 parent 5301a83 commit 02d4762
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ private void fireValidationStatusChangeEvent() {

private ValidationResult checkValidity(LocalDate value,
boolean withRequiredValidator) {
ValidationResult badInputResult = validateBadInputConstraint(
getBadInputErrorMessage(), value);
if (badInputResult.isError()) {
return badInputResult;
boolean hasBadInput = valueEquals(value, getEmptyValue())
&& isInputValuePresent();
if (hasBadInput) {
return ValidationResult.error(getBadInputErrorMessage());
}

if (withRequiredValidator) {
Expand Down Expand Up @@ -580,14 +580,6 @@ private ValidationResult checkValidity(LocalDate value,
return ValidationResult.ok();
}

private ValidationResult validateBadInputConstraint(String errorMessage,
LocalDate value) {
boolean isError = valueEquals(value, getEmptyValue())
&& isInputValuePresent();
return isError ? ValidationResult.error(errorMessage)
: ValidationResult.ok();
}

/**
* Returns whether the input element has a value or not.
*
Expand Down

0 comments on commit 02d4762

Please sign in to comment.