Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 97003 invoked from network); 26 Jan 2010 11:43:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jan 2010 11:43:45 -0000 Received: (qmail 15974 invoked by uid 500); 26 Jan 2010 11:43:44 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 15879 invoked by uid 500); 26 Jan 2010 11:43:44 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 15870 invoked by uid 99); 26 Jan 2010 11:43:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2010 11:43:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2010 11:43:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 53D8A238890A; Tue, 26 Jan 2010 11:43:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r903184 - /commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/reflect/MethodArgument.java Date: Tue, 26 Jan 2010 11:43:21 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100126114321.53D8A238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Tue Jan 26 11:43:20 2010 New Revision: 903184 URL: http://svn.apache.org/viewvc?rev=903184&view=rev Log: MethodArgument#getAnnotations() and MethodArgument#getDeclaredAnnotations() now return a copy of the original annotations arrays Modified: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/reflect/MethodArgument.java Modified: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/reflect/MethodArgument.java URL: http://svn.apache.org/viewvc/commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/reflect/MethodArgument.java?rev=903184&r1=903183&r2=903184&view=diff ============================================================================== --- commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/reflect/MethodArgument.java (original) +++ commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/reflect/MethodArgument.java Tue Jan 26 11:43:20 2010 @@ -90,14 +90,27 @@ * {@inheritDoc} */ public Annotation[] getAnnotations() { - return this.annotations; + return this.getAnnotationsArrayCopy(); } /** * {@inheritDoc} */ public Annotation[] getDeclaredAnnotations() { - return this.annotations; + return this.getAnnotationsArrayCopy(); + } + + /** + * Returns an annotations array, copy of the declared annotations in this + * method argument. + * + * @return an annotations array, copy of the declared annotations in this + * method argument. + */ + private Annotation[] getAnnotationsArrayCopy() { + Annotation[] annotations = new Annotation[this.annotations.length]; + System.arraycopy(this.annotations, 0, annotations, 0, annotations.length); + return annotations; } /**