Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6562050

Inconsistent Java Doc for invokeLater/invokieAndWait

XMLWordPrintable

    • b21
    • x86
    • windows_xp
    • Verified

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      You known, the invokeLater/invokieAndWait in javax.swing.SwingUtilities is just a wrapper of java.awt.EventQueue. But the java doc for the codes is in inconsistent:

      in SwingUtilities
      ----------------------
          /**
           * Causes <i>doRun.run()</i> to be executed asynchronously on the
           * AWT event dispatching thread. ...
           */
          public static void invokeLater(Runnable doRun) {
      EventQueue.invokeLater(doRun);
          }


          /**
           * Causes <code>doRun.run()</code> to be executed synchronously on the
           * AWT event dispatching thread. ...
           */
          public static void invokeAndWait(final Runnable doRun)
              throws InterruptedException, InvocationTargetException
          {
      EventQueue.invokeAndWait(doRun);
          }


      one is asynchronously, another is synchronously.



      in EventQueue
      ---------------------

          /**
           * @param runnable the <code>Runnable</code> whose <code>run</code>
           * method should be executed
           * synchronously on the <code>EventQueue</code>
           */
          public static void invokeLater(Runnable runnable) {
              Toolkit.getEventQueue().postEvent(
                  new InvocationEvent(Toolkit.getDefaultToolkit(), runnable));
          }

          /**
           * @param runnable the <code>Runnable</code> whose <code>run</code>
           * method should be executed
           * synchronously on the <code>EventQueue</code>
           */
          public static void invokeAndWait(Runnable runnable)
                   throws InterruptedException, InvocationTargetException {


      Two are synchronously now.




      REPRODUCIBILITY :
      This bug can be reproduced always.

            art Artem Ananiev (Inactive)
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: