RFR: 8159055: ImageIcon.setImage can't handle null parameter [v19]

Alexey Ivanov aivanov at openjdk.org
Mon Jul 28 20:05:03 UTC 2025


On Sun, 27 Jul 2025 06:57:53 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 66:
>> 
>>> 64:  * If the image source parameter to a constructor or method is non-null,
>>> 65:  * but does not reference valid accessible image data,
>>> 66:  * no exceptions will be thrown but the image will be 'effectively' null,
>> 
>> Joe asked for if there's an alternative to 'effectively' null. I'm open to suggestions. "unset" ?
>
> "unset" sounded better..modified..

_“unset”_ is also not ideal, it's not clear what it means, especially for constructors where the image isn't set yet.

If I get it right, it refers to the fact that the image in `ImageIcon` instance is non-null, but nothing gets rendered because there's no valid image.

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

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


More information about the client-libs-dev mailing list