commit-classpath
[Top][All Lists]
Advanced

[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);

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]