if (key != null)
if (key != null && key.isValid())
  public final SelectionKey register(Selector selin, int ops, Object att)    throws ClosedChannelException  {    if (! isOpen())      throw new ClosedChannelException();    if ((ops & ~validOps()) != 0)      throw new IllegalArgumentException();        SelectionKey key = null;    AbstractSelector selector = (AbstractSelector) selin;    synchronized (blockingLock())      {	key = locate(selector);	if (key != null)          {	    if (att != null)	      key.attach(att);          }        else          {	    key = selector.register(this, ops, att);	    if (key != null)	      addSelectionKey(key);	  }      }    		    return key;          }