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

SequencedEvent focus bug in EventQueue pop.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.0.1, 5.0
    • client-libs
    • x86
    • windows_nt, windows_2000

      This bug is based on and replaces RFE 4516924 : Request public access to pumpEvents(Conditional) type functionality.

      The functionality to do what the submitter needs in RFE 4516924
      exists in the push and pop
      methods of EventQueue.java. However there is a focus related bug in pop
      involving SequencedEvent. Therefore the rfe was closed and this bug
      was opened to fix the SequencedEvent bug.

      The following changes are proposed to AWT to allow an application to
      call pumpEvents in EventQueue.java. They were made to a development
      workspace but not putback, so that the attached test program test.java
      could be run to test the feasability of adding the pumpEvents method
      to EventQueue.java.

      ------- Conditional.java -------
      *** /tmp/sccs.qtaWUS Thu Feb 13 15:56:57 2003
      --- Conditional.java Thu Feb 13 15:35:34 2003
      ***************
      *** 15,20 ****
         * @version %I% %G%
         * @author David Mendenhall
         */
      ! interface Conditional {
            boolean evaluate();
        }
      --- 15,20 ----
         * @version %I% %G%
         * @author David Mendenhall
         */
      ! public interface Conditional {
            boolean evaluate();
        }

      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      ------- EventQueue.java -------
      *** /tmp/sccs.6na4TS Thu Feb 13 15:56:57 2003
      --- EventQueue.java Thu Feb 13 15:12:58 2003
      ***************
      *** 848,854 ****
      --- 848,858 ----
                    }
                }
            }
      +
      + protected void pumpEvents(Conditional cond) {
      + dispatchThread.pumpEvents(cond);
            }
      + }

        /**
         * The Queue object holds pointers to the beginning and end of one internal

      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      The attached test program test.java gets into a hang because of a problem
      with a SequencedEvent on the EventQueue after an EventQueue pop operation.

      Here is the stack trace:

      $ java test
      ok we in actionListener
      OK to pop
      ok we in actionListener
      back from pop
      Full thread dump Java HotSpot(TM) Client VM (1.4.2-beta-b15 mixed mode):

      "AWT-EventQueue-3" prio=7 tid=0x008cb108 nid=0x558 in Object.wait() [1ac2f000..
      ac2fd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x10090bb0> (a test$PopQueue)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.EventQueue.getNextEvent(EventQueue.java:334)
              - locked <0x10090bb0> (a test$PopQueue)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:167)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:103)

      "2'nd" prio=7 tid=0x18449288 nid=0x564 in Object.wait() [1abef000..1abefd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x10510320> (a java.awt.Component$AWTTreeLock)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.Dialog.show(Dialog.java:570)
              - locked <0x10510320> (a java.awt.Component$AWTTreeLock)
              at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:840)
              at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:642)
              at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:613)
              at test.run(test.java:107)
              at java.lang.Thread.run(Thread.java:534)

      "AWT-EventQueue-2" prio=7 tid=0x183f4560 nid=0x53c in Object.wait() [1abaf000..
      abafd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x10090b18> (a test$PopQueue)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.EventQueue.getNextEvent(EventQueue.java:334)
              - locked <0x10090b18> (a test$PopQueue)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:167)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:103)

      "AWT-EventQueue-1" prio=7 tid=0x18448450 nid=0x610 in Object.wait() [1ab6f000..
      ab6fd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x10090bb0> (a test$PopQueue)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.EventQueue.getNextEvent(EventQueue.java:334)
              - locked <0x10090bb0> (a test$PopQueue)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:167)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142

              at java.awt.EventQueue.pumpEvents(EventQueue.java:853)
              at test$PopQueue.pumpEvents(test.java:125)
              at test.actionPerformed(test.java:60)
              at java.awt.Button.processActionEvent(Button.java:382)
              at java.awt.Button.processEvent(Button.java:350)
              at java.awt.Component.dispatchEventImpl(Component.java:3615)
              at java.awt.Component.dispatchEvent(Component.java:3477)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:451)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:206)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:103)

      "AWT-EventQueue-2" prio=7 tid=0x1844a6d0 nid=0x5c4 in Object.wait() [1ab2f000..
      ab2fd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x10090b18> (a test$PopQueue)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.EventQueue.getNextEvent(EventQueue.java:334)
              - locked <0x10090b18> (a test$PopQueue)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:167)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:103)

      "AWT-EventQueue-0" prio=7 tid=0x1843f068 nid=0x54c in Object.wait() [1aadf000..
      aadfd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x104fbf80> (a java.awt.EventQueue)
              at java.lang.Object.wait(Object.java:429)
              at java.awt.EventQueue.getNextEvent(EventQueue.java:366)
              - locked <0x104fbf80> (a java.awt.EventQueue)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:167)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.SequencedEvent.dispatch(SequencedEvent.java:72)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:449)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:206)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:156)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:150

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:103)

      "DestroyJavaVM" prio=5 tid=0x00234d40 nid=0x508 waiting on condition [0..6fae0]

      "Java2D Disposer" daemon prio=10 tid=0x183f63a8 nid=0x5dc in Object.wait() [1a8
      f000..1a8cfd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x10090ef0> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
              - locked <0x10090ef0> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
              at sun.java2d.Disposer.run(Disposer.java:97)
              at java.lang.Thread.run(Thread.java:534)

      "AWT-Windows" daemon prio=7 tid=0x183f1a20 nid=0x570 runnable [1a84f000..1a84fd
      0]
              at sun.awt.windows.WToolkit.eventLoop(Native Method)
              at sun.awt.windows.WToolkit.run(WToolkit.java:262)
              at java.lang.Thread.run(Thread.java:534)

      "AWT-Shutdown" prio=5 tid=0x008ff008 nid=0x4d0 in Object.wait() [1a80f000..1a80
      d90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x1050e948> (a java.lang.Object)
              at java.lang.Object.wait(Object.java:429)
              at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
              - locked <0x1050e948> (a java.lang.Object)
              at java.lang.Thread.run(Thread.java:534)

      "Signal Dispatcher" daemon prio=10 tid=0x00803e98 nid=0x554 waiting on conditio
       [0..0]

      "Finalizer" daemon prio=9 tid=0x00801118 nid=0x62c in Object.wait() [1816f000..
      816fd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x1050ea48> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
              - locked <0x1050ea48> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
              at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

      "Reference Handler" daemon prio=10 tid=0x00844c78 nid=0x4a0 in Object.wait() [1
      12f000..1812fd90]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x1050e7e8> (a java.lang.ref.Reference$Lock)
              at java.lang.Object.wait(Object.java:429)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
              - locked <0x1050e7e8> (a java.lang.ref.Reference$Lock)

      "VM Thread" prio=5 tid=0x00843ac8 nid=0x458 runnable

      "VM Periodic Task Thread" prio=10 tid=0x008068e0 nid=0x390 waiting on condition

      "Suspend Checker Thread" prio=10 tid=0x008034c0 nid=0x3b8 runnable
      ###@###.### 10/5/04 08:46 GMT

            son Oleg Sukhodolsky (Inactive)
            mbronsonsunw Mike Bronson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: