-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 22, 23, 24
-
Component/s: core-libs
-
None
The out of bounds exception messages for MemorySegments can be improved. Rather than:
Exception java.lang.IndexOutOfBoundsException: Out of bound access on segment MemorySegment{ heapBase: [B@4ccabbaa, address: 0x0, byteSize: 2 }; new offset = 2; new length = 1
we could use:
Exception java.lang.IndexOutOfBoundsException: Out of bound access on segment MemorySegment{ heapBase: [B@4ccabbaa, address: 0x0, byteSize: 2 }; attempting to access an element of length 1 at offset 2 which is outside the valid range 0 <= offset+length < byteSize (=2)
Exception java.lang.IndexOutOfBoundsException: Out of bound access on segment MemorySegment{ heapBase: [B@4ccabbaa, address: 0x0, byteSize: 2 }; new offset = 2; new length = 1
we could use:
Exception java.lang.IndexOutOfBoundsException: Out of bound access on segment MemorySegment{ heapBase: [B@4ccabbaa, address: 0x0, byteSize: 2 }; attempting to access an element of length 1 at offset 2 which is outside the valid range 0 <= offset+length < byteSize (=2)
- links to
-
Review(master)
openjdk/jdk/28124