Following code raises an exception "ConstraintDeclarationException: HV000151: A method overriding another method must not alter the parameter constraint configuration" when validates Bar#test() method
{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 ? how to do it if yes? Thanks
On another note why Validator# validateParameters () raises an the exception instead of returns a it in the set of ConstraintViolation ? |
|