This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit

Code Correctness: Erroneous finalize() Method

Revision as of 18:05, 21 May 2009 by Deleted user (talk | contribs)

Jump to: navigation, search Template:CandidateForDeletion

#REDIRECT Failure to follow guideline/specification

Last revision (mm/dd/yy): 05/21/2009


This finalize() method does not call super.finalize().

The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().[1]
The statement above is not completely correct. The Java Language Specification 3.0 section 12.6.1 states: "This should always be done, unless it is the programmer's intent to nullify the actions of the finalizer in the superclass."

Risk Factors



The following method omits the call to super.finalize().

 protected void finalize() {

Related Attacks

Related Vulnerabilities

Related Controls

Related Technical Impacts


  • [1] J. Gosling, B. Joy, G. Steele, G. Bracha. The Java Language Specification, Second Edition. Addison-Wesley, 2000.