[14] 8230665: (bf spec) ByteBuffer::alignmentOffset spec misleading when address is misaligned

Brian Burkhalter brian.burkhalter at oracle.com
Sat Jan 11 01:39:03 UTC 2020

The issue [1] arose because a negative internal address value caused a negative alignment offset value to be returned which is not supposed to happen. The alignment offset is supposed to be non-negative, with a value of zero denoting alignment, and a positive value indicating the amount of misalignment. The specification is rather unclear about the significance of the returned value. Also, the implementation does not work if the internal address is negative. This patch corrects both the specification and implementation. The CSR is at [2] and the proposed fix at [3].



[1] https://bugs.openjdk.java.net/browse/JDK-8230665
[2] https://bugs.openjdk.java.net/browse/JDK-8236826
[3] http://cr.openjdk.java.net/~bpb/8230665/webrev.00/

More information about the nio-dev mailing list