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

Redundant code in EventQueue.invokeAndWait(runnable)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta
    • generic
    • generic



      Name: boT120536 Date: 12/08/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      The following line of code exists in java.awt.EventQueue.invokeAndWait
      (Runnable):

              EventQueue queue = Toolkit.getEventQueue();

      The reference to "queue" is never used in the rest of the method. This line
      should be removed. Later on when the queue is needed, the call to
        Toolkit.getEventQueue() is used. Note that the line

              Toolkit.getEventQueue().postEvent(event);

      is inside a synchronized block. Thus, if anyone were to ever use the local
      queue reference from the first line, there may be some threading problems. So,
      in order to avoid making the redundant call and to avoid confusion and thread
      problems in the future, the line "EventQueue queue = Toolkit.getEventQueue();"
      should be removed.
      (Review ID: 113513)
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: