mirror of
https://github.com/github/codeql.git
synced 2025-12-25 13:16:33 +01:00
40 lines
733 B
XML
40 lines
733 B
XML
<!DOCTYPE qhelp PUBLIC
|
|
"-//Semmle//qhelp//EN"
|
|
"qhelp.dtd">
|
|
<qhelp>
|
|
|
|
|
|
<overview>
|
|
<p>
|
|
Overriding the <code>Object.finalize</code> method is
|
|
not a reliable way to terminate use of resources.
|
|
In particular, there are no guarantees regarding the timeliness of
|
|
finalizer execution.
|
|
</p>
|
|
|
|
</overview>
|
|
<recommendation>
|
|
|
|
<p>
|
|
Provide explicit termination methods, which should be
|
|
called by users of an API.
|
|
</p>
|
|
|
|
</recommendation>
|
|
<references>
|
|
|
|
|
|
<li>
|
|
J. Bloch, <em>Effective Java (second edition)</em>,
|
|
Item 7.
|
|
Addison-Wesley, 2008.
|
|
</li>
|
|
<li>
|
|
Java Language Specification:
|
|
<a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.6">12.6. Finalization of Class Instances</a>.
|
|
</li>
|
|
|
|
|
|
</references>
|
|
</qhelp>
|