OSDN Git Service

2003-12-02 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Dec 2003 15:11:57 +0000 (15:11 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Dec 2003 15:11:57 +0000 (15:11 +0000)
* java/nio/channels/spi/AbstractInterruptibleChannel.java
(opened): Removed.
(closed): New field.
(close): Check of channel is closed already.
(isOpen): Return !closed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74182 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java

index 690a4f7..409bf3b 100644 (file)
@@ -1,5 +1,13 @@
 2003-12-02  Michael Koch  <konqueror@gmx.de>
 
+       * java/nio/channels/spi/AbstractInterruptibleChannel.java
+       (opened): Removed.
+       (closed): New field.
+       (close): Check of channel is closed already.
+       (isOpen): Return !closed.
+
+2003-12-02  Michael Koch  <konqueror@gmx.de>
+
        * gnu/java/nio/DatagramChannelImpl.java
        (blocking): Initialize with true by default.
        * gnu/java/nio/ServerSocketChannelImpl.java
index dd4177a..0cf798e 100644 (file)
@@ -49,7 +49,7 @@ import java.nio.channels.InterruptibleChannel;
 public abstract class AbstractInterruptibleChannel
   implements Channel, InterruptibleChannel
 {
-  boolean opened = true;
+  private boolean closed;
 
   /**
    * Initializes the channel.
@@ -72,8 +72,11 @@ public abstract class AbstractInterruptibleChannel
    */
   public final void close () throws IOException
   {
-    opened = false;
-    implCloseChannel ();
+    if (!closed)
+      {
+       implCloseChannel();
+       closed = true;
+      }
   }
 
   /**
@@ -101,6 +104,6 @@ public abstract class AbstractInterruptibleChannel
    */
   public final boolean isOpen ()
   {
-    return opened;
+    return !closed;
   }
 }