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

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Jun 13 03:48:35 UTC 2025


On Thu, 12 Jun 2025 17:56:50 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   javadoc
>
> src/java.desktop/share/classes/javax/swing/ImageIcon.java line 374:
> 
>> 372:      */
>> 373:     public void setImage(Image image) {
>> 374:         if (image == null) {
> 
> don't we need to update the actual image icon of imageicon to null? similar to how constructor/and other methods works when they get "null-image"?

In constructor also, it returns

https://github.com/openjdk/jdk/blob/991097b7bf08cc1a4ceedb0c555b12948ae71885/src/java.desktop/share/classes/javax/swing/ImageIcon.java#L146-L148
https://github.com/openjdk/jdk/blob/991097b7bf08cc1a4ceedb0c555b12948ae71885/src/java.desktop/share/classes/javax/swing/ImageIcon.java#L185-L187

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

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


More information about the client-libs-dev mailing list