mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
32 lines
806 B
HTML
32 lines
806 B
HTML
<html>
|
|
<body>
|
|
Reports any implementations of the <code>Object.finalize()</code> method that are
|
|
declared <code>public</code>.
|
|
<p>
|
|
According to the contract of the <code>Object.finalize()</code>, only the garbage
|
|
collector calls this method. Making this method public may be confusing, because it
|
|
means that the method can be used from other code.
|
|
</p>
|
|
<p>
|
|
A quick-fix is provided to make the method <code>protected</code>, to prevent it from being invoked
|
|
from other classes.
|
|
</p>
|
|
<!-- tooltip end -->
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
<b>class</b> X {
|
|
<b>public void</b> finalize() {
|
|
/* ... */
|
|
}
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
<b>class</b> X {
|
|
<b>protected void</b> finalize() {
|
|
/* ... */
|
|
}
|
|
}
|
|
</code></pre>
|
|
</body>
|
|
</html> |