Class NoFinalizerCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class NoFinalizerCheck
    extends AbstractCheck
    Checks that there is no method finalize with zero parameters.

    See Object.finalize()

    Rationale: Finalizers are unpredictable, often dangerous, and generally unnecessary. Their use can cause erratic behavior, poor performance, and portability problems. For more information for the finalize method and its issues, see Effective Java: Programming Language Guide Third Edition by Joshua Bloch, §8.

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • avoid.finalizer.method
    Since:
    5.0