Files
openide/java/java-impl/resources/inspectionDescriptions/CloneableClassInSecureContext.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

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>