On Tue, 28 Apr 2026 22:36:21 GMT, Sergey Bylokhov <[email protected]> wrote:

>> No, I think that is wrong. We changed that condition before. it should 
>> validate that the index is between 0 and size, or index+offset and 
>> size+offset. It should not mix one with another  "(offset + i) >= size". If 
>> the test did not catch this some should be updated.
>
> or maybe we have so many changes that the meaning of "size" is changed now

I don't think we've changed the meaning of size. 
Before this PR was begun we had

   /**
     * Constructs a byte-based {@code DataBuffer} with a single bank using the
     * specified array, size, and offset.  {@code dataArray} must have at least
     * {@code offset} + {@code size} elements.
...
*/
  public DataBufferByte(byte[] dataArray, int size, int offset){

and
   public int getElem(int i) {
        return (int)(data[i+offset]) & 0xff;
    }   
        
The constructor docs still say the same now and the getElem() call still uses 
[i+offset]

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3157821427

Reply via email to