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. From-SVN: r74182
This commit is contained in:
parent
598e749df6
commit
d9b526cc1d
2 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue