<div dir="ltr">Hi all,<br>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:<br><br>if X has a direct superclass Y, every constraint in the group Default of Y <i>this rule is necessary in case Y redefines the group Default</i><br><br><div>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:</div><div><br></div><div>

<span style="color:rgba(0,0,0,0.8);font-family:&quot;Noto Serif&quot;,&quot;DejaVu Serif&quot;,serif;font-size:17px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:-0.17px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If<span> </span></span><code class="gmail-classname" style="box-sizing:border-box;font-family:&quot;Droid Sans Mono&quot;,&quot;DejaVu Sans Mono&quot;,monospace;font-size:0.9375em;font-weight:400;color:rgba(0,0,0,0.9);letter-spacing:0px;padding:0.1em 0.5ex;word-spacing:-0.15em;background-color:rgb(247,247,248);border-radius:4px;line-height:1.45;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;text-decoration-style:initial;text-decoration-color:initial">X</code><span style="color:rgba(0,0,0,0.8);font-family:&quot;Noto Serif&quot;,&quot;DejaVu Serif&quot;,serif;font-size:17px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:-0.17px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>does have a<span> </span></span><code class="gmail-classname" style="box-sizing:border-box;font-family:&quot;Droid Sans Mono&quot;,&quot;DejaVu Sans Mono&quot;,monospace;font-size:0.9375em;font-weight:400;color:rgba(0,0,0,0.9);letter-spacing:0px;padding:0.1em 0.5ex;word-spacing:-0.15em;background-color:rgb(247,247,248);border-radius:4px;line-height:1.45;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;text-decoration-style:initial;text-decoration-color:initial">@GroupSequence</code><span style="color:rgba(0,0,0,0.8);font-family:&quot;Noto Serif&quot;,&quot;DejaVu Serif&quot;,serif;font-size:17px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:-0.17px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>annotation, the group<span> </span></span><code class="gmail-classname" style="box-sizing:border-box;font-family:&quot;Droid Sans Mono&quot;,&quot;DejaVu Sans Mono&quot;,monospace;font-size:0.9375em;font-weight:400;color:rgba(0,0,0,0.9);letter-spacing:0px;padding:0.1em 0.5ex;word-spacing:-0.15em;background-color:rgb(247,247,248);border-radius:4px;line-height:1.45;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;text-decoration-style:initial;text-decoration-color:initial">Default</code><span style="color:rgba(0,0,0,0.8);font-family:&quot;Noto Serif&quot;,&quot;DejaVu Serif&quot;,serif;font-size:17px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:-0.17px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>contains every constraint belonging to every group declared by the<span> </span></span><code class="gmail-classname" style="box-sizing:border-box;font-family:&quot;Droid Sans Mono&quot;,&quot;DejaVu Sans Mono&quot;,monospace;font-size:0.9375em;font-weight:400;color:rgba(0,0,0,0.9);letter-spacing:0px;padding:0.1em 0.5ex;word-spacing:-0.15em;background-color:rgb(247,247,248);border-radius:4px;line-height:1.45;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;text-decoration-style:initial;text-decoration-color:initial">@GroupSequence</code><span style="color:rgba(0,0,0,0.8);font-family:&quot;Noto Serif&quot;,&quot;DejaVu Serif&quot;,serif;font-size:17px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:-0.17px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>annotation.</span>

<br></div><div><br></div><div>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:</div><div><br></div><div>nickname (group B3)</div><div>size (group Minimal)</div><div>name (group A)</div><div><br></div><div>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&#39;t find a justification for it.</div><div><br></div><div>Thanks,</div><div>Matt</div></div>