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

spec for ctor java.util.EventObject unclear

XMLWordPrintable

    • tiger
    • generic, sparc
    • generic, solaris_2.5
    • Verified

      Name: sdC67446 Date: 06/05/98


      The spec for ctor java.util.EventObject(Object source)
      does not specify behavior if 'source' == null.
      Currently ctor throws uexpected IllegalArgumentException.

      --------------Here is what doc says:--------------
      public EventObject(Object source)

            Constructs a prototypical Event
            Parameters:
                  source - The object that the Event occurred upon.

      -----Here is the test demonstrating the bug:------
      import java.util.EventObject;
      public class Test {
          public static void main(String[] args) {
              try {
                  EventObject eo = new EventObject(null);

              } catch (Exception e) {
                  System.out.println(e);
              }
          }
      }
      -----Here is output from test:--------------------
      java.lang.IllegalArgumentException: null source
      --------------------------------------------------
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: