Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-08-01 Thread Alexey Ivanov
On Fri, 1 Aug 2025 03:32:48 GMT, Prasanta Sadhukhan wrote: >> I looked through all of the new changes. Building & headful testing seems >> good. LGTM > > Thanks @DamonGuy ... Any 2nd Reviewer? @prsadhuk You could've waited for me to take another look. My contribution to reviewing this PR isn'

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-08-01 Thread Abhishek Kumar
On Thu, 31 Jul 2025 02:20:45 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-08-01 Thread Prasanta Sadhukhan
On Fri, 1 Aug 2025 07:48:50 GMT, Abhishek Kumar wrote: >> "show" sometimes might take more time so I guess different timeout is ok.. > > In that case, you may have a time out of 5 sec... No, it works well in CI so I dont think we need to change anything now.. - PR Review Comment: h

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-08-01 Thread Abhishek Kumar
On Fri, 1 Aug 2025 07:12:04 GMT, Prasanta Sadhukhan wrote: >> test/jdk/javax/swing/JPopupMenu/TestPopupInvoker.java line 106: >> >>> 104: pane.repaint(); >>> 105: }); >>> 106: if (!popupHidden.await(1, SECONDS)) { >> >> is it ok to have the same timeout

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-08-01 Thread Prasanta Sadhukhan
On Fri, 1 Aug 2025 06:22:23 GMT, Abhishek Kumar wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Rename listener class > > test/jdk/javax/swing/JPopupMenu/TestPopupInvoker.java line 53: > >> 51: >> 52: p

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-07-31 Thread Abhishek Kumar
On Thu, 31 Jul 2025 02:20:45 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-07-31 Thread Prasanta Sadhukhan
On Fri, 1 Aug 2025 01:03:26 GMT, Damon Nguyen wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Rename listener class > > I looked through all of the new changes. Building & headful testing seems > good. LGTM

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-07-31 Thread Damon Nguyen
On Thu, 31 Jul 2025 02:20:45 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v7]

2025-07-30 Thread Prasanta Sadhukhan
On Wed, 30 Jul 2025 13:02:18 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Serialization fix > > src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 934: > >> 932: } >> 9

Re: RFR: 4938801: The popup does not go when the component is removed [v8]

2025-07-30 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-30 Thread Alexey Ivanov
On Wed, 30 Jul 2025 12:59:37 GMT, Alexey Ivanov wrote: >> Yes, it seems deserialized JPopupMenu fails hiding the popup menu owing to >> `propListener` not getting serialized. >> >> Tried with modified testcase of yours and fixed in latest PR >> >> >> import java.awt.*; >> import java.awt.even

Re: RFR: 4938801: The popup does not go when the component is removed [v7]

2025-07-30 Thread Alexey Ivanov
On Wed, 30 Jul 2025 09:56:41 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-30 Thread Alexey Ivanov
On Wed, 30 Jul 2025 09:53:13 GMT, Prasanta Sadhukhan wrote: You can serialize a lambda expression if its target type and its captured arguments are serializable >> >> I think that means `propListener` is NOT going to serialize, because >> `PropertyChangeListener` isn't `Serializable

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-30 Thread Prasanta Sadhukhan
On Wed, 30 Jul 2025 05:32:25 GMT, Jeremy Wood wrote: >> Hmm..We need to take a look at how to handle serialization aspect of >> propListener >> >> but as per >> https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#serialization >> >> >>> You can serialize a lambda expre

Re: RFR: 4938801: The popup does not go when the component is removed [v7]

