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

Alan Bateman Alan.Bateman at oracle.com
Sat Jan 11 08:10:13 UTC 2020

On 11/01/2020 01:39, Brian Burkhalter wrote:
> 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].
The spec/impl looks good. The tests for alignmentOffset are in 
open/test/java/nio/ByteBuffer so better to keep them in one place if 


More information about the nio-dev mailing list