On Fri, 13 Jun 2025 03:46:05 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
>> 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 Yes, but only after the `this.image` field is set to `null`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25767#discussion_r2144623394