On Tue, 12 Dec 2023 14:01:49 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert change in allocateNoInit > > src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java > line 595: > >> 593: long elementCount) { >> 594: >> 595: Utils.checkNonNegativeIndex(srcOffset, "srcOffset"); > > These new checks don't change the behavior, right? E.g. they will end up > issuing an IIOBE, as before? So, why the changes? (note that these change > might lead to double checks) It seems like this is about generating better exception (while leaving the exception type unchanged). If so, I support the change, as I agree that this patch does improve some of the messages. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17079#discussion_r1424048808