diff options
Diffstat (limited to 'libjava/java/nio/channels/spi/AbstractSelectionKey.java')
-rw-r--r-- | libjava/java/nio/channels/spi/AbstractSelectionKey.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libjava/java/nio/channels/spi/AbstractSelectionKey.java b/libjava/java/nio/channels/spi/AbstractSelectionKey.java index 01ea4f33fc2..0cd5ee104e1 100644 --- a/libjava/java/nio/channels/spi/AbstractSelectionKey.java +++ b/libjava/java/nio/channels/spi/AbstractSelectionKey.java @@ -1,5 +1,5 @@ /* AbstractSelectionKey.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,7 +45,7 @@ import java.nio.channels.SelectionKey; public abstract class AbstractSelectionKey extends SelectionKey { - boolean ok = true; + private boolean cancelled = false; /** * Initializes the key. @@ -59,10 +59,12 @@ public abstract class AbstractSelectionKey */ public final void cancel () { - if (ok) - selector ().selectedKeys ().add (this); - - ok = false; + if (isValid()) + { + // FIXME: implement this. + //selector().cancelledKeys().add (this); + cancelled = true; + } } /** @@ -70,6 +72,6 @@ public abstract class AbstractSelectionKey */ public final boolean isValid () { - return ok; + return !cancelled; } } |