RFR: 8377568: DataBuffer constructors and methods do not specify required exceptions [v4]

Phil Race prr at openjdk.org
Wed Feb 18 05:42:09 UTC 2026


On Wed, 18 Feb 2026 05:07:55 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8377568
>
> src/java.desktop/share/classes/java/awt/image/DataBufferByte.java line 167:
> 
>> 165:         }
>> 166:         if (size < 0 || (size + offset) > dataArray.length) {
>> 167:             throw new IllegalArgumentException("Bad size/offset. Size = " + size +
> 
> how it is supposed to work if the size is zero and the dataArray is empty? is it a valid config?

Do you mean the equivalent of new DataBufferByte(0) ?
You get  a valid DataBuffer but there isn't a normal use for it.,

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

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


More information about the client-libs-dev mailing list