Long chains created by direct Buffer::slice
fw at deneb.enyo.de
Fri Jul 27 08:09:24 UTC 2018
* 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, but I had not time yet to file a bug and create a
The parenthesis seem unnecessary. If this is an official JDK coding
style, it is not widely used.
More information about the core-libs-dev