JDK-4756620 : PropertyChangeSupport creates new PropertyChangeEvent even if there is no listen
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.4.1
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2002-10-02
  • Updated: 2002-10-02
  • Resolved: 2002-10-02
Related Reports
Duplicate :  
Description
Constructing object that is never used should avoided especially if it is easy to check that it is not needed.

Wed Oct 02 07:51:10 MDT 2002	rk109395

Comments
SUGGESTED FIX Add a check that there is some listener before PropertyChangeEvent is constructed in PropertyChangeSupport.firePropertyChange(String, Object, Object) Wed Oct 02 07:51:10 MDT 2002 rk109395
11-06-2004

EVALUATION Actually, the real problem is that the firePropertChange(String, Object, Object) should call the firePropertyChange(PropertyChangeEvent). This doesn't reduce the creation of the PropertyChangeEvent object when there are no listeners but it does simplify the class and make it easier to maintain. This would also make it consistent with SwingPropertyChangeSupport. There is s project commited to Tiger to refactor the two PropertyChangeSupport mechanisms: 4682386. ###@###.### 2002-10-02
02-10-2002