> On Jul 27, 2018, at 1:09 AM, Florian Weimer <f...@deneb.enyo.de> wrote:
>
> * Paul Sandoz:
>
>> I created this issue:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8208362
>
> Thanks.
>
>> 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 @@
>> #if[byte]
>> cleaner = null;
>> #end[byte]
>> - 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
> webrev.
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.
Paul.