commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r1057434 - in /commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang: ObjectUtils.java exception/CloneFailedException.java
Date Tue, 11 Jan 2011 01:27:37 GMT
Author: niallp
Date: Tue Jan 11 01:27:37 2011
New Revision: 1057434

URL: http://svn.apache.org/viewvc?rev=1057434&view=rev
Log:
Port LANG-576 to LANG 2.x Branch - extend CloneFailedException from NestableRuntimeException
and add back constructors which take a Throwable

Modified:
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ObjectUtils.java
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/exception/CloneFailedException.java

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ObjectUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ObjectUtils.java?rev=1057434&r1=1057433&r2=1057434&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ObjectUtils.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/ObjectUtils.java
Tue Jan 11 01:27:37 2011
@@ -397,13 +397,13 @@ public class ObjectUtils {
                 } catch (final NoSuchMethodException e) {
                     throw new CloneFailedException("Cloneable type "
                         + o.getClass().getName()
-                        + " has no clone method: " + e);
+                        + " has no clone method", e);
                 } catch (final IllegalAccessException e) {
                     throw new CloneFailedException("Cannot clone Cloneable type "
-                        + o.getClass().getName() + ": " + e);
+                        + o.getClass().getName(), e);
                 } catch (final InvocationTargetException e) {
                     throw new CloneFailedException("Exception cloning Cloneable type "
-                        + o.getClass().getName() + ": " + e.getTargetException());
+                        + o.getClass().getName(), e.getTargetException());
                 }
             }
             return result;

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/exception/CloneFailedException.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/exception/CloneFailedException.java?rev=1057434&r1=1057433&r2=1057434&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/exception/CloneFailedException.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/exception/CloneFailedException.java
Tue Jan 11 01:27:37 2011
@@ -23,7 +23,7 @@ package org.apache.commons.lang.exceptio
  * @author Apache Software Foundation
  * @since 2.6
  */
-public class CloneFailedException extends RuntimeException {
+public class CloneFailedException extends NestableRuntimeException {
     // ~ Static fields/initializers ---------------------------------------------
 
     private static final long serialVersionUID = 20091223L;
@@ -39,4 +39,25 @@ public class CloneFailedException extend
     public CloneFailedException(final String message) {
         super(message);
     }
+
+    /**
+     * Constructs a CloneFailedException.
+     * 
+     * @param cause cause of the exception
+     * @since upcoming
+     */
+    public CloneFailedException(final Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs a CloneFailedException.
+     * 
+     * @param message description of the exception
+     * @param cause cause of the exception
+     * @since upcoming
+     */
+    public CloneFailedException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
 }



Mime
View raw message