Long chains created by direct Buffer::slice
paul.sandoz at oracle.com
Fri Jul 27 19:35:56 UTC 2018
> On Jul 27, 2018, at 1:09 AM, Florian Weimer <fw at deneb.enyo.de> wrote:
> * Paul Sandoz:
>> I created this issue:
>> The suggested fix requires a tweak though since an instance of a
>> DirectBuffer interface is passed. This is required because views
>> over direct ByteBuffers can be created.
> Noticed that as well.
>> diff -r 448cd909c9e2 src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
>> --- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template Thu Jul 26 11:53:59 2018 -0700
>> +++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template Thu Jul 26 16:46:20 2018 -0700
>> @@ -194,7 +194,8 @@
>> cleaner = null;
>> - att = db;
>> + Object attachment = db.attachment();
>> + att = (attachment == null ? db : attachment);
> This is essentially what I put through jtreg (jdk_core), without any
> obvious issues,
Thanks for testing.
> but I had not time yet to file a bug and create a
Ah, my apologies, i did not realize you had author status.
> The parenthesis seem unnecessary. If this is an official JDK coding
> style, it is not widely used.
It is unusual but I chose to keep consistent with the style in the source.
More information about the core-libs-dev