filled arrays in a smartest way
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/digester/trunk@1142271 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/commons/digester3/CallMethodRule.java b/src/main/java/org/apache/commons/digester3/CallMethodRule.java
index c656bf2..80a86e9 100644
--- a/src/main/java/org/apache/commons/digester3/CallMethodRule.java
+++ b/src/main/java/org/apache/commons/digester3/CallMethodRule.java
@@ -20,6 +20,7 @@
*/
import static java.lang.String.format;
+import static java.util.Arrays.fill;
import static org.apache.commons.beanutils.ConvertUtils.convert;
import static org.apache.commons.beanutils.MethodUtils.invokeExactMethod;
import static org.apache.commons.beanutils.MethodUtils.invokeMethod;
@@ -123,10 +124,7 @@
else
{
this.paramTypes = new Class[paramCount];
- for ( int i = 0; i < this.paramTypes.length; i++ )
- {
- this.paramTypes[i] = String.class;
- }
+ fill( this.paramTypes, String.class );
}
}
@@ -191,10 +189,7 @@
if ( paramTypes == null )
{
this.paramTypes = new Class[paramCount];
- for ( int i = 0; i < this.paramTypes.length; i++ )
- {
- this.paramTypes[i] = String.class;
- }
+ fill( this.paramTypes, String.class );
}
else
{
@@ -246,10 +241,7 @@
if ( paramTypes == null )
{
this.paramTypes = new Class[paramCount];
- for ( int i = 0; i < this.paramTypes.length; i++ )
- {
- this.paramTypes[i] = String.class;
- }
+ fill( this.paramTypes, String.class );
}
else
{