--- a/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java Fri Mar 23 09:51:02 2018 +0100
+++ b/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java Fri Mar 23 14:18:18 2018 +0000
@@ -33,10 +33,10 @@
/**
- * An implementation of SelectionKey for Solaris.
+ * An implementation of SelectionKey.
*/
-public class SelectionKeyImpl
+public final class SelectionKeyImpl
extends AbstractSelectionKey
{
@@ -54,12 +54,14 @@
selector = sel;
}
+ @Override
public SelectableChannel channel() {
return (SelectableChannel)channel;
}
+ @Override
public Selector selector() {
- return selector;
+ return (Selector)selector;
}
int getIndex() { // package-private
@@ -75,16 +77,19 @@
throw new CancelledKeyException();
}
+ @Override
public int interestOps() {
ensureValid();
return interestOps;
}
+ @Override
public SelectionKey interestOps(int ops) {
ensureValid();
return nioInterestOps(ops);
}
+ @Override
public int readyOps() {
ensureValid();
return readyOps;
@@ -131,4 +136,6 @@
return sb.toString();
}
+ // used by Selector implementations to record when the key was selected
+ int lastPolled;
}