On Mon, 16 Mar 2026 06:36:47 GMT, Jayathirth D V <[email protected]> wrote:

>> 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.
>
> I see we have `"offsets must not be null"` message in other constructors like 
> DataBufferDouble class : 
> https://github.com/openjdk/jdk/pull/29766/changes#diff-04543d1d9a796a3ba88b6fe9db5d132fac5c049d20e942c8431706811dbfa5cbR220
>  .
> 
> This should be uniform among all classes.

fixed

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

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

Reply via email to