8245121: (bf) XBuffer.put(Xbuffer src) can give unexpected result when storage overlaps
Brian Burkhalter
brian.burkhalter at oracle.com
Thu May 28 23:56:13 UTC 2020
> On May 28, 2020, at 1:40 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
>> I took a stab at changing the test to use DataProviders and Asserts in this update.
>>
>
> That’s a good start, but I think the use of iterators in this case makes it more complicated than need be. Iterators are a pain to directly compose, its hard to see the cross product.
>
> A data provider can return Object[][], basically an array of test case arguments, if you are not concerned about the pre-allocation of the number of cases (which I think is so here). So you can use your favorite nested for loops, or nested streams and flatMap if you wish to do something lazily, to construct the test argument set.
An updated version is at
http://cr.openjdk.java.net/~bpb/8245121/webrev.03/.
This gets rid of the Iterators in favor of nested for loops. It’s about 90 lines shorter than the previous version. I might try nested streams and flatmap later for educational purposes.
> For the testPairs method you can separate out the arguments, no need for an array.
Fixed.
Thanks,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200528/ad0b7435/attachment.htm>
More information about the nio-dev
mailing list