FIN.NOSUPER

Implementation of the finalize() method should call super.finalize(). FIN.* code problems report on questionable implementations of the finalize method(). In this case there is a finalize() method implementation that does not call super.finalize().

Vulnerability and risk

If a superclass implementor overrides a superclass finalizer but forgets to invoke the superclass finalizer manually, the superclass finalizer will never be invoked. This means resource cleanup for the superclass will never be performed, leading to resource leaks.

Example 1

Copy
  public class FIN_NOSUPER_Sample_1 {
      /*
     * no super.finalize() was called
     */
     public void finalize() {
         System.err.println("finalized");
     }
 }

FIN.NOSUPER is reported for 'finalize' method declaration on line 12: Implementation of the finalize() method should call super.finalize().