JDK-5093922 : NotificationBroadcasterSupport should not use synchronized(this)
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-08-30
  • Updated: 2012-10-09
  • Resolved: 2004-09-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u1 01Fixed 6Fixed
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
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
26-09-2004

PUBLIC COMMENTS .
26-09-2004

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

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

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