[bv-dev] Making built-in constraints repeatable

Gunnar Morling gunnar at hibernate.org
Tue Aug 30 08:34:03 EDT 2016


Hi all,

One of the things making life easier in Java 8 is repeatable annotations
[1], for instance allowing to specify several @Pattern constraints, without
the explicit usage of @Pattern.List.

The transition is very smooth for BV built-in constraints, essentially we
just need to mark them with @Repeatable, using the existing inner @List
annotations as containers. Hence I didn't bother to create a separate
proposal document but instead Guillaume and me have prepared changes for
the API and the spec already. You can find the GitHub pull requests at [2]
and [3], respectively.

Speaking of changes to the API sources, we also increased the Java version
to 8, bumped the project version to 2.0.0-SNAPSHOT and we've prepared a
change for BVAL-486 [4] which is about not going through the provider
resolver if a specific provider type is passed into bootstrapping via
Validation#byProvider(). This was a tad inconvenient when e.g. explicitly
bootstrapping the RI under OSGi, where you still had to provide a specific
provider resolver.

Please let me know if you have any concerns or other remarks on any of
these by the end of the week. Silence will be taken as expression of
agreement :)

Cheers,

--Gunnar

[1] https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html
[2] https://github.com/beanvalidation/beanvalidation-api/pull/65
[3] https://github.com/beanvalidation/beanvalidation-spec/pull/111
[4] https://github.com/beanvalidation/beanvalidation-api/pull/66
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20160830/5deb789c/attachment.html 


More information about the beanvalidation-dev mailing list