You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a CompositeValidator has two other validators which return a similar message when they are invalid, the validation status of the CompositeValidator is true but should be false.
Unittest to reproduce the bug:
@Test
public void test() {
final StringProperty prop1 = new SimpleStringProperty();
final StringProperty prop2 = new SimpleStringProperty();
final Validator notEmpty1 = new FunctionBasedValidator<>(prop1, v -> {
if (Strings.isNullOrEmpty(v)) {
return ValidationMessage.error("msg");
}
return null;
});
final Validator notEmpty2 = new FunctionBasedValidator<>(prop2, v -> {
if (Strings.isNullOrEmpty(v)) {
return ValidationMessage.error("msg");
}
return null;
});
final CompositeValidator compositeValidator = new CompositeValidator(notEmpty1, notEmpty2);
prop1.set("");
prop2.set("");
prop1.set("a");
assertThat(notEmpty1.getValidationStatus().isValid()).isTrue();
assertThat(notEmpty2.getValidationStatus().isValid()).isFalse();
assertThat(compositeValidator.getValidationStatus().isValid()).isFalse();
}
The text was updated successfully, but these errors were encountered:
When a CompositeValidator has two other validators which return a similar message when they are invalid, the validation status of the CompositeValidator is true but should be false.
Unittest to reproduce the bug:
The text was updated successfully, but these errors were encountered: