RFR: 8368729: Add appropriate checks in java.awt.image.Kernel constructor

Sergey Bylokhov serb at openjdk.org
Wed Nov 5 23:53:06 UTC 2025


On Tue, 4 Nov 2025 09:35:32 GMT, Jayathirth D V <jdv at openjdk.org> wrote:

> `java.awt.image.Kernel` constructor doesn't validate all input values and we need to add appropriate checks.
> A new test is also added to make sure we appropriate exception when invalid values are passed.
> 
> This will also need a CSR.

src/java.desktop/share/classes/java/awt/image/Kernel.java line 62:

> 60:      * @param height        height of the kernel
> 61:      * @param data          kernel data in row major order
> 62:      * @throws IllegalArgumentException if {@code data} is null

Is there any particular reason why IllegalArgumentException was chosen instead of NullPointerException?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28127#discussion_r2496550441


More information about the client-libs-dev mailing list