2025-07-30 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Jeremy Wood
On Wed, 30 Jul 2025 05:12:12 GMT, Prasanta Sadhukhan wrote: >> You can serialize a lambda expression if its target type and its captured >> arguments are serializable I think that means `propListener` is NOT going to serialize, because `PropertyChangeListener` isn't `Serializable`. I'm unfami

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Prasanta Sadhukhan
On Wed, 30 Jul 2025 04:41:41 GMT, Jeremy Wood wrote: >> It is transient so its value should not be included in the default >> serialization process in my opinion > > I'm fine with `propListener` being transient ... as long as when we call > readObject() we still initialize `propListener`. > >

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Jeremy Wood
On Wed, 30 Jul 2025 03:44:37 GMT, Prasanta Sadhukhan wrote: >> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 1427: >> >>> 1425: indexCounter++; >>> 1426: } >>> 1427: } >> >> This may be a naive question: is the lambda we use for `propListener` >> Seri

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Prasanta Sadhukhan
On Tue, 29 Jul 2025 22:36:09 GMT, Jeremy Wood wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use named property listener, update test > > src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 1427:

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Jeremy Wood
On Tue, 29 Jul 2025 11:56:49 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Jeremy Wood
On Tue, 29 Jul 2025 20:45:36 GMT, Alexey Ivanov wrote: > what would be the expected behaviour? I'm not sure. If I was maintaining code with this bad rebuilding pattern: I'd appreciate it if this PR's new listener was something I could toggle off or nullify. (For ex: if it was `protected` inst

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Alexey Ivanov
On Tue, 29 Jul 2025 11:56:49 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Jeremy Wood
On Tue, 29 Jul 2025 11:56:49 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Alexey Ivanov
On Tue, 29 Jul 2025 12:21:29 GMT, Prasanta Sadhukhan wrote: >> Yes, but we hide the popup only when `invoker` is changed to `null`. Should >> we hide the popup whenever `invoker` is changed to a different value? > > We hide the popup when `ancestor` is changed to `null` Yeah! You're right. --

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Prasanta Sadhukhan
On Tue, 29 Jul 2025 12:18:43 GMT, Alexey Ivanov wrote: >> Listener is added only when invoker is changed > > Yes, but we hide the popup only when `invoker` is changed to `null`. Should > we hide the popup whenever `invoker` is changed to a different value? We hide the popup when `ancestor` is c

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Prasanta Sadhukhan
On Tue, 29 Jul 2025 12:01:37 GMT, Alexey Ivanov wrote: > May I be recorded as a contributor / co-author for the test? Added > src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 136: > >> 134: && isVisible()) { >> 135: setVisible(false); >> 1

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Alexey Ivanov
On Tue, 29 Jul 2025 12:16:22 GMT, Prasanta Sadhukhan wrote: >> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 136: >> >>> 134: && isVisible()) { >>> 135: setVisible(false); >>> 136: } >> >> Should we hide the popup if inv

Re: RFR: 4938801: The popup does not go when the component is removed [v5]

2025-07-29 Thread Alexey Ivanov
On Tue, 29 Jul 2025 11:53:05 GMT, Prasanta Sadhukhan wrote: >> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 1383: >> >>> 1381: values.addElement("propListener"); >>> 1382: values.addElement(propListener); >>> 1383: } >> >> Do we need to serial

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Alexey Ivanov
On Tue, 29 Jul 2025 11:56:49 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed [v6]

2025-07-29 Thread Alexey Ivanov
On Tue, 29 Jul 2025 11:56:49 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v5]

2025-07-29 Thread Prasanta Sadhukhan
On Fri, 25 Jul 2025 16:37:54 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use setVisible(false) instead of dispose, update test > > src/java.desktop/share/classes/javax/swing/JPopupMenu.

Re: RFR: 4938801: The popup does not go when the component is removed. [v6]

2025-07-29 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed. [v5]

2025-07-28 Thread Alexey Ivanov
On Fri, 25 Jul 2025 07:31:42 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v5]

2025-07-28 Thread Alexey Ivanov
On Fri, 25 Jul 2025 07:31:42 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v5]

2025-07-28 Thread Alexey Ivanov
On Fri, 25 Jul 2025 07:31:42 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v5]

