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 15495

Summary: Performance: get property listener count for nodes
Product: platform Reporter: Torbjorn Norbye <tor>
Component: NodesAssignee: Petr Hrebejk <phrebejk>
Status: CLOSED FIXED    
Severity: blocker    
Priority: P2    
Version: 3.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description Torbjorn Norbye 2001-09-14 00:19:00 UTC
Performance: apis don't allow me to get at listener count
to turn off computation for unused node info. 

My properties window shows LOTS of information which is
costly to compute, so since it's not always shown, it's
a performance bug in my application that I can't do this
on-demand. So while this represents a change in an API and
not a bug per se, it's a performance bug that you can't
effectively do pull vs. push.

See the following nbdev e-mail for motivation (and the
thread for background info if needed).

Date: Mon, 3 Sep 2001 11:38:41 -0700 (PDT)
From: Tor Norbye <tor@ha2mpk-mail.eng.sun.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: Re: [nbdev] Push vs pull


 | > How do I know if my node properties are displayed anywhere???
 | 
 | Not sure if it really works, but if your Node does not have any
 | PropertyChangeListener attached, than its properties should not be
 | visible....

>From class Node:
 public final void addPropertyChangeListener (PropertyChangeListener l)
       ^^^^^^^
 So I can't write my own addPropertyChangeListener which does
   numListeners++;
   super.addPropertyChangeListener(l);

Any chance this method can be unfinaled or do you have another
suggestion for how I can determine if there are any listeners?

(If you want to keep the method final for performance reasons,
perhaps you could add the counter to your own addPropertyChangeListener
and removePropertyChangeListeners, and then provide a hasListeners()
or numListeners() method.

-- Tor
Comment 1 Petr Hrebejk 2001-09-24 15:06:03 UTC
Just reasigning to me.
Comment 2 Petr Hrebejk 2001-10-08 15:39:29 UTC
Required method was added into the org.openide.nodes.Node class. Changes
were made so that calling this method hould give raonable results.
Comment 3 Quality Engineering 2003-07-01 16:02:53 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 4 Quality Engineering 2003-07-01 16:22:44 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.