-
Enhancement
-
Resolution: Fixed
-
P3
-
14
-
b32
-
b35
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8238519 | 15 | Brian Burkhalter | P3 | Resolved | Fixed | b09 |
JDK-8238482 | 14.0.2 | Brian Burkhalter | P3 | Resolved | Fixed | b01 |
JDK-8238490 | 14.0.1 | Brian Burkhalter | P3 | Resolved | Fixed | b03 |
https://download.java.net/java/early_access/jdk14/docs/api/java.base/java/nio/ByteBuffer.html#alignmentOffset(int,int)
"Specifically, the index should either be decremented by the return value, or incremented by the unit size minus the return value. Therefore given
int value = alignmentOffset(index, unitSize)
then the identities
alignmentOffset(index - value, unitSize) == 0
and
alignmentOffset(index + (unitSize - value), unitSize) == 0
must hold."
I see it' s a normative spec.
But the mentioned statement is not valid for some values of index and unitSize.
Please see the attached code snippet.
It will pass some times and throws IllegalArgumentException sometimes.
Can you please clarify this.
- backported by
-
JDK-8238482 Spec Clarification - ByteBuffer::alignmentOffset Spec
-
- Resolved
-
-
JDK-8238490 Spec Clarification - ByteBuffer::alignmentOffset Spec
-
- Resolved
-
-
JDK-8238519 Spec Clarification - ByteBuffer::alignmentOffset Spec
-
- Resolved
-
- csr for
-
JDK-8238368 Spec Clarification - ByteBuffer::alignmentOffset Spec
-
- Closed
-
- relates to
-
JDK-8230665 (bf spec) ByteBuffer::alignmentOffset spec misleading when address is misaligned
-
- Resolved
-
-
JDK-8236826 (bf spec) ByteBuffer::alignmentOffset spec misleading when address is misaligned
-
- Closed
-
- links to
-
Commit openjdk/panama-foreign/7db8a176