2025-07-25 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-25 Thread Prasanta Sadhukhan
On Fri, 25 Jul 2025 05:41:22 GMT, Prasanta Sadhukhan wrote: >> Hmm..that is strange..it used to work I am sure..let me check.. > > probably we should use hide() instead to allow it to dispose() the resources.. ok setVisible(false) inturn will call hide - PR Review Comment: https:/

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-24 Thread Prasanta Sadhukhan
On Fri, 25 Jul 2025 05:15:50 GMT, Prasanta Sadhukhan wrote: >> All you have to do is call `setVisible(false)` (possibly ensuring that >> `isVisible()` returns `true` first). >> >> This will hide the popup menu and fire the relevant events which aren't sent >> now… and popup remains on the scr

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-24 Thread Prasanta Sadhukhan
On Thu, 24 Jul 2025 19:17:05 GMT, Alexey Ivanov wrote: >> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 961: >> >>> 959: popup.dispose(); >>> 960: popup = null; >>> 961: } >> >> This do

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-24 Thread Alexey Ivanov
On Thu, 24 Jul 2025 18:51:41 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> typo > > src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 961: > >> 959:

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-24 Thread Alexey Ivanov
On Thu, 24 Jul 2025 02:34:44 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-24 Thread Alexey Ivanov
On Thu, 24 Jul 2025 02:34:44 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-24 Thread Abhishek Kumar
On Thu, 24 Jul 2025 16:08:56 GMT, Abhishek Kumar wrote: > > > Test is failing for me on macOS with error: Execution failed: `main' > > > threw exception: java.lang.RuntimeException: poup is visible after > > > component is removed > > > > > > I have tested and the test is passing in CI both i

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-24 Thread Abhishek Kumar
On Wed, 23 Jul 2025 03:07:39 GMT, Prasanta Sadhukhan wrote: > > Test is failing for me on macOS with error: Execution failed: `main' threw > > exception: java.lang.RuntimeException: poup is visible after component is > > removed > > I have tested and the test is passing in CI both in individu

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-23 Thread Prasanta Sadhukhan
On Wed, 23 Jul 2025 21:07:21 GMT, Damon Nguyen wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Test update > > src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 1430: > >> 1428: ind

Re: RFR: 4938801: The popup does not go when the component is removed. [v4]

2025-07-23 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-23 Thread Damon Nguyen
On Tue, 22 Jul 2025 08:28:51 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-23 Thread Prasanta Sadhukhan
On Tue, 22 Jul 2025 21:42:08 GMT, Alisen Chung wrote: > Test is failing for me on macOS with error: Execution failed: `main' threw > exception: java.lang.RuntimeException: poup is visible after component is > removed I have tested and the test is passing in CI both in individual run in all 4

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-22 Thread Alisen Chung
On Tue, 22 Jul 2025 08:28:51 GMT, Prasanta Sadhukhan wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a stand

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-22 Thread Prasanta Sadhukhan
On Mon, 21 Jul 2025 17:02:38 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Test update > > src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 962: > >> 960: ui.u

Re: RFR: 4938801: The popup does not go when the component is removed. [v3]

2025-07-22 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed. [v2]

2025-07-21 Thread Prasanta Sadhukhan
On Mon, 21 Jul 2025 17:17:55 GMT, Alexey Ivanov wrote: >> src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 947: >> >>> 945: public void propertyChange(PropertyChangeEvent e) { >>> 946: String propertyName = e.getPropertyName(); >>> 947:

Re: RFR: 4938801: The popup does not go when the component is removed. [v2]

2025-07-21 Thread Prasanta Sadhukhan
> Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalone entity after creation. > Fix is made to make sure popup liste

Re: RFR: 4938801: The popup does not go when the component is removed.

2025-07-21 Thread Alexey Ivanov
On Mon, 21 Jul 2025 16:35:57 GMT, Damon Nguyen wrote: >> Issue is seen that a popup doesn't get closed when the component that >> invokes it, gets removed from the parent container. >> This is because the JPopupMenu does not listen to its invoker liefecycle >> thereby behaving as a standalone e

Re: RFR: 4938801: The popup does not go when the component is removed.

2025-07-21 Thread Alexey Ivanov
On Mon, 21 Jul 2025 02:16:27 GMT, Prasanta Sadhukhan wrote: > Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalon

Re: RFR: 4938801: The popup does not go when the component is removed.

2025-07-21 Thread Damon Nguyen
On Mon, 21 Jul 2025 02:16:27 GMT, Prasanta Sadhukhan wrote: > Issue is seen that a popup doesn't get closed when the component that invokes > it, gets removed from the parent container. > This is because the JPopupMenu does not listen to its invoker liefecycle > thereby behaving as a standalon

RFR: 4938801: The popup does not go when the component is removed.

2025-07-20 Thread Prasanta Sadhukhan
Issue is seen that a popup doesn't get closed when the component that invokes it, gets removed from the parent container. This is because the JPopupMenu does not listen to its invoker liefecycle thereby behaving as a standalone entity after creation. Fix is made to make sure popup listens to its