In general, subclasses should not define constraints on method parameters that are stricter than those defined in superclasses. There was a detailed discussion on that in HV-421 Closed .
For instance, In Spring, with validation enabled, if I have two classes like this:
... I get a ConstraintDefinitionException on the first invocation of B.foo and rightly so.
I think the annotation processor should be able to detect this (and other cases cases mentioned in HV-421 Closed ) at compile time. It doesn't seem to do that.