This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Robot patchlet


Tom F. --

I noticed last night that Robot calls a static method, invokeAndWait,
in a non-static way.  This is ok, but a little bit confusing.  I want
to check in the appended, what do you think?  Is there some reason to
find the system event queue here?

Tom

Index: java/awt/Robot.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Robot.java,v
retrieving revision 1.6
diff -u -r1.6 Robot.java
--- java/awt/Robot.java	22 Feb 2005 07:07:46 -0000	1.6
+++ java/awt/Robot.java	26 Apr 2005 16:39:31 -0000
@@ -394,10 +394,9 @@
       throw new IllegalThreadStateException ("Robot: waitForIdle called from "
 					     + "the event dispatch thread");
 
-    EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
     try
       {
-	q.invokeAndWait (new Runnable () { public void run () { } });
+	EventQueue.invokeAndWait (new Runnable () { public void run () { } });
       }
     catch (InterruptedException e)
       {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]