United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6608764 : test/closed/java/awt/Focus/TemporaryLostComponentDeadlock fails

Details
Type:
Bug
Submit Date:
2007-09-25
Status:
Closed
Updated Date:
2011-05-17
Project Name:
JDK
Resolved Date:
2011-05-17
Component:
client-libs
OS:
generic
Sub-Component:
java.awt
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
The regression test

test/closed/java/awt/Focus/TemporaryLostComponentDeadlock/TemporaryLostComponentDeadlock.java

fails on all platforms.

                                    

Comments
EVALUATION

It's a regression of the fix 4811096 "Allow mixing of heavy and lightweight components",
integrated into JDK 7.0 b19.

The test in question is to test a deadlock and it... deadlocks. It creates a dialog,
shows it and then acquires a lock on the dialog and tries to dispose it (on a custom
thread). The disposal is performed (by AWT) on EDT. When it comes to Component.removeNotify()
method it tries to evaluate the following line:

removePropertyChangeListener("opaque", opaquePropertyChangeListener);

This is just what was added with the fix for 4811096.
The problem though, that this method is synchronized by "this". And the lock is not free
as the test holds it. The deadlock happens.
                                     
2007-09-25
EVALUATION

It seems that we have to add a private object that the PropertyChangeSupport methods will use for the locking purposes.
                                     
2007-09-27
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/awt_data/7/6608764/
                                     
2007-09-27



Hardware and Software, Engineered to Work Together