This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Code Correctness: Class Does Not Implement Cloneable

From OWASP
Revision as of 17:50, 19 July 2006 by Weilin Zhong (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.

This article includes content generously donated to OWASP by MicroFocus Logo.png

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 {
		... 
	  }
	}

Related Threats

Related Attacks

Related Vulnerabilities

Related Countermeasures

Categories