diff options
author | Tom Tromey <tromey@redhat.com> | 2005-09-27 16:52:57 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2005-09-27 16:52:57 +0000 |
commit | bed2df68f626d5b6811a2734a83e6af90eb929d3 (patch) | |
tree | 1eac7a97cb44fa709206ec4243781225596a3a91 | |
parent | 0e212adf3abe9bfd04d45573000a2874b9cd3e46 (diff) | |
download | classpath-bed2df68f626d5b6811a2734a83e6af90eb929d3.tar.gz |
* java/util/zip/ZipFile.java (entries): Updated return type.
(ZipEntryEnumeration): Updated 'implements' type.
(entries): Updated type.
(ZipEntryEnumeration.elements): Likewise.
(readEntries): Updated.
(getEntries): Likewise.
(getEntry): Likewise.
(getInputStream): Likewise.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | java/util/zip/ZipFile.java | 28 |
2 files changed, 25 insertions, 14 deletions
@@ -1,5 +1,16 @@ 2005-09-27 Tom Tromey <tromey@redhat.com> + * java/util/zip/ZipFile.java (entries): Updated return type. + (ZipEntryEnumeration): Updated 'implements' type. + (entries): Updated type. + (ZipEntryEnumeration.elements): Likewise. + (readEntries): Updated. + (getEntries): Likewise. + (getEntry): Likewise. + (getInputStream): Likewise. + +2005-09-27 Tom Tromey <tromey@redhat.com> + * java/lang/Compiler.java (compileClass): Updated argument type. 2005-09-27 Tom Tromey <tromey@redhat.com> diff --git a/java/util/zip/ZipFile.java b/java/util/zip/ZipFile.java index 4be845ea7..e7b4b65e1 100644 --- a/java/util/zip/ZipFile.java +++ b/java/util/zip/ZipFile.java @@ -84,7 +84,7 @@ public class ZipFile implements ZipConstants private final RandomAccessFile raf; // The entries of this zip file when initialized and not yet closed. - private HashMap entries; + private HashMap<String, ZipEntry> entries; private boolean closed = false; @@ -268,7 +268,7 @@ public class ZipFile implements ZipConstants throw new EOFException(name); int centralOffset = readLeInt(raf, ebs); - entries = new HashMap(count+count/2); + entries = new HashMap<String, ZipEntry> (count+count/2); raf.seek(centralOffset); byte[] buffer = new byte[16]; @@ -368,7 +368,7 @@ public class ZipFile implements ZipConstants * * @exception IllegalStateException when the ZipFile has already been closed */ - public Enumeration entries() + public Enumeration<ZipEntry> entries() { checkClosed(); @@ -388,7 +388,7 @@ public class ZipFile implements ZipConstants * @exception IllegalStateException when the ZipFile has already been closed. * @exception IOException when the entries could not be read. */ - private HashMap getEntries() throws IOException + private HashMap<String, ZipEntry> getEntries() throws IOException { synchronized(raf) { @@ -416,11 +416,11 @@ public class ZipFile implements ZipConstants try { - HashMap entries = getEntries(); - ZipEntry entry = (ZipEntry) entries.get(name); + HashMap<String, ZipEntry> entries = getEntries(); + ZipEntry entry = entries.get(name); // If we didn't find it, maybe it's a directory. if (entry == null && !name.endsWith("/")) - entry = (ZipEntry) entries.get(name + '/'); + entry = entries.get(name + '/'); return entry != null ? new ZipEntry(entry, name) : null; } catch (IOException ioe) @@ -491,9 +491,9 @@ public class ZipFile implements ZipConstants { checkClosed(); - HashMap entries = getEntries(); + HashMap<String, ZipEntry> entries = getEntries(); String name = entry.getName(); - ZipEntry zipEntry = (ZipEntry) entries.get(name); + ZipEntry zipEntry = entries.get(name); if (zipEntry == null) return null; @@ -539,11 +539,11 @@ public class ZipFile implements ZipConstants } } - private static class ZipEntryEnumeration implements Enumeration + private static class ZipEntryEnumeration implements Enumeration<ZipEntry> { - private final Iterator elements; + private final Iterator<ZipEntry> elements; - public ZipEntryEnumeration(Iterator elements) + public ZipEntryEnumeration(Iterator<ZipEntry> elements) { this.elements = elements; } @@ -553,12 +553,12 @@ public class ZipFile implements ZipConstants return elements.hasNext(); } - public Object nextElement() + public ZipEntry nextElement() { /* We return a clone, just to be safe that the user doesn't * change the entry. */ - return ((ZipEntry)elements.next()).clone(); + return (ZipEntry) (elements.next().clone()); } } |