RFR: 8159055: ImageIcon.setImage can't handle null parameter [v3]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Mon Jun 16 02:17:34 UTC 2025
On Sun, 15 Jun 2025 21:50:09 GMT, ExE Boss <duke at openjdk.org> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update image instance before returning
>
> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 371:
>
>> 369: * Sets the image displayed by this icon.
>> 370: * A null image is ignored.
>> 371: * @param image the image
>
> The `image` can be set to `null` to mean “no image”:
> Suggestion:
>
> * Sets the image displayed by this icon.
> * @param image the image, may be null
I dont think so..Till now, it was throwing NPE so it was not expected so it cannot be "may be null", which is we are telling the application to avoid..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25767#discussion_r2148934817
More information about the client-libs-dev
mailing list