[kaffe] CVS kaffe (dalibor): Resynced with GNU Classpath

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Mon Feb 2 09:09:07 2004


PatchSet 4386 
Date: 2004/02/02 17:04:17
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath

2004-02-02  Dalibor Topic <robilad@kaffe.org>

        Resynced with GNU Classpath.

        2004-01-25  Michael Koch  <konqueror@gmx.de>

        * gnu/java/nio/FileLockImpl.java:
        Fixed filename in copyright.
        (released): Removed.
        (finalize): New method.

Members: 
	ChangeLog:1.1970->1.1971 
	libraries/javalib/gnu/java/nio/FileLockImpl.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1970 kaffe/ChangeLog:1.1971
--- kaffe/ChangeLog:1.1970	Mon Feb  2 16:52:03 2004
+++ kaffe/ChangeLog	Mon Feb  2 17:04:17 2004
@@ -4,6 +4,17 @@
 
 	2004-01-25  Michael Koch  <konqueror@gmx.de>
 
+        * gnu/java/nio/FileLockImpl.java:
+        Fixed filename in copyright.
+        (released): Removed.
+        (finalize): New method.
+
+2004-02-02  Dalibor Topic <robilad@kaffe.org>
+
+	Resynced with GNU Classpath.
+
+	2004-01-25  Michael Koch  <konqueror@gmx.de>
+
         * gnu/java/lang/ClassHelper.java
         (getPackagePortion): Moved to java.lang.Class.
         * java/lang/Class.java: Merged more with libgcj, renamed some
Index: kaffe/libraries/javalib/gnu/java/nio/FileLockImpl.java
diff -u kaffe/libraries/javalib/gnu/java/nio/FileLockImpl.java:1.3 kaffe/libraries/javalib/gnu/java/nio/FileLockImpl.java:1.4
--- kaffe/libraries/javalib/gnu/java/nio/FileLockImpl.java:1.3	Tue Oct 28 12:29:38 2003
+++ kaffe/libraries/javalib/gnu/java/nio/FileLockImpl.java	Mon Feb  2 17:04:18 2004
@@ -1,5 +1,5 @@
-/* FileChannelImpl.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+/* FileLockImpl.java -- 
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -60,20 +60,29 @@
   }
   
   private FileDescriptor fd;
-  private boolean released;
   
   public FileLockImpl (FileDescriptor fd, FileChannel channel, long position,
                        long size, boolean shared)
   {
     super (channel, position, size, shared);
     this.fd = fd;
-    this.released = false;
+  }
+
+  public void finalize()
+  {
+    try
+      {
+	release();
+      }
+    catch (IOException e)
+      {
+	// Ignore this.
+      }
   }
   
   public boolean isValid ()
   {
-    return (released
-            || !channel ().isOpen ());
+    return !channel().isOpen();
   }
 
   private native void releaseImpl () throws IOException;
@@ -81,6 +90,5 @@
   public synchronized void release () throws IOException
   {
     releaseImpl ();
-    released = true;
   }
 }