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
public class IntegerRangeValidator extends CustomValidator<Integer> {
private IntegerRangeValidator(int min, int max, String errorMessage) {
super(input -> input >= min && input <= max, errorMessage);
}
....
Could be:
public class IntegerRangeValidator extends CustomValidator<Integer> {
private IntegerRangeValidator(int min, int max, String errorMessage) {
super(input -> null != input && input >= min && input <= max, errorMessage);
}
....
Some background on my usage:
I had set the IntegerRangeValidator into a SingleSelectionField (Selection bound to an IntegerProperty).
Due to some design constraint, I needed to change the SingleSelectionField content using SingleSelectionField.items(List).. This part nullifies the bound IntegerProperty until I use SingleSelectionField.select(0).
This causes an unhandled NullPointerException.
Kindly correct me if I overlooked a better approach.
The text was updated successfully, but these errors were encountered:
For example in IntegerRangeValidator:
Could be:
Some background on my usage:
I had set the IntegerRangeValidator into a SingleSelectionField (Selection bound to an IntegerProperty).
Due to some design constraint, I needed to change the SingleSelectionField content using
SingleSelectionField.items(List)
.. This part nullifies the bound IntegerProperty until I useSingleSelectionField.select(0)
.This causes an unhandled NullPointerException.
Kindly correct me if I overlooked a better approach.
The text was updated successfully, but these errors were encountered: