On Thu, 5 Mar 2026 17:49:39 GMT, Phil Race <[email protected]> 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 183:
> 
>> 181:      */
>> 182:     public DataBufferByte(byte[][] dataArray, int size) {
>> 183:         super(UNTRACKABLE, TYPE_BYTE, size, dataArray.length);
> 
> I guess there was no point in the explicit check for dataArray == null 
> because the dataArray.length expression above implicitly does it. I see no 
> value in trying to do anything to have the explicit check first, so I've 
> removed all the explicit checks that follow an implicit check.

Well, if you want a custom message you can add it:


    public DataBufferByte(byte[][] dataArray, int size) {
        Objects.requireNonNull(dataArray, "dataArray must not be null");
        super(UNTRACKABLE, TYPE_BYTE, size, dataArray.length);


This is allowed since JDK 22.

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

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

Reply via email to