code: public static void cleanup(Log log, java.io.Closeable... closeables) {
      for(java.io.Closeable c : closeables) {
        if (c != null) {
          try {
            c.close();
          } catch(IOException e) {
            if (log != null && log.isDebugEnabled()) {
              log.debug("Exception in closing " + c, e);
            }
          }
        }
      }
    }
docs: Close the Closeable objects and <b>ignore</b> any {@link IOException} or
  null pointers. Must only be used for cleanup in exception handlers.
  @param log the log to record problems to at debug level. Can be null.
  @param closeables the objects to close