RFR: 8336755: Remove unused UNALIGNED field from Direct non-byte Buffers

Alan Bateman alanb at openjdk.org
Thu Jul 18 15:50:01 UTC 2024


On Thu, 18 Jul 2024 11:58:30 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> Actually it's used only by `DirectByteBuffer` and `DirectByteBufferR` classes.
> 
> List of affected classes:
> `DirectCharBufferS`, `DirectCharBufferU`,
> `DirectDoubleBufferS`, `DirectDoubleBufferU`,
> `DirectFloatBufferS`, `DirectFloatBufferU`,
> `DirectIntBufferS`, `DirectIntBufferU`,
> `DirectLongBufferS`, `DirectLongBufferU`,
> `DirectShortBufferS`, `DirectShortBufferU`
> 
> Tested `test/jdk/java/nio` on Linux x64 release.

src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template line 70:

> 68: #if[byte]
> 69:     // Cached unaligned-access capability
> 70:     protected static final boolean UNALIGNED = Bits.unaligned();

Can you drop the protected modifier and check that it builds?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20233#discussion_r1682738373


More information about the nio-dev mailing list