EVALUATION
The deadlock during applet construction is caused by creation of the
JApplet on a thread which is not the Event Dispatch Thread.
Unfortunately for compatibility reasons the init(), start(), stop(),
and destroy() methods of applets are not called on the EDT. However,
it seems that construction of the Applet object can probably safely be
moved on to the EDT, since in the new Java Plug-In the code for
resizing the applet and placing it in its containing frame was
rewritten and moved on to the EDT for thread safety.
This fix is only being made for the new Java Plug-In because the old
Java Plug-In is very fragile in this area and we do not want to
introduce risk for customers relying on it for compatibility reasons.
An attempt was made to write a targeted test for this change, but this
attempt was unsuccessful; the original race condition is hard to
provoke. For this reason there is no explicit test case for this bug.
Tested with the Pogo.com applets, NeuroDNA's NeuroKernel, the JavaFX
samples, and other applets.
|