This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: gnu.java.nio.channels.FileChannelImpl


Hi list,


I commited the attached patch which fixes finalized FileChannel objects 
that not explicitely closed their associated file.


Michael


2004-05-04  Mark Wielaard  <mark@klomp.org>

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

Index: gnu/java/nio/channels/FileChannelImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/channels/FileChannelImpl.java,v
retrieving revision 1.3
diff -u -r1.3 FileChannelImpl.java
--- gnu/java/nio/channels/FileChannelImpl.java	23 Apr 2004 06:56:34 -0000	1.3
+++ gnu/java/nio/channels/FileChannelImpl.java	4 May 2004 05:31:38 -0000
@@ -115,6 +115,11 @@
     this.mode = mode;
   }
 
+  protected void finalize() throws Throwable
+  {
+    close();
+  }
+
   public static FileChannelImpl in;
   public static FileChannelImpl out;
   public static FileChannelImpl err;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]