On Wed, 11 Mar 2026 22:13:18 GMT, Phil Race <[email protected]> wrote:

>> Remove the explicit check for `offsets == null`, too?
>> 
>> It will be implicitly checked at `dataArray.length != offsets.length` on the 
>> next line of code.
>
> But then I'd lose the custom message, so I prefer to keep it.

This is confusing now. You said,

> 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.

So, implicit check is good enough for `dataArray`, but it's not good enough for 
the `offsets` array.

The custom message could be then more helpful and read `"offsets must not be 
null"` as I suggested.

Huh, you referred to the two-dimensional `dataArray` that's used in a call to 
super-constructor. You can add a custom message there too: since JDK 22, 
statements before call to `super()` are allowed.

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

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

Reply via email to