mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
27 lines
840 B
HTML
27 lines
840 B
HTML
<html>
|
|
<body>
|
|
Reports classes which may be cloned.
|
|
<p>
|
|
A class
|
|
may be cloned if it supports the <code>Cloneable</code> interface,
|
|
and its <code>clone()</code> method is not defined to immediately
|
|
throw an error. Cloneable classes may be dangerous in code intended for secure use.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<code>class SecureBean implements Cloneable {}</code>
|
|
<p>After the quick-fix is applied:</p><code>class SecureBean {}</code>
|
|
<p>
|
|
When the class extends an existing cloneable class or implements a cloneable interface,
|
|
then after the quick-fix is applied, the code may look like:
|
|
<pre><code>class SecureBean extends ParentBean {
|
|
@Override
|
|
protected SecureBean clone() throws CloneNotSupportedException {
|
|
throw new CloneNotSupportedException();
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
|
|
</body>
|
|
</html> |