[bv-dev] BVAL-341 - @Nullable

Hardy Ferentschik hardy at hibernate.org
Mon Jan 7 06:35:57 EST 2013


-1 for @Nullable. It is not a constraint in the Bean Validation sense. It provided different type of metadata.

--Hardy


On 2 Jan 2013, at 1:15 PM, Emmanuel Bernard <emmanuel at hibernate.org> wrote:

> Hello,
> 
> Matthew argues for a new basic constraint named `@Nullable`. The goal is
> to make it clear when an element is nullable. Today you can guess it
> from the fact that it does not host a `@NotNull` constraint. But it's
> ambiguous as someone might have simply forgotten the constraint.
> 
> https://hibernate.onjira.com/browse/BVAL-341
> 
> I am not in favor of this for a few reasons. I think what Matthew is
> after is `@Nullable` with the semantic of JSR 305: the element is always
> nullable no matter what - and possibly can be computed by a tool at
> compile time. But since Bean Validation is only validated at specific
> moments in the life cycle of an object or method and that different
> groups can be validated, I don't feel that `@Nullable` would bring all
> the promises one would expect.
> 
> Thoughts?
> 
> Emmanuel
> _______________________________________________
> 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