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 28270

Summary: Badly registered WeakListener
Product: platform Reporter: Tomas Pavek <tpavek>
Component: Module SystemAssignee: Jan Pokorsky <jpokorsky>
Status: VERIFIED FIXED    
Severity: blocker CC: jglick
Priority: P3 Keywords: PERFORMANCE
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 27563    
Attachments: allocation backtrace of the WeakListener
the right stacktrace

Description Tomas Pavek 2002-10-25 13:29:44 UTC
[dev build 200210240100]
SerialDataConvertor.isModuleEnabled creates
WeakListener with reference to ModuleInfo object
(as source), but
ModuleInfoManager.registerPropertyChangeListener
adds the listener to something else
(ModuleInfoManager.PCL).
As result, the WeakListener cannot be
automatically removed when the listener is freed.
This causes one more WeakListener added
permanently each time a file is opened (issue
27563). Allocation stack trace attached.
Comment 1 Tomas Pavek 2002-10-25 13:34:31 UTC
Created attachment 7772 [details]
allocation backtrace of the WeakListener
Comment 2 Tomas Pavek 2002-10-25 13:48:00 UTC
Sorry, bad stacktrace attached, correcting...
Comment 3 Tomas Pavek 2002-10-25 13:48:41 UTC
Created attachment 7774 [details]
the right stacktrace
Comment 4 Jesse Glick 2002-10-25 14:48:26 UTC
Jan's code. I suspect MIM.PCL.addPCL should be changed from

    changeSupport = new PropertyChangeSupport(this);

to

    changeSupport = new PropertyChangeSupport(MIM.this);

But I think that would not work either because the MIM public methods
are not named according to the conventional names.
Comment 5 Jan Pokorsky 2002-10-30 18:02:09 UTC
You are right. It would not work. I am going to look at it.
Comment 6 Jan Pokorsky 2002-10-30 23:30:27 UTC
Fixed together with issue #16009. A proper source object is passed to
WeakListener.
Comment 7 Marian Mirilovic 2005-07-13 13:20:26 UTC
closed