What would happen if an exception is thrown during the execution of finalize()? Is the stack unwind like normally? Does it continue finalize() and ignore the exception? Does it stop finalize() and continue GC the object? Or something else?
I'm not looking for guidelines of using finalize() there are plently of pages explaining that.
From the Object#finalize() javadoc:
Any exception thrown by the finalize method causes the finalization of this object to be halted, but is otherwise ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With