Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 88787 invoked from network); 23 Nov 2006 11:49:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Nov 2006 11:49:52 -0000 Received: (qmail 33384 invoked by uid 500); 23 Nov 2006 11:50:02 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 33367 invoked by uid 500); 23 Nov 2006 11:50:02 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 33358 invoked by uid 99); 23 Nov 2006 11:50:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2006 03:50:02 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2006 03:49:52 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 201F91A9846; Thu, 23 Nov 2006 03:49:17 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r478539 - /harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarEntry.java Date: Thu, 23 Nov 2006 11:49:16 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061123114917.201F91A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tellison Date: Thu Nov 23 03:49:14 2006 New Revision: 478539 URL: http://svn.apache.org/viewvc?view=rev&rev=478539 Log: Return copy of certificates array to avoid modification by callers. Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarEntry.java Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarEntry.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarEntry.java?view=diff&rev=478539&r1=478538&r2=478539 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarEntry.java (original) +++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/jar/JarEntry.java Thu Nov 23 03:49:14 2006 @@ -90,7 +90,12 @@ * @return java.security.cert.Certificate[] Certificates for this entry */ public Certificate[] getCertificates() { - return certificates; + if (certificates == null) { + return null; + } + Certificate[] copy = new Certificate[certificates.length]; + System.arraycopy(certificates, 0, copy, 0, copy.length); + return copy; } void setAttributes(Attributes attrib) { @@ -132,7 +137,6 @@ CodeSigner[] tmp = new CodeSigner[signers.length]; System.arraycopy(signers, 0, tmp, 0, tmp.length); return tmp; - } private CodeSigner[] getCodeSigners(Certificate[] certs) {