-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly register weak property change listener on InputOutput #7430
Correctly register weak property change listener on InputOutput #7430
Conversation
Label only added to shutup CI complaint. |
Isn't this because the pcs and vcs in |
The source of the events is indeed the I though about directly implementing the registration logic (essentially copying the |
Which is the problem IMO. ie. the pcs() method construction code at https://github.com/apache/netbeans/blob/master/ide/terminal.nb/src/org/netbeans/modules/terminal/ioprovider/TerminalInputOutput.java#L151 should be passing in the instance of |
I think it is even more ugly as I though. I'll have to revisit this later. |
This warning was observed: WARNING [org.openide.util.WeakListenerImpl]: Can't remove java.beans.PropertyChangeListener using method org.netbeans.modules.terminal.ioprovider.TerminalInputOutput.removePropertyChangeListener from org.netbeans.modules.terminal.ioprovider.TerminalInputOutput@10efb8c9 WARNING [org.openide.util.WeakListenerImpl]: Can't remove java.beans.PropertyChangeListener using method org.netbeans.modules.terminal.ioprovider.TerminalInputOutput.removePropertyChangeListener from org.netbeans.modules.terminal.ioprovider.TerminalInputOutput@3a72784a This was one of the candidates for the source of the problem. A custom implementation of WeakReference was used as the Implementation from org.openide.util.WeakListeners makes the assumption that the source of the property change is the place where the property change listener can be/has to be disconnected from. The architecture of the IONotifer though is different in that the registering logic is defined on IONotifer, but the source of the PropertyChange is the InputOutput.
ca111d2
to
1c0095b
Compare
@neilcsmith-net I reworked this to not require API changes. I decided against changing the source of the events or the way of the intregration, so that the change does not affect behavior outside the target handler. For that handler I implemented a WeakListener myself, which is not as universal as the one from the openide package, but is tailored to the situation. |
I intent to merge this early next week. If anyone wants to object, please do so now. |
As I was reminded, that we are already freezing, lets get this in now. |
This warning was observed:
This was one of the candidates for the source of the problem.