OSDN Git Service

* java/util/zip/ZipFile.java (finalize): New method.
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Feb 2003 12:35:49 +0000 (12:35 +0000)
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Feb 2003 12:35:49 +0000 (12:35 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63218 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/util/zip/ZipFile.java

index 40cb712..2663795 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-21  Mark Wielaard  <mark@klomp.org>
+
+       * java/util/zip/ZipFile.java (finalize): New method.
+
 2003-02-21  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/nio/natSocketChannelImpl.cc:
index 4b027b0..8f7ef6f 100644 (file)
@@ -305,6 +305,15 @@ public class ZipFile implements ZipConstants
   }
 
   /**
+   * 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()