SUGGESTED FIX
--- a/src/windows/classes/sun/awt/windows/WInputMethod.java Tue Aug 26 16:31
:13 2008 +0400
+++ b/src/windows/classes/sun/awt/windows/WInputMethod.java Tue Aug 26 20:53
:28 2008 +0400
@@ -548,11 +548,15 @@ public class WInputMethod extends InputM
public void inquireCandidatePosition()
{
+ Component source = getClientComponent();
+ if (source == null) {
+ return;
+ }
// This call should return immediately just to cause
// InputMethodRequests.getTextLocation be called within
// AWT Event thread. Otherwise, a potential deadlock
// could happen.
- java.awt.EventQueue.invokeLater(new Runnable() {
+ Runnable r = new Runnable() {
public void run() {
int x = 0;
int y = 0;
@@ -573,7 +577,9 @@ public class WInputMethod extends InputM
openCandidateWindow(awtFocussedComponentPeer, x, y);
}
- });
+ };
+ WToolkit.postEvent(WToolkit.targetToAppContext(source),
+ new InvocationEvent(source, r));
}
// java.awt.Toolkit#getNativeContainer() is not available
|
EVALUATION
The reason for this behavior is that in some cases input events are posted to several AWT threads at once, and eventually all these threads call to Swing attempting to do re-layout at the same time. Swing is not thread-safe, so it messes up its internal structures which leads to spurious NPEs, deadlocks etc. preventing an applet from responding.
Re-assigning to the AWT team.
|