class FooImpl implements IFoo1, IFoo2 {
@Override
public Bar getBar() {}
}
Is this legal? The wording in 4.5.5 seems a bit unclear:
> One must not mark a method return value
for cascaded validation more than once in a class hierarchy.
This would render the situation above illegal. But then it goes on:
> In
other words, sub types (be it sub classes/interfaces or interface
implementations) cannot mark the return value for cascaded
validation if the return value has already been marked on a super
type or interface.
This describes only the subtype situation, not addressing the situation above and thus implying that it is legal. Maybe we just remove the second sentence? I think it is also understandable on its own right due to the other cases before.
Note that constraint mappings are explicitly forbidden for parallel hierarchies in section 4.4.5.
Emmanuel, what was our intention when forbidding to specify @Valid several times? Forbidding several occurrences of @ConvertGroup makes sense to me due to the LSP, but several @Valid don't seem problematic to me.
Or was it to "transitively" cover the @ConvertGroup case since we also say that @ConvertGroup may only be given where @Valid is specified?
I think it would make sense to either
* Forbid several occurrences of @Valid (subtypes, parallel hierarchies); Allow @ConvertGroup only where @Valid is given; Don't have additional rules for @ConvertGroup
OR
* Allow several occurrences of @Valid; Allow @ConvertGroup only where @Valid is given; Forbid several occurrences of @ConvertGroup (subtypes, parallel hierarchies)
WDYT?
--Gunnar