Java Cup
Inside Java

News and views from members of the Java team at Oracle

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

The OpenJDK Quality Group is promoting the testing of FOSS projects with OpenJDK builds as a way to improve the overall quality of the release. This heads-up is part of a regular communication sent to the projects involved. To learn more about the program, and how-to join, please check here.

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.

~