Hardy Ferentschik commented on Improvement HV-514

Hi Vivian,

this discussion was not rejected w/o a long discussion beforehand. The problem is the same as Emmanuel Bernard mentioned in the related BVAL issues. He called it "leakage". The problem is that validate value is called with no root bean instance, just the root bean type. What happens if you implement cross field validation via a root bean provided to ConstraintValidatorFactory and validateValue is called? You would not be able to access the other field. In the best case you are catering for this, meaning your constraint behaves differently in validateValue compared to validate and validateProperty_, in the worst case you will get an exception. How is this type of conditional constraint behaviour communicated to the users of such constraints? Providing this feature seems dangerous, especially since there is a preferred way in Bean Validation to do cross field validation, namely a class level constraint. This type of constraint does not have the same problem as the solution you are suggesting. It works with all type of validate calls.

So in this context it feels better to not offer this functionality. Does this explain it better?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira