RFR: 8377568: DataBuffer constructors and methods do not specify required exceptions [v7]
Sergey Bylokhov
serb at openjdk.org
Mon Feb 23 23:01:38 UTC 2026
On Mon, 23 Feb 2026 22:30:16 GMT, Phil Race <prr at openjdk.org> wrote:
>> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 571:
>>
>>> 569: }
>>> 570:
>>> 571: static final void checkNullArray(Object array, String name) {
>>
>> Do we need this, or can it be replaced with Objects.requireNonNull? Alternatively, can we rely on implicit null checks when checking the size of the array? I think that would produce similar behavior to this method.
>
> This was already raised and my response is that I want the custom message and also don't want to rely on implicit null.
There is a requireNonNull version with custom message, why this new one is better than in Objects?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r2843503858
More information about the client-libs-dev
mailing list