[bv-dev] Question on Formal Group Definitions rules

Matt Benson mbenson at apache.org
Mon Apr 9 18:46:25 EDT 2018


Hi all,
With reference to spec v2.0 section 5.4.6, I am having trouble with item
3b, where a class X has no @GroupSequence annotation, among its Default
constraints are:

if X has a direct superclass Y, every constraint in the group Default
of Y *this
rule is necessary in case Y redefines the group Default*

Consider this with the concrete example in
GroupSequenceIsolationTest#testCorrectDefaultSequenceInheritance3(). Here
B3 extends A, whose @GroupSequence is defined as { Minimal, A }. Rule 4
says of a class X with a @GroupSequence annotation:

If X does have a @GroupSequence annotation, the group Default contains
every constraint belonging to every group declared by the @GroupSequence
annotation.

I thus conclude that Default contains for A: { Minimal, A } and that
Default for B3 should contain { B3 (per rule 3a), Minimal, A } and that the
validation performed at line 128 should detect violations at:

nickname (group B3)
size (group Minimal)
name (group A)

The assertions of the test, however, expect only the first two. Why is A
omitted? If the sequence defined by a superclass to be respected, where is
this specified? TBH I would think it would make sense, but my read of this
section specifically set me down a path of removing this behavior from the
Apache BVal codebase as I couldn't find a justification for it.

Thanks,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20180409/71eee744/attachment-0001.html 


More information about the beanvalidation-dev mailing list