Update Validator.java

Fixes #5698