Change clone() method to throw CloneNotSupportedException.

This commit is contained in:
Matthew Porter 2005-03-31 02:51:04 +00:00
parent b800ad3e8b
commit 1e896c14d6
1 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@ import java.io.Serializable;
* *
* @author Carlos Sanchez * @author Carlos Sanchez
* @author Ben Alex * @author Ben Alex
* @author Matthew Porter
* @version $Id$ * @version $Id$
*/ */
public abstract class BusinessObject implements Serializable, Cloneable { public abstract class BusinessObject implements Serializable, Cloneable {
@ -61,12 +62,12 @@ public abstract class BusinessObject implements Serializable, Cloneable {
* @see java.lang.Object#clone() * @see java.lang.Object#clone()
* @see BeanUtils#cloneBean(Object) * @see BeanUtils#cloneBean(Object)
*/ */
public Object clone() { public Object clone() throws CloneNotSupportedException {
try { try {
return BeanUtils.cloneBean(this); return BeanUtils.cloneBean(this);
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error(e);
throw new IllegalStateException(e); throw new CloneNotSupportedException(e.getMessage());
} }
} }