diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-11-29 22:43:35 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-11-29 22:43:35 +0000 |
commit | 3be294e0e9f07e379e1499b9868db9855eb8726f (patch) | |
tree | a1f67d3f1469ecc142b11c30b1e3c2e1a624794d /java/util/jar/JarEntry.java | |
parent | f40b961c6c82ebc9ae9863635e5fe19c0b07c116 (diff) | |
download | classpath-3be294e0e9f07e379e1499b9868db9855eb8726f.tar.gz |
2006-11-29 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD-->generics for 2006/11/12-2006/11/29.
Diffstat (limited to 'java/util/jar/JarEntry.java')
-rw-r--r-- | java/util/jar/JarEntry.java | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/java/util/jar/JarEntry.java b/java/util/jar/JarEntry.java index 722a283bb..515b45fa9 100644 --- a/java/util/jar/JarEntry.java +++ b/java/util/jar/JarEntry.java @@ -1,5 +1,5 @@ /* JarEntry.java - Represents an entry in a jar file - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,6 +39,7 @@ package java.util.jar; import java.io.IOException; import java.security.cert.Certificate; +import java.util.Set; import java.util.zip.ZipEntry; /** @@ -60,7 +61,7 @@ public class JarEntry extends ZipEntry // (Package local) fields Attributes attr; - Certificate certs[]; + JarFile jarfile; // Constructors @@ -79,7 +80,7 @@ public class JarEntry extends ZipEntry { super(name); attr = null; - certs = null; + jarfile = null; } /** @@ -93,7 +94,7 @@ public class JarEntry extends ZipEntry { super(entry); attr = null; - certs = null; + jarfile = null; } /** @@ -112,7 +113,7 @@ public class JarEntry extends ZipEntry catch (IOException _) { } - certs = entry.getCertificates(); + jarfile = entry.jarfile; } // Methods @@ -153,13 +154,19 @@ public class JarEntry extends ZipEntry */ public Certificate[] getCertificates() { - if (certs != null) + if (jarfile != null) { - return (Certificate[])certs.clone(); - } - else - { - return null; + synchronized (jarfile) + { + if (jarfile.entryCerts != null) + { + Set certs = (Set) jarfile.entryCerts.get(getName()); + if (certs != null + && jarfile.verified.get(getName()) == Boolean.TRUE) + return (Certificate[]) certs.toArray(new Certificate[certs.size()]); + } + } } + return null; } } |