aboutsummaryrefslogtreecommitdiff
path: root/test/java/nio/channels
diff options
context:
space:
mode:
authoralanb <none@none>2012-04-16 20:12:20 +0100
committeralanb <none@none>2012-04-16 20:12:20 +0100
commite4e4007edb91dd47c2e11d779ba667fb02ba233a (patch)
tree04bfc9e559d980dd5126d0c24b8077b6592ae5e1 /test/java/nio/channels
parent481a6b21ac19ab7c3c4e3d9be885dfdc430e3cfe (diff)
7143744: (se) Stabilize KQueue SelectorProvider and make default on MacOSX
Reviewed-by: michaelm, chegar
Diffstat (limited to 'test/java/nio/channels')
-rw-r--r--test/java/nio/channels/Selector/OpRead.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/java/nio/channels/Selector/OpRead.java b/test/java/nio/channels/Selector/OpRead.java
index 78340509e..cec477901 100644
--- a/test/java/nio/channels/Selector/OpRead.java
+++ b/test/java/nio/channels/Selector/OpRead.java
@@ -58,7 +58,10 @@ public class OpRead {
boolean done = false;
int failCount = 0;
while (!done) {
- if (selector.select() > 0) {
+ int nSelected = selector.select();
+ if (nSelected > 0) {
+ if (nSelected > 1)
+ throw new RuntimeException("More than one channel selected");
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> iterator = keys.iterator();
while (iterator.hasNext()) {