summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-01-14 14:32:14 +0000
committerNeil Fuller <nfuller@google.com>2015-01-14 14:32:14 +0000
commit9944af27afcb5d58293b4fd158abf6853505d4f5 (patch)
tree5fd4f968a5b3d6eef10d84b4b322beac69703474
parentd182f85c484f6be01b6bff015adc00a01fa63935 (diff)
downloadlibcore-9944af27afcb5d58293b4fd158abf6853505d4f5.tar.gz
libcore-9944af27afcb5d58293b4fd158abf6853505d4f5.tar.bz2
libcore-9944af27afcb5d58293b4fd158abf6853505d4f5.zip
Fix confusing Selector docs
Change-Id: Ifb2139c49a071dcf2e28e8df54e355321508f4db
-rw-r--r--luni/src/main/java/java/nio/channels/Selector.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/luni/src/main/java/java/nio/channels/Selector.java b/luni/src/main/java/java/nio/channels/Selector.java
index 6d9b06369..baa6a7f03 100644
--- a/luni/src/main/java/java/nio/channels/Selector.java
+++ b/luni/src/main/java/java/nio/channels/Selector.java
@@ -78,8 +78,11 @@ public abstract class Selector implements Closeable {
public abstract boolean isOpen();
/**
- * Gets the set of registered keys. The set is immutable and is not thread-
- * safe.
+ * Gets the set of registered keys.
+ *
+ * <p>The returned set cannot be changed directly but can be modified
+ * indirectly by operations on the Selector. It should therefore not be
+ * treated as thread-safe.
*
* @return the set of registered keys.
*/
@@ -127,9 +130,11 @@ public abstract class Selector implements Closeable {
public abstract int select(long timeout) throws IOException;
/**
- * Gets the selection keys whose channels are ready for operation. The set
- * is not thread-safe and no keys may be added to it. Removing keys is
- * allowed.
+ * Gets the selection keys whose channels are ready for operation.
+ *
+ * <p>Keys cannot be added to the set directly. Keys can be removed.
+ * The set can be modified indirectly by operations on the Selector. It
+ * should therefore not be treated as thread-safe.
*
* @return the selection keys whose channels are ready for operation.
* @throws ClosedSelectorException