Following code raises an exception "ConstraintDeclarationException: HV000151: A method overriding another method must not alter the parameter constraint configuration" when validates Bar#test() method
final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
final Set<ConstraintViolation<Object>> violations = validator
.forExecutables()
.validateParameters(
object,
method,
args
);
import javax.validation.constraints.NotNull;
interface Foo {
void test(@NotNull(message = "foo") String value);
}
class Bar implements Foo {
@Override
public void test(@NotNull finalString value) {
System.out.println(value);
}
}
Is it possible to disable this rule ? how to do it if yes? Thanks