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

Logger.removeHandler(Handler h) does not call close() on the Handler

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.1
    • core-libs



      Name: rmT116609 Date: 03/03/2003


      FULL PRODUCT VERSION :
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      FULL OS VERSION : Windows 2000

      A DESCRIPTION OF THE PROBLEM :
      The method java.util.logging.Logger.removeHandler() does not call close() on the Handler when a handler is removed from the Logger. It just removes it from the internal collection.

      public synchronized void removeHandler(Handler handler) throws SecurityException {
      if (!anonymous) {
      manager.checkAccess();
      }
      if (handler == null) {
      throw new NullPointerException();
      }
      if (handlers == null) {
      return;
      }
      handlers.remove(handler);
          }

      Calling close() before removing will guarantee that no resources are held open when the handler is removed.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      The users have to call close() on the handler before removing it from the logger.
      (Review ID: 182037)
      ======================================================================

            caustinsunw Calvin Austin (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: