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

Non-aligned behavior in EventQueue between getNextEvent() and peekEvent()

XMLWordPrintable

    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.6.0_03"
      Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Linux pitt 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      The behavior of EventQueue.getNextEvent() is to first flush the pending events (calling SunToolkit.flushPendingEvents()), and then to return the next event.
      However, EventQueue.peekEvent() does not flush pending events, so it is possible to call peekEvent(), having back a null return value that indicates that there are no events, while instead events are present and would be returned by getNextEvent().


      REPRODUCIBILITY :
      This bug can be reproduced always.

            art Artem Ananiev (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: