Search:     Advanced search
server monitoring

Code Correctness: Class Does Not Implement Cloneable

Article ID: 103
Last updated: 06 May, 2008
Views: 274
Posted: 06 May, 2008
by: Tech Pubs S.
Updated: 06 May, 2008
by: Tech Pubs S.

Code Correctness: Class Does Not Implement Cloneable

Abstract

This class implements a clone() method but does not implement Cloneable.

Description

It appears that the programmer intended for this class to implement the Cloneable interface because it implements a method named clone(). However, the class does not implement the Cloneable interface and the clone() method will not behave correctly.

Examples

Calling clone() for this class will result in a CloneNotSupportedException.

	public class Kibitzer {
public Object clone() throws CloneNotSupportedException {
...
}
}
This article was:   Helpful | Not Helpful
Prev   Next
Environmental Vulnerability     Poor Logging Practice: Use of a System Output Stream