This rule is deprecated, and will eventually be removed.
Overriding the Object.finalize()
method must be done with caution to dispose some system resources.
Calling the super.finalize()
at the end of this method implementation is highly recommended in case parent implementations must also
dispose some system resources.
protected void finalize() { // Noncompliant; no call to super.finalize(); releaseSomeResources(); } protected void finalize() { super.finalize(); // Noncompliant; this call should come last releaseSomeResources(); }
protected void finalize() { releaseSomeResources(); super.finalize(); }