/** * Finalize this closeable instance. If the instance hasn't been closed, it is closed and a warning is logged. */ protected void finalize() throws Throwable { try { super.finalize(); } finally { if (autoClose && isOpen()) { if (LEAK_DEBUGGING) { final Throwable t = new LeakThrowable(); t.setStackTrace(backtrace); log.warnf(t, "Leaked a %s instance: %s", getClass().getName(), this); } else { log.tracef("Leaked a %s instance: %s", getClass().getName(), this); } closeAsync(); } } }
/** * Finalize this closeable instance. If the instance hasn't been closed, it is closed and a warning is logged. */ protected void finalize() throws Throwable { try { super.finalize(); } finally { if (autoClose && isOpen()) { if (LEAK_DEBUGGING) { final Throwable t = new LeakThrowable(); t.setStackTrace(backtrace); log.warnf(t, "Leaked a %s instance: %s", getClass().getName(), this); } else { log.tracef("Leaked a %s instance: %s", getClass().getName(), this); } closeAsync(); } } }
/** * Finalize this closeable instance. If the instance hasn't been closed, it is closed and a warning is logged. */ protected void finalize() throws Throwable { try { super.finalize(); } finally { if (autoClose && isOpen()) { if (LEAK_DEBUGGING) { final Throwable t = new LeakThrowable(); t.setStackTrace(backtrace); log.warnf(t, "Leaked a %s instance: %s", getClass().getName(), this); } else { log.tracef("Leaked a %s instance: %s", getClass().getName(), this); } closeAsync(); } } }