An empty finalize method is useless and may prevent finalization from working properly. This is because, unlike a constructor, a finalizer does not implicitly call the finalizer of the superclass. Thus, an empty finalizer prevents any finalization logic that is defined in any of its superclasses from being executed.

Do not include an empty finalize method.

In the following example, the empty finalize method in class ExtendedLog prevents the finalize method in class Log from being called. The result is that the log file is not closed. To fix this, remove the empty finalize method.

  • Java Language Specification: 12.6 Finalization of Class Instances.