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

Andrey Turbanov aturbanov at openjdk.org
Thu Jul 18 15:50:01 UTC 2024


On Thu, 18 Jul 2024 12:18:14 GMT, Alan Bateman <alanb 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?

Yes, it builds when I drop modifier.

    // Cached unaligned-access capability
    static final boolean UNALIGNED = Bits.unaligned();

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

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


More information about the nio-dev mailing list