Difference between revisions of "Code Correctness: Erroneous finalize() Method"
From OWASP
Weilin Zhong (talk | contribs) (→Examples) |
Weilin Zhong (talk | contribs) |
||
| Line 18: | Line 18: | ||
discardNative(); | discardNative(); | ||
} | } | ||
| + | |||
| + | ==Related Threats== | ||
| + | |||
| + | ==Related Attacks== | ||
| + | |||
| + | [[:Category:API Abuse]] | ||
| + | |||
| + | ==Related Vulnerabilities== | ||
| + | |||
| + | ==Related Countermeasures== | ||
==References== | ==References== | ||
[1] J. Gosling, B. Joy, G. Steele, G. Bracha. The Java Language Specification, Second Edition. Addison-Wesley, 2000. | [1] J. Gosling, B. Joy, G. Steele, G. Bracha. The Java Language Specification, Second Edition. Addison-Wesley, 2000. | ||
| − | |||
| − | |||
[[Category:Java]] | [[Category:Java]] | ||
| Line 30: | Line 38: | ||
[[Category:Code Snippet]] | [[Category:Code Snippet]] | ||
| + | |||
| + | [[Category:Use of Dangerous API]] | ||
Revision as of 17:45, 18 July 2006
This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.
Abstract
This finalize() method does not call super.finalize().
Description
The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().[1]
Examples
The following method omits the call to super.finalize().
protected void finalize() {
discardNative();
}
Related Threats
Related Attacks
Related Vulnerabilities
Related Countermeasures
References
[1] J. Gosling, B. Joy, G. Steele, G. Bracha. The Java Language Specification, Second Edition. Addison-Wesley, 2000.