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

java.util.logging.Logger.removeHandler(null) throws NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • core-libs
    • b26
    • sparc
    • solaris_2.6
    • Verified



      Name: sdR10048 Date: 10/07/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b22"
      JCK : 1.5
      Platform[s] : Solaris
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] : api/java_util/logging/Logger/index.html#RemoveHandler[Logger0006_15]
      (will be in WS soon)


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void removeHandler(Handler handler)
                         throws SecurityException
      Remove a log Handler.

      Returns silently if the given Handler is not found or is null

      Parameters:
      handler - a logging Handler
      Throws:
      SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control").
      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      The designated method throws NPE in case input param == null.
      And that does not fit to current spec.


          
      Minimized test:
      ===============
      ------- T.java -------
      import java.util.logging.*;

      public class T extends Logger {
          public T(String name, String rbundle) {
              super(name, rbundle);
          }

          public static void main(String[] args) {
              T logger = new T("test", null);
              logger.removeHandler(null);
          }
      }

      ------- end-of-T.java -------

      Minimized test output:
      ======================
      Exception in thread "main" java.lang.NullPointerException
              at java.util.logging.Logger.removeHandler(Logger.java:1161)
              at T.main(T.java:10)

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

            caustinsunw Calvin Austin (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: