FinalizeShouldBeProtected

If you override finalize(), make it protected. If you make it public, other classes may call it.

This rule is defined by the following XPath expression:

                    
//MethodDeclaration[@Protected="false"]
  /MethodDeclarator[@Image="finalize"]
  [not(FormalParameters/*)]
                    
                

Example:

                
  
public class Foo {
 public void finalize() {
  // do something
 }
}