commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1142272 - /commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
Date Sat, 02 Jul 2011 19:20:35 GMT
Author: simonetripodi
Date: Sat Jul  2 19:20:35 2011
New Revision: 1142272

URL: http://svn.apache.org/viewvc?rev=1142272&view=rev
Log:
copy array values in a smartest way

Modified:
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java?rev=1142272&r1=1142271&r2=1142272&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
Sat Jul  2 19:20:35 2011
@@ -19,6 +19,7 @@ package org.apache.commons.digester3;
  * under the License.
  */
 
+import static java.lang.System.arraycopy;
 import static java.lang.String.format;
 import static java.util.Arrays.fill;
 import static org.apache.commons.beanutils.ConvertUtils.convert;
@@ -196,10 +197,7 @@ public class CallMethodRule
             // copy the parameter class names into an array
             // the classes will be loaded when the digester is set
             this.paramClassNames = new String[paramTypes.length];
-            for ( int i = 0; i < this.paramClassNames.length; i++ )
-            {
-                this.paramClassNames[i] = paramTypes[i];
-            }
+            arraycopy( paramTypes, 0, this.paramClassNames, 0, paramTypes.length );
         }
     }
 
@@ -246,10 +244,7 @@ public class CallMethodRule
         else
         {
             this.paramTypes = new Class[paramTypes.length];
-            for ( int i = 0; i < this.paramTypes.length; i++ )
-            {
-                this.paramTypes[i] = paramTypes[i];
-            }
+            arraycopy( paramTypes, 0, this.paramTypes, 0, paramTypes.length );
         }
     }
 



Mime
View raw message