This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: ZipFile.finalize()
- From: Mark Wielaard <mark at klomp dot org>
- To: java-patches at gcc dot gnu dot org
- Date: 21 Feb 2003 13:34:48 +0100
- Subject: FYI: ZipFile.finalize()
- Organization:
Hi,
This Classpath patch makes our java.util.zip 100% API compatible
according to japi.
2003-02-21 Mark Wielaard <mark at klomp dot org>
* java/util/zip/ZipFile.java (finalize): New method.
I am committing this on branch and mainline.
Cheers,
Mark
Index: java/util/zip/ZipFile.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/ZipFile.java,v
retrieving revision 1.20
diff -u -r1.20 ZipFile.java
--- java/util/zip/ZipFile.java 2 Jan 2003 21:01:24 -0000 1.20
+++ java/util/zip/ZipFile.java 21 Feb 2003 12:31:20 -0000
@@ -305,6 +305,15 @@
}
/**
+ * Calls the <code>close()</code> method when this ZipFile has not yet
+ * been explicitly closed.
+ */
+ protected void finalize() throws IOException
+ {
+ if (!closed) close();
+ }
+
+ /**
* Returns an enumeration of all Zip entries in this Zip file.
*/
public Enumeration entries()