This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: gnu.java.nio.channels.FileChannelImpl
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 4 May 2004 07:35:00 +0200
- Subject: 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;