commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: FileChannelImpl finalize added


From: Mark Wielaard
Subject: FYI: FileChannelImpl finalize added
Date: Sun, 02 May 2004 11:12:45 +0200

Hi,

Michael Koch complained that I clearly hadn't tried running gjdoc with
GNU Classpath CVS. (He was right. I used the native compiled version
which uses gcj 3.3.) Otherwise I would have hit the Too Many Files Open
bug he observed. Luckily the solution is really minimal and there is now
a Mauve test to back this up (which fails before this patch and succeeds
after applying the patch).

2004-05-02  Mark Wielaard  <address@hidden>

       * gnu/java/nio/channels/FileChannelImpl.java (finalize): New method.

Hopefully one of the last code changes before 0.09. Now just updating
the documentation and we are ready to launch!

Cheers,

Mark
Index: gnu/java/nio/channels/FileChannelImpl.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/java/nio/channels/FileChannelImpl.java,v
retrieving revision 1.6
diff -u -r1.6 FileChannelImpl.java
--- gnu/java/nio/channels/FileChannelImpl.java  1 May 2004 10:40:55 -0000       
1.6
+++ gnu/java/nio/channels/FileChannelImpl.java  2 May 2004 09:07:55 -0000
@@ -131,6 +131,14 @@
     
   protected native void implCloseChannel() throws IOException;
 
+  /**
+   * Makes sure the Channel is properly closed.
+   */
+  protected void finalize() throws IOException
+  {
+    this.close();
+  }
+
   public int read (ByteBuffer dst) throws IOException
   {
     int result;

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]