This is not necessary; it is a finalizer writing down an idiom that must be respected.
If you reorganize your code at any time in the future and your class extends another class that the finalize method may have, this practice will prevent strange errors from occurring.
Idiom
try { // Do whatever the finalization is } finally { super.finalize(); }
This ensures that the finalizer of the superclass, if it is ever non-trivial, is called even if some exception is thrown (because nothing catches the exceptions in the finalizers, their execution simply stops).
And of course: Avoid finalizers . (Paragraph 7 in Joshua Bloch Effective Java, second edition).
Realskeptic
source share