JDK-8289188 : SegmentAllocator:allocateArray(*) default behavior mismatch to spec
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Affected Version: 19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-06-26
  • Updated: 2022-07-27
  • Resolved: 2022-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19 JDK 20
19 b29Fixed 20Fixed
Related Reports
Cloners :  
Relates :  
Description
As per the spec of 
https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/SegmentAllocator.html#allocateArray(java.lang.foreign.ValueLayout.OfByte,byte...)

"Implementation Requirements:
the default implementation for this method calls this.allocateArray(layout, array.length)."

Expectations :

invoking SegmentAllocator:allocateArray(*) shall delegate a call to allocateArray(MemoryLayout elementLayout,  long count)

Actual :

The method allocateArray(MemoryLayout elementLayout,
 long count) not invoked

Comments
Changeset: 2c8ada68 Author: Maurizio Cimadamore <mcimadamore@openjdk.org> Date: 2022-06-27 15:37:08 +0000 URL: https://git.openjdk.org/jdk19/commit/2c8ada689f7bcfc39a04b0bf36c9aea156d47690
27-06-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk19/pull/74 Date: 2022-06-27 11:01:59 +0000
27-06-2022