Files
openide/java/java-impl/resources/inspectionDescriptions/CloneInNonCloneableClass.html
2025-02-05 04:43:28 +00:00

13 lines
611 B
HTML

<html>
<body>
Reports classes that override the
<code>clone()</code> method but don't implement the <code>Cloneable</code> interface.
This usually represents a programming error.
<!-- tooltip end -->
<p>
Use the <b>Only warn on 'public' clone methods</b> option to ignore methods that aren't <code>public</code>.</p>
<p>For classes designed to be inherited, you may choose to override <code>clone()</code> and declare it as <code>protected</code>
without implementing the <code>Cloneable</code> interface and decide whether to implement the <code>Cloneable</code> interface in subclasses.
</p>
</body>
</html>