浏览代码

Change clone() method to throw CloneNotSupportedException.

Matthew Porter 20 年之前
父节点
当前提交
1e896c14d6
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      domain/src/main/java/org/acegisecurity/domain/impl/BusinessObject.java

+ 3 - 2
domain/src/main/java/org/acegisecurity/domain/impl/BusinessObject.java

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