[bv-dev] Group conversion on overridden method

Emmanuel Bernard emmanuel at hibernate.org
Mon Jan 28 12:12:49 EST 2013


Yes that was the idea to only offer the first variant as valid. If the spec is too unclear open an issue.  

On 28 janv. 2013, at 17:51, Gunnar Morling <gunnar at hibernate.org> wrote:

> Emmanuel, all,
> 
> I need a short confirmation related to the definition of group conversions for the return value of an overriding method. IIUC, the following is legal:
> 
> Class Foo {
>     public Bar getBar() {}
> }
> 
> Class SubFoo extends Foo {
> 
>     @Valid
>     @ConvertGroup(from=..., to=...)
>     @Override
>     public Bar getBar() {}
> }
> 
> That is, SubFoo can define a group conversion for the return value as @Valid itself is added in SubFoo only. It would be illegal if @Valid was given in Foo, too.
> 
> I think that makes sense since LSP is not violated by the first variant, while it would in the second (a user of Foo wouldn't be aware of the applying conversions).
> 
> Right?
> 
> Thanks,
> 
> --Gunnar
> 
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev



More information about the beanvalidation-dev mailing list