RFR: 8376169: JPopupMenu.setInvoker(null) causes NPE [v3]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Jan 29 05:09:20 UTC 2026
On Thu, 29 Jan 2026 03:26:42 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 970:
>>
>>> 968: invalidate();
>>> 969:
>>> 970: }
>>
>> Does this newly added blank line right before the closing brace of the method serve any purpose? I'd rather not add it.
>
> What happens if the new invoker is null, the old invoker is not null and the UI is null? Will we continue to receive events from the old invoker? Or this combination is not possible?
It will not remove the old invoker listener nor it will add new invoker listener..it probably will receive events but I dont think the events will be acted upon because as per the code, It will just invalidate the container
and the outcome is same as it was before [JDK-4938801](https://bugs.openjdk.org/browse/JDK-4938801) fix..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29377#discussion_r2739966839
More information about the client-libs-dev
mailing list