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 28271 - Badly registered WeakListener
Summary: Badly registered WeakListener
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: -S1S-
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 27563
  Show dependency tree
 
Reported: 2002-10-25 13:43 UTC by Tomas Pavek
Modified: 2003-06-06 10:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
allocation stacktrace of the listeners (15.47 KB, text/html)
2002-10-25 13:44 UTC, Tomas Pavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2002-10-25 13:43:31 UTC
[dev build 200210240100]
PatternChildren creates two WeakListener objects
(with new PatternChildren instance, lines 41 and
42) but does not specify their event source (sets
null) - so the WeakListeners cannot be
automatically removed (when
PatternChildren.Listener is freed). This causes
two more WeakListeners added permanently each time
a file is opened (see issue 27563). Allocation
stack trace attached.
Comment 1 Tomas Pavek 2002-10-25 13:44:09 UTC
Created attachment 7773 [details]
allocation stacktrace of the listeners
Comment 2 Tomas Pavek 2002-10-25 14:50:46 UTC
One more thing: the weak listeners are also used multiple times, i.e.
one WeakListener instance is added to multiple objects - as can be
seen in reassignMethodListener() and reassignFieldListener() of
PatternChildren. This is probably the root cause - when used multiple
times, WeakListener cannot be automatically removed because there's
not just one source to be removed from (as the aut-remove mechanism
expects).
Comment 3 Svata Dedic 2003-02-20 22:13:17 UTC
/cvs/beans/src/org/netbeans/modules/beans/PatternChildren.java,v  <--
 PatternChildren.java
new revision: 1.25; previous revision: 1.24
Comment 4 Jan Becicka 2003-02-27 12:31:53 UTC
Reporter, could you verify this bug? Thanks
Comment 5 Jan Becicka 2003-04-01 08:13:55 UTC
Tomas didn't response. I suppose he's 
satisfied.