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

java.awt.AWTEventMulticaster.getListeners: null reaction

XMLWordPrintable

    • b95
    • sparc
    • solaris_7



      Name: sdR10048 Date: 06/27/2002


      JDK1.4.0rc-b92 doc for
      java.awt.AWTEventMulticaster.getListeners(EventListener l,
      Class listenerType) says nothing about situation when listenerType == null:

      ---
      public static EventListener[] getListeners(EventListener l,
                                                 Class listenerType)

      Returns an array of all the objects chained as FooListeners
      by the specified java.util.EventListener.
      FooListeners are chained by the AWTEventMulticaster using
      the addFooListener method. If a null listener is specified,
      this method returns an empty array. If the specified listener
      is not an instance of AWTEventMulticaster, this method returns
      an array which contains only the specified listener.
      If no such listeners are chanined, this method returns
      an empty array.

      Parameters:

      l - the specified java.util.EventListener
      listenerType - the type of listeners requested;
          this parameter should specify an interface that descends
          from java.util.EventListener

      Returns:

          an array of all objects chained as FooListeners by the
          specified multicast listener, or an empty array if no such
          listeners have been chained by the specified multicast listener

      Throws:

      ClassCastException - if listenerType doesn't specify a class or
          interface that implements java.util.EventListener
      ---

      This reaction should be specified as required in
      "Requirements for Writing Java API Specifications"
      http://java.sun.com/j2se/javadoc/writingapispecs/index.html#method.

      Currently JDK throws NullPointerException.

      ======================================================================

            son Oleg Sukhodolsky (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: