Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed optional setting fields requiring a value set #1525

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

Mailaender
Copy link
Contributor

#1523 introduced a regression where everything was required because I reused a validator that is put on every widget.

@eselmeister
Copy link
Contributor

The EmptyStringValidator requires a null check:

Currently, ValidationStatus.ok() is returned if value is null.

@Override
public IStatus validate(Object value) {

	if(value instanceof String text && text.isEmpty()) {
		return ValidationStatus.error(ERROR);
	}
	return ValidationStatus.ok();
}

@Mailaender
Copy link
Contributor Author

That is already checked on InputValidator, but I can add it here, too.

@eselmeister eselmeister merged commit 2e7cb70 into eclipse:develop Oct 6, 2023
3 checks passed
eselmeister added a commit that referenced this pull request Oct 6, 2023
The code is fine, but small enhancements have been added:
The constructor is available by default, it doesn't need to be specified
explicitly. Added the "else if" construct for better readability of the
flow.
@Mailaender Mailaender deleted the optional-settings branch October 6, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants