Inspectopedia 2024.3 Help

Cloning issues

'clone()' does not declare 'CloneNotSupportedException'   New in this release

Reports clone() methods that do not declare throws CloneNotSupportedException.

'clone()' instantiates objects with constructor   New in this release

Reports calls to object constructors inside clone() methods.

'clone()' method in non-Cloneable class   New in this release

Reports classes that override the clone() method but don't implement the Cloneable interface.

'clone()' method not 'public'   New in this release

Reports clone() methods that are protected and not public.

'clone()' should have return type equal to the class it contains   New in this release

Reports clone() methods with return types different from the class they're located in.

Cloneable class without 'clone()' method   New in this release

Reports classes implementing the Cloneable interface that don't override the clone() method.

Use of 'clone()' or 'Cloneable'   New in this release

Reports implementations of, and calls to, the clone() method and uses of the java.lang.Cloneable interface.

Last modified: 11 September 2024