summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/nio/channels/FileChannelImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu/java/nio/channels/FileChannelImpl.java')
-rw-r--r--libjava/gnu/java/nio/channels/FileChannelImpl.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/libjava/gnu/java/nio/channels/FileChannelImpl.java b/libjava/gnu/java/nio/channels/FileChannelImpl.java
index f4686b26d4f..8b3d0fc86b3 100644
--- a/libjava/gnu/java/nio/channels/FileChannelImpl.java
+++ b/libjava/gnu/java/nio/channels/FileChannelImpl.java
@@ -115,11 +115,6 @@ public final class FileChannelImpl extends FileChannel
this.mode = mode;
}
- protected void finalize() throws Throwable
- {
- close();
- }
-
public static FileChannelImpl in;
public static FileChannelImpl out;
public static FileChannelImpl err;
@@ -137,6 +132,14 @@ public final class FileChannelImpl extends FileChannel
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;
OpenPOWER on IntegriCloud