[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: AWTRobot fixlet

Kaffe CVS cvs-commits at kaffe.org
Wed Feb 23 13:07:12 PST 2005


PatchSet 5597 
Date: 2005/02/23 21:02:30
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: AWTRobot fixlet

2005-02-23  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2005-02-22  Thomas Fitzsimmons  <fitzsim at redhat.com>

        * java/awt/Robot.java (waitForIdle): Call invokeAndWait on an
        empty Runnable.

Members: 
	ChangeLog:1.3642->1.3643 
	libraries/javalib/java/awt/Robot.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3642 kaffe/ChangeLog:1.3643
--- kaffe/ChangeLog:1.3642	Wed Feb 23 20:41:48 2005
+++ kaffe/ChangeLog	Wed Feb 23 21:02:30 2005
@@ -2,6 +2,15 @@
 
 	Resynced with GNU Classpath.
 
+	2005-02-22  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * java/awt/Robot.java (waitForIdle): Call invokeAndWait on an
+        empty Runnable.
+
+2005-02-23  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
 	2005-02-21  Bryce McKinlay  <mckinlay at redhat.com>
 
         * java/io/ObjectInputStream.java (readClassDescriptor): Cache result
Index: kaffe/libraries/javalib/java/awt/Robot.java
diff -u kaffe/libraries/javalib/java/awt/Robot.java:1.3 kaffe/libraries/javalib/java/awt/Robot.java:1.4
--- kaffe/libraries/javalib/java/awt/Robot.java:1.3	Thu Jan 13 07:04:19 2005
+++ kaffe/libraries/javalib/java/awt/Robot.java	Wed Feb 23 21:02:34 2005
@@ -40,6 +40,7 @@
 
 import gnu.java.awt.ClasspathToolkit;
 
+import java.lang.reflect.InvocationTargetException;
 import java.awt.event.InputEvent;
 import java.awt.image.BufferedImage;
 import java.awt.peer.RobotPeer;
@@ -53,8 +54,8 @@
  *
  * Since Robot generates native windowing system events, rather than
  * simply inserting {@link AWTEvents} on the AWT event queue, its use
- * is not restricted to Java programs.  It can be to programatically
- * drive any graphical application.
+ * is not restricted to Java programs.  It can be used to
+ * programatically drive any graphical application.
  *
  * This implementation requires an X server that supports the XTest
  * extension.
@@ -384,7 +385,8 @@
   }
 
   /**
-   * Wait until the event dispatch thread is idle.
+   * Wait until all events currently on the event queue have been
+   * dispatched.
    */
   public void waitForIdle ()
   {
@@ -393,17 +395,17 @@
 					     + "the event dispatch thread");
 
     EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
-
-    while (q.peekEvent () != null)
+    try
+      {
+	q.invokeAndWait (new Runnable () { public void run () { } });
+      }
+    catch (InterruptedException e)
+      {
+	System.err.println ("Robot: waitForIdle interrupted");
+      }
+    catch (InvocationTargetException e)
       {
-	try
-	  {
-	    wait ();
-	  }
-	catch (InterruptedException e)
-	  {
-	    System.err.println ("Robot: waitForIdle interrupted");
-	  }
+	System.err.println ("Robot: waitForIdle cannot invoke target");
       }
   }
 




More information about the kaffe mailing list