harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
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 GMT
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) {



Mime
View raw message