[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Make EventQueue.postEvent(null) fail fast
From: |
Mark Wielaard |
Subject: |
FYI: Make EventQueue.postEvent(null) fail fast |
Date: |
Sun, 27 Jun 2004 12:48:56 +0200 |
Hi,
The following make EventQueue.postEvent() throw a NullPointerException
immediately when it gets a null event.
2004-06-27 Mark Wielaard <address@hidden>
* java/awt/EventQueue.java (postEvent): Throw NullPointerException
when argument is null.
In the past a null event could slip through and only throw a
NullPointerException much later during event processing making debugging
horribly complicated. Committed.
Cheers,
Mark
--- java/awt/EventQueue.java 26 Jan 2004 16:33:01 -0000 1.16
+++ java/awt/EventQueue.java 27 Jun 2004 10:45:28 -0000
@@ -161,6 +161,9 @@
*/
public synchronized void postEvent(AWTEvent evt)
{
+ if (evt == null)
+ throw new NullPointerException();
+
if (next != null)
{
next.postEvent(evt);
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Make EventQueue.postEvent(null) fail fast,
Mark Wielaard <=