-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5
Name: mgC56079 Date: 04/24/98
Javadoc says:
/**
* Stop dispatching events using this EventQueue instance.
* Any pending events are transferred to the previous
* EventQueue for processing by it. If called from the
* initial EventQueue for this AWTContext, an
* EmptyStackException is thrown.
*/
protected synchronized void pop() throws EmptyStackException
synchronized (newEventQueue) {
newEventQueue.queue = queue; // may be null
newEventQueue.prev = this;
next = newEventQueue;
}
}
---- Here is the test ----
import java.util.EmptyStackException;
import java.awt.*;
public class EventQueueTest {
public static void main(String[] args) {
NewEventQueue q=new NewEventQueue();
try {
q.pop();
}
catch (EmptyStackException e) {
System.out.println("passed");
}
System.out.println("EmptyStackException expected");
}
}
class NewEventQueue extends EventQueue {
public void pop() throws EmptyStackException {
super.pop();
}
}
---- Sample run ----
% java EventQueueTest
java.lang.NullPointerException
at java.awt.EventQueue.pop(EventQueue.java:198)
at NewEventQueue.pop(EventQueueTest.java:20)
at EventQueueTest.main(EventQueueTest.java:8)
======================================================================