RFR: 8159055: ImageIcon.setImage and ImageIcon(Image) constructor can't handle null parameter [v9]

Alexey Ivanov aivanov at openjdk.org
Thu Jun 19 17:50:30 UTC 2025


On Thu, 19 Jun 2025 17:00:09 GMT, Phil Race <prr at openjdk.org> wrote:

> And consistency seems the best choice.

Then our best choice is not to touch `ImageIcon(Image)` and leave it to throw `NullPointerException`.

All the constructors except for `ImageIcon((String) null)` throw `NullPointerException` if the first argument is `null`.

Strangely enough, `ImageIcon((String) null)` creates a non-`null` image.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25767#discussion_r2157454838


More information about the client-libs-dev mailing list