United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 5093922 NotificationBroadcasterSupport should not use synchronized(this)
5093922 : NotificationBroadcasterSupport should not use synchronized(this)

Details
Type:
Bug
Submit Date:
2004-08-30
Status:
Resolved
Updated Date:
2012-10-09
Project Name:
JDK
Resolved Date:
2004-09-25
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0u1

Related Reports
Backport:

Sub Tasks

Description
NotificationBroadcasterSupport controls concurrent access to its internal list of listeners by using synchronized (this).  This is a bad idea since this class is intended to be subclassed.  If the subclass also does synchronized (this), or equivalently has synchronized methods, then unexpected deadlocks can arise.

                                    

Comments
PUBLIC COMMENTS

.
                                     
2004-09-26
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
1.5.0_01
mustang

FIXED IN:
1.5.0_01

INTEGRATED IN:
1.5.0_01


                                     
2004-09-26
SUGGESTED FIX

Synchronized on an internal object.
###@###.### 2004-08-30
                                     
2004-08-30
EVALUATION

This is clearly a bug.  The fix is simple.
###@###.### 2004-08-30
                                     
2004-08-30
WORK AROUND

Subclasses must synchronize on some object other than this.  They must not define synchronized methods.
###@###.### 2004-08-30
                                     
2004-08-30



Hardware and Software, Engineered to Work Together