2017-04-19 22:07 GMT+02:00 Michael Nascimento <misterm(a)gmail.com>:
On Wed, Apr 19, 2017 at 4:27 PM, Emmanuel Bernard
<emmanuel(a)hibernate.org>
wrote:
>
> But
> @Target(FIELD, TYPE_USE)
> @interface Size
>
> @Size(2) String[] arrayOfTwoStrings;
>
> is ambiguous in Java 8
>
> So the JLS is “backward compatible” in the language designer’s view I
> suppose.
When you don't change, it's backward compatible indeed. When you do, the
language design is flawed. So there is a hole in one combination that needs
to be addressed. Joshua Bloch would write about that all the time, of how
new features interact in unexpected ways and that's why you have to resist
changes in the language.
>
> They did not anticipate people wanting to add TYPE_USE to an existing
> annotation and have a side effect on its usage on arrays.
Exactly, so this is effectively broken and needs to be fixed in the
language, not in BV. But I'm still afraid we might have got something wrong
here, so I would rather ask them.
I've sent a mail to the compiler-dev mailing list (best place I could think of):
http://mail.openjdk.java.net/pipermail/compiler-dev/2017-April/010918.html
Let's see what answers we get. I don't think it will be fixed in the
language (how?), esp. given that the JLS is clearly aware of that
ambiguity.
Regards,
Michael
_______________________________________________
beanvalidation-dev mailing list
beanvalidation-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/beanvalidation-dev