|
It the spirit of Bean Validation one should work with multiple constraints and constraint composition in this case. A validator instance should only validate as narrow as possible. The implementation of email validator intentionally returns true for null or the empty string:
if ( value == null || value.length() == 0 ) {
return true;
}
If you want to make sure that the string is not empty you should also add @NotEmpty.
|