This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[PATCH] Fix to EventQueue 6/7
- From: Fernando Nasser <fnasser at redhat dot com>
- To: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Mon, 19 Jan 2004 11:32:10 -0500
- Subject: [PATCH] Fix to EventQueue 6/7
- Organization: Red Hat , Inc. - Toronto
This fixes invokeAndWait if called after a modal dialog is up.
2004-01-19 Fernando Nasser <fnasser@redhat.com>
* java/awt/EventQueue.java (invokeAndWait): Use list-aware
isDispatchThread method to replace wrong test condition.
Index: java/awt/EventQueue.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/EventQueue.java,v
retrieving revision 1.15
diff -u -p -r1.15 EventQueue.java
--- java/awt/EventQueue.java 19 Jan 2004 14:51:54 -0000 1.15
+++ java/awt/EventQueue.java 19 Jan 2004 16:28:13 -0000
@@ -231,10 +231,11 @@ public class EventQueue
public static void invokeAndWait(Runnable runnable)
throws InterruptedException, InvocationTargetException
{
+ if (isDispatchThread ())
+ throw new Error("Can't call invokeAndWait from event dispatch thread");
+
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
Thread current = Thread.currentThread();
- if (current == eq.dispatchThread)
- throw new Error("Can't call invokeAndWait from event dispatch thread");
InvocationEvent ie =
new InvocationEvent(eq, runnable, current, true);