The following code raises an {{ConstraintDeclarationException}} {noformat} HV000151: A method overriding another method must not alter the parameter constraint configuration" {noformat} when {{ Bar#test() }} is validated.
{code} final Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); final Set<ConstraintViolation<Object>> violations = validator .forExecutables() .validateParameters( object, method, args ); {code}
{code} import javax.validation.constraints.NotNull; interface Foo { void test(@NotNull(message = "foo") String value); }
class Bar implements Foo { @Override public void test(@NotNull final String value) { System.out.println(value); } } {code}
Is it possible to disable this rule? If so how?
On another note Why does {{Validator#validateParameters()}} raises this exception instead of returning a set of {{ConstraintViolation}} s ? |
|