Java Cup
Inside Java

News and views from members of the Java team at Oracle

Java Array Element Alignment: Weakening of Some Methods Guarantees ? - Quality Outreach Heads-up

The OpenJDK Quality Group promotes the testing of FOSS projects with OpenJDK early-access builds as a way to improve the overall quality of the release. This heads-up is part of a Quality Outreach update sent to the projects involved. To learn more about the program and how to join, please check the Quality Outreach wiki page.

Java Array Element Alignment: Weakening of Some Methods Guarantees ?

Some methods make promises about Java array element alignment that are too strong. There are some ongoing reflexions to change the implementation (and the specification) of MethodHandles::byteArrayViewVarHandle, MethodHandles::byteBufferViewVarHandle, ByteBuffer::alignedSlice, and ByteBuffer::alignmentOffset to weaken the guarantees they make about the alignment of Java array elements, in order to bring them in line with the guarantees made by an arbitrary JVM implementation.

For more details, make sure to check JDK-8320247 and the related pull request but in a nutshell, the new behaviour would be :

If you have relevant feedback about this potential change, please make sure to bring it to the core-libs-dev mailing list, or leave a comment on the pull request.

~