This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
As a WeakListener instance stays for a listener I suggest to extend its equals() method to return true also for same peer listeners. It would eliminale adding same listener multiple times. Patch contains a code for weak PropertyChangeListener.
Created attachment 3736 [details] The patch
Set target milestone to TBD
The original problem is how to explicitly unregister weaklisteners. One had to remember instance of dynamically created weak listener (often being itself a weaklistener wrapped listener). This enhancement eliminates need for remembering the dynamically created weak listener. Equal one can be created from listener (itself). I admit that unregistering weaklistener is not typical use case, however there can be some performance reasons to do so.
Any implementation like this would have performance implications: either bigger memory consumption or wrongly implemented hashCode. Better to be careful and use weak listeners in the right way.
This issue was solved long time ago. Because nobody has reopened it neither added comments, we are verifying/closing it now. If you are still able to reproduce the problem, please reopen. Thanks in advance.