'clone()' method in non-Cloneable class
Reports classes that override the clone()
method but don't implement the Cloneable
interface. This usually represents a programming error.
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
CloneInNonCloneableClass
Use the Only warn on 'public' clone methods option to ignore methods that aren't public
.
For classes designed to be inherited, you may choose to override clone()
and declare it as protected
without implementing the Cloneable
interface and decide whether to implement the Cloneable
interface in subclasses.
Here you can find the description of settings available for the 'clone()' method in non-Cloneable class inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!