[bv-dev] Node#isInIterable() for arrays

Christian Kaltepoth christian at kaltepoth.de
Thu Jun 15 12:20:26 EDT 2017


Supporting arrays as well sounds reasonable to me. Unless there is any good
argument against it.

2017-06-15 13:16 GMT+02:00 Gunnar Morling <gunnar at hibernate.org>:

> Hi all,
>
> On our road to the Proposed Final Draft (more on that in a separate
> mail a bit), we've almost closed out all the relevant issues.
>
> One remaining issue is https://hibernate.atlassian.net/browse/BVAL-552
> which is about inconsistent behaviour of Node#isInIterable() when it
> comes to arrays. The spec says this:
>
>     "isInIterable() returns true if the node represents an object
> contained in an Iterable or in a Map, false otherwise."
>
> Whereas the TCK has a test case which expects true to be returned for
> arrays, too [1]. Naturally, that's how the RI (and any other
> TCK-compliant implementation) implements this.
>
> Now my question is, should we simply change the spec and say
>
>         "isInIterable() returns true if the node represents an object
> contained in an Iterable, Map or an array, false otherwise."
>
> Given that maps are considered already, the method has to be about
> "things that are iterable" and not java.lang.Iterable (which j.u.Map
> doesn't extend). So considering arrays there seems consistent.
>
> Or do you, Emmanuel, remember a reason for the current specification
> and it's actually a bug in the TCK?
>
> Thanks,
>
> --Gunnar
>
> [1] https://github.com/beanvalidation/beanvalidation-
> tck/blob/master/tests/src/main/java/org/hibernate/
> beanvalidation/tck/tests/validation/PropertyPathTest.java#L196
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
>



-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20170615/28b2be33/attachment.html 


More information about the beanvalidation-dev mailing list