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