commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1142025 - /commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java
Date Fri, 01 Jul 2011 18:58:48 GMT
Author: simonetripodi
Date: Fri Jul  1 18:58:48 2011
New Revision: 1142025

URL: http://svn.apache.org/viewvc?rev=1142025&view=rev
Log:
fixed findbugs violation: URF_UNREAD_FIELD

Modified:
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java?rev=1142025&r1=1142024&r2=1142025&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java
Fri Jul  1 18:58:48 2011
@@ -19,6 +19,8 @@ package org.apache.commons.digester3.ann
  * under the License.
  */
 
+import static java.lang.System.arraycopy;
+
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
 
@@ -55,9 +57,20 @@ public final class MethodArgument
      */
     public MethodArgument( int index, Class<?> parameterType, Annotation[] annotations
)
     {
+        if ( parameterType == null )
+        {
+            throw new IllegalArgumentException( "Argument 'parameterType' must be not null"
);
+        }
+        if ( annotations == null )
+        {
+            throw new IllegalArgumentException( "Argument 'annotations' must be not null"
);
+        }
+
         this.index = index;
         this.parameterType = parameterType;
-        this.annotations = annotations;
+        this.annotations = new Annotation[annotations.length];
+
+        arraycopy( annotations, 0, this.annotations, 0, annotations.length );
     }
 
     /**



Mime
View raw message