RFR: 8346657: Improve out of bounds exception messages for MemorySegments [v8]
Chen Liang
liach at openjdk.org
Mon Nov 17 17:42:04 UTC 2025
On Sun, 16 Nov 2025 14:50:39 GMT, Igor Rudenko <duke at openjdk.org> wrote:
>> Logic for creating IndexOutOfBoundsException in MemorySegment is reworked:
>> - separate logic of checking bounds and constructing exception messages for both `access` and `slice` cases
>> - idea presented in [JDK-8288534](https://bugs.openjdk.org/browse/JDK-8288534) slightly reworked with preservation of the original approach
>
> Igor Rudenko has updated the pull request incrementally with one additional commit since the last revision:
>
> Adjust to TestMergeStoresMemorySegment.java requirements
I don't think the two private interfaces approach works - since there is only one `RuntimeException apply(String, List)` in AMSI, JLS mandates a compile error, and even if we compile, JVMS says any of these two methods can be chosen regardless of casting.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28124#issuecomment-3543103699
More information about the core-libs-dev
mailing list