summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-06-03 22:51:34 +0000
committerTom Tromey <tromey@redhat.com>2002-06-03 22:51:34 +0000
commit8087c760979ba45e4ec3bfc4bc3ebac905e9bd1e (patch)
tree77af7314031d63ebe7c3d035e05d1b753ffaafeb
parentbe784d5fd3902e5b365605fbdac7182ed4dab7e8 (diff)
downloadclasspath-8087c760979ba45e4ec3bfc4bc3ebac905e9bd1e.tar.gz
* java/util/zip/ZipEntry.java (clone): Copy `extra' field.
* java/util/zip/ZipInputStream.java (getNextEntry): Use createZipEntry.
-rw-r--r--ChangeLog6
-rw-r--r--java/util/zip/ZipEntry.java8
-rw-r--r--java/util/zip/ZipInputStream.java4
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e285e0851..f2dd3612c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-06-03 Tom Tromey <tromey@redhat.com>
+
+ * java/util/zip/ZipEntry.java (clone): Copy `extra' field.
+ * java/util/zip/ZipInputStream.java (getNextEntry): Use
+ createZipEntry.
+
2002-05-30 John Leuner <jewel@debian.org>
* java/util/zip/*java: Changed to use default character
diff --git a/java/util/zip/ZipEntry.java b/java/util/zip/ZipEntry.java
index d7dee0c2a..5a43b1f5a 100644
--- a/java/util/zip/ZipEntry.java
+++ b/java/util/zip/ZipEntry.java
@@ -1,5 +1,5 @@
/* java.util.zip.ZipEntry
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -163,7 +163,11 @@ public class ZipEntry implements ZipConstants, Cloneable
{
try
{
- return super.clone();
+ // The JCL says that the `extra' field is also copied.
+ ZipEntry clone = (ZipEntry) super.clone();
+ if (extra != null)
+ clone.extra = (byte[]) extra.clone();
+ return clone;
}
catch (CloneNotSupportedException ex)
{
diff --git a/java/util/zip/ZipInputStream.java b/java/util/zip/ZipInputStream.java
index 3c4a5d6f6..63153b649 100644
--- a/java/util/zip/ZipInputStream.java
+++ b/java/util/zip/ZipInputStream.java
@@ -1,5 +1,5 @@
/* java.util.zip.ZipInputStream
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -170,7 +170,7 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants
readFully(buffer);
String name = new String(buffer);
- entry = new ZipEntry(name);
+ entry = createZipEntry(name);
entry.setMethod(method);
if ((flags & 8) == 0)
{