@Override protected void finalize() throws IOException { if (!closed) { String warn = "There is code leaving resource input streams open, locks around them might not be cleared! "; if (!TRACE_ENABLED) { warn += "Add -D" + GS_LOCK_TRACE + "=true to your JVM options to get a full stack trace of the code that acquired the input stream"; } LOGGER.warning(warn); if (TRACE_ENABLED) { LOGGER.log( Level.WARNING, "The unclosed input stream originated on this stack trace", tracer); } } super.finalize(); } };
protected void finalize() throws IOException { // forcibly close it because super.finalize() may keep the FD open, which may prevent // file deletion close(); super.finalize(); } };