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.

Bug 18458 - WeakListener extended equals
Summary: WeakListener extended equals
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2001-12-07 15:03 UTC by _ pkuzel
Modified: 2008-12-22 20:47 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
The patch (1.92 KB, patch)
2001-12-07 15:04 UTC, _ pkuzel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2001-12-07 15:03:59 UTC
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.
Comment 1 _ pkuzel 2001-12-07 15:04:28 UTC
Created attachment 3736 [details]
The patch
Comment 2 Marek Grummich 2002-07-22 11:29:44 UTC
Set target milestone to TBD
Comment 3 Marek Grummich 2002-07-22 11:31:46 UTC
Set target milestone to TBD
Comment 4 _ pkuzel 2003-09-05 13:40:53 UTC
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.
Comment 5 Jaroslav Tulach 2004-07-27 13:12:50 UTC
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.
Comment 6 Marian Mirilovic 2005-12-20 16:05:06 UTC
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.