--- old/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java 2018-03-22 13:26:29.000000000 +0000 +++ new/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java 2018-03-22 13:26:29.000000000 +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; }