Name: dsR10051 Date: 11/21/2000
The class java.awt.EventQueue encapsulates asynchronous event dispatch machinery
which extracts events from the queue and dispatches them. In the JDK this
machinery is implemented by java.awt.EventDispatchTread class that
is inaccessible for developer. Besides, the behavior of this machinery is
The JCK team needs to turn off this machinery, in order to write correct
tests for the EventQueue class. The following problems are blocking
us from writing the JCK tests:
1. EventDispatchThread class dispatches the events almost immediately, so
if we post event to the queue we can't check its existence in queue.
The methods getNextEvent, peekEvent may return no event, because it
has been dispatched already.
2. The tests create many queues, thus many treads are created when we run test
suite in single jvm mode. We need to interrupt this threads to avoid memory
leaks. It is very important for JCK.
So, the tests should know how to interrupt the EventDispatchThread or create the
EventQueue whithout dispatch thread.
Indeedly, the new EventQueue constructor that doesn't allow creating
EventDispatchThread when creating/using the instance of EventQueue is the
solution for problems above.