On Wed, 4 Mar 2026 02:50:52 GMT, Sergey Bylokhov <[email protected]> wrote:
>> I don't think it matters here. > > This method and its usage seem suspicious, how should a negative index i be > handled, is it allowed? > > Is the size actually "a size" of the array the buffer stored? It seems that > it is the number of items in the array: > Example: new DataBufferInt(new int[8], 5, 3) > How should the next be validated: i = 2, offset = 3, size = 5 ->> "(2+3) >= > 5" ->> BOOM? This code worked before: DataBufferInt buf = new DataBufferInt(new int[8], 5, 3); buf.setElem(2, 42); and failed after this patch: ` Invalid index (offset+i) is (3 + 2) which is too large for size : 5` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r2881535691
