On Thu, 12 Mar 2026 22:11:31 GMT, Alexey Ivanov <[email protected]> wrote:
>> 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. 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r2938434332
