db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1468225 - in /db/derby/code/trunk/java/engine/org/apache/derby/iapi: error/StandardException.java services/io/ArrayUtil.java
Date Mon, 15 Apr 2013 20:57:34 GMT
Author: rhillegas
Date: Mon Apr 15 20:57:33 2013
New Revision: 1468225

URL: http://svn.apache.org/r1468225
Log:
DERBY-6182: Shore up the encapsulation of StandardException.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java?rev=1468225&r1=1468224&r2=1468225&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java Mon
Apr 15 20:57:33 2013
@@ -25,6 +25,7 @@ import java.sql.SQLException;
 import java.sql.SQLWarning;
 
 import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.io.ArrayUtil;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -113,10 +114,7 @@ public class StandardException extends E
 	 * Returns the arguments for this exception,
 	 * if there are any.
 	 */
-	public final Object[] getArguments()
-	{
-		return arguments;
-	}
+	public final Object[] getArguments()    { return ArrayUtil.copy( arguments ); }
 
 	/**
 		Yes, report me. Errors that need this method to return

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java?rev=1468225&r1=1468224&r2=1468225&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java Mon Apr
15 20:57:33 2013
@@ -42,6 +42,12 @@ public abstract class ArrayUtil
 	//
 	///////////////////////////////////////////////////////////////////
 
+    /** Copy an array of objects; the original array could be null */
+    public  static  Object[]    copy( Object[] original )
+    {
+        return (original == null) ? null : (Object[]) original.clone();
+    }
+
     /** Copy an array of strings; the original array could be null */
     public  static  String[]    copy( String[] original )
     {



Mime
View raw message