https://issues.apache.org/bugzilla/show_bug.cgi?id=53780

--- Comment #2 from David Pletcher <[email protected]> ---
Thank you for the quick response.

I reported this as a new issue because it encompasses an additional problem,
the memory leak via deleteOnExit. I also included the part about temporary file
cleanup (bug 53493) because the problems are entangled; it's convenient to
address both symptoms at the same time.

The generally accepted wisdom about finalize methods is not to use them, ever.
It isn't a reliable mechanism for doing anything; one should never assume that
finalizers will run, and the object graph tends to be seen in an inconsistent
state within these methods, often causing weird and unpredictable problems. The
patch for 53493 that calls finalize() explicitly is a direct violation of the
finalize contract; it must only run once, if ever. See Effective Java or this
stackoveflow thread:
http://stackoverflow.com/questions/158174/why-would-you-ever-implement-finalize

Solving the problem with a new dispose method seems reasonable; I'll submit a
revised patch today.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to