TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Category: CloneImplementation

Synopsis:The Clone Implementation ruleset contains a collection of rules that find questionable usages of the clone() method.


Description:
The Clone Implementation ruleset contains a collection of rules that find questionable usages of the clone() method.

Coding Rules

NameCheckedSynopsis
CloneImplementation1 Checked automatically with code checker Object clone() should be implemented with super.clone()
CloneImplementation2 Checked automatically with code checker clone() method should throw CloneNotSupportedException
CloneImplementation3 Checked automatically with code checker clone() method should be implemented only if implementing Cloneable interface
CloneImplementation4 Checked automatically with code checker Clone method should be public
CloneImplementation5 Checked automatically with code checker Clone method return type should match class name