United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4682386 : SwingPropertyChangeSupport and PropertyChangeSupport refactor project

Details
Type:
Enhancement
Submit Date:
2002-05-09
Status:
Resolved
Updated Date:
2003-07-11
Project Name:
JDK
Resolved Date:
2003-07-11
Component:
client-libs
OS:
linux,windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0,1.4.1
Fixed Versions:
5.0 (tiger)

Related Reports
Duplicate:
Relates:

Sub Tasks

Description

Name: gm110360			Date: 05/09/2002


FULL PRODUCT VERSION :
All 1.3.x and 1.4

FULL OPERATING SYSTEM VERSION :

ALL PLATFORMS

A DESCRIPTION OF THE PROBLEM :
javax.swing.event.SwingPropertyChangeSupport shall NOT
extend java.beans.PropertyChangeSupport. Not a single
method or field of PCS is acually used.

1) It's a useless waste of memory (12 bytes per
object). //Btw, SPCS JavaDocs are claim that Swing
cares about memory usage.

2) The "extends"  is just plainly wrong here by OO
concepts. No extension of any functionality takes place.
It's just a completely different utility class.

This bug can be reproduced always.
(Review ID: 145847) 
======================================================================

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b11


                                     
2004-06-14
EVALUATION

The only real difference between the PropertyChangeSupport and SwingPropertyChangeSupport is that that the SPCS uses an EventListenerList while the PCS uses a Vector to hold the listeners. At first glance, I can't see the advantages of using the EventListener list since the all the listeners are PropertyChangeListeners.

Perhaps this these two classes should be refactored and consolidated. See 4528354 for other consolidation in PCS.

----

I've completed most of the design for this project. It seems feasable to implement this and get the same functionality yet gain a maintenace win and potentialy better performance in both PropertyChangeSuport and SwingPropertyChangeSupport. 

The reconciliation between the EventListenerList and the Vector can be achieved by using an ArrayList and syncronizing it when the PropertyChangeSupport constructor is called.

The changes should be transparent to classes which use the PropertyChange notification mechanism.
###@###.### 2003-03-26
                                     
2003-03-26



Hardware and Software, Engineered to Work Together