<Swing Dev> RFR: 5015261: JInternalFrame causes NPE [v2]

Sergey Bylokhov serb at openjdk.java.net
Thu Aug 12 22:34:24 UTC 2021


On Thu, 12 Aug 2021 04:09:18 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/JInternalFrame.java line 1308:
>> 
>>> 1306:      * Sets the <code>JDesktopIcon</code> associated with this
>>> 1307:      * <code>JInternalFrame</code>.
>>> 1308:      * Setting <code>null</code> icon is unsupported and may throw NPE if used.
>> 
>> The field itself is protected and can be changed by the user.
>
> I guess that is why we are putting up this statement, no so that user thinks twice before making it null? Should we make the field private?

We cannot make it private, we can only update the spec there as well.

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

PR: https://git.openjdk.java.net/jdk/pull/4989


More information about the swing-dev mailing list