mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
30 lines
1.4 KiB
HTML
30 lines
1.4 KiB
HTML
<html>
|
|
<body>
|
|
Reports overriding the <code>Object.finalize()</code> method.
|
|
<p>According to the <code>Object.finalize()</code> documentation:</p>
|
|
<blockquote>
|
|
<p>
|
|
The finalization mechanism is inherently problematic. Finalization can lead
|
|
to performance issues, deadlocks, and hangs. Errors in finalizers can lead
|
|
to resource leaks; there is no way to cancel finalization if it is no longer
|
|
necessary; and no ordering is specified among calls to <code>finalize</code>
|
|
methods of different objects. Furthermore, there are no guarantees regarding
|
|
the timing of finalization. The <code>finalize</code> method might be called
|
|
on a finalizable object only after an indefinite delay, if at all.
|
|
</p>
|
|
</blockquote>
|
|
<!-- tooltip end -->
|
|
<p>Configure the inspection:</p>
|
|
<ul>
|
|
<li>
|
|
Use the <b>Ignore for trivial 'finalize()' implementations</b> option to ignore
|
|
<code>finalize()</code> implementations with an empty method body or a body
|
|
containing only <code>if</code> statements that have a condition which evaluates
|
|
to <code>false</code> and is a compile-time constant. For performance reasons it
|
|
can be beneficial to override a non-trivial <code>finalize()</code> with an empty
|
|
implementation in a subclass. An empty final <code>finalize()</code> implementation
|
|
can also be used to prevent subclasses from overriding.
|
|
</li>
|
|
</ul>
|
|
</body>
|
|
</html> |