8245121: (bf) XBuffer.put(Xbuffer src) can give unexpected result when storage overlaps
Paul Sandoz
paul.sandoz at oracle.com
Thu May 28 20:40:39 UTC 2020
> On May 28, 2020, at 12:45 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
>
> New version uploaded here [1]. This includes the doc change outlined in the CSR [2] and the changes mentioned below.
>
>> On May 26, 2020, at 2:27 PM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
>>
>>>> I would be inclined to drop the Bits.JNI_COPY_TO_ARRAY_THRESHOLD, since it never applies to direct buffers. I bet the swapping. Maybe can be determined with follow evaluation after this issue.
>>>
>>> You mean dropping the else branch and converting the else if branch to an else?
>>>
>>
>> Yes.
>
> Done in this update.
>
Ok.
>>
>> […]
>>
>>>> I still hold out hope you can convert it to a testng test, with data providers and asserts, this is all good common practice for writing tests. The nested loops in test() effectively capture the test combinations input for two test cases. Let me know if you need some advice/help on this.
>>>
>>> I’ll take another look.
>
> 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.
For the testPairs method you can separate out the arguments, no need for an array.
Paul.
> Thanks,
>
> Brian
>
> [1] http://cr.openjdk.java.net/~bpb/8245121/webrev.02/ <http://cr.openjdk.java.net/~bpb/8245121/webrev.02/>
> [2] https://bugs.openjdk.java.net/browse/JDK-8245866
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200528/6e9824fb/attachment.htm>
More information about the nio-dev
mailing list