Program: 87621
Project: 87621
Buggy source:
@Override public void run(){
  while (!this.isInterrupted()) {
synchronized (this.pendingReadEventSubscribeRequests) {
      while (!this.pendingReadEventSubscribeRequests.isEmpty()) {
        final SelectionKey canceledKey=this.pendingReadEventSubscribeRequests.poll();
        final IncomingConnection incomingConnection=(IncomingConnection)canceledKey.attachment();
        final SocketChannel socketChannel=(SocketChannel)canceledKey.channel();
        try {
          final SelectionKey newKey=socketChannel.register(this.selector,SelectionKey.OP_READ);
          newKey.attach(incomingConnection);
        }
 catch (        ClosedChannelException e) {
          incomingConnection.reportTransmissionProblem(canceledKey,e);
        }
      }
    }
    try {
      this.selector.select(500);
    }
 catch (    IOException e) {
      LOG.error(e);
    }
    final Iterator<SelectionKey> iter=this.selector.selectedKeys().iterator();
    while (iter.hasNext()) {
      final SelectionKey key=iter.next();
      iter.remove();
      if (key.isValid()) {
        if (key.isReadable()) {
          doRead(key);
        }
 else         if (key.isAcceptable()) {
          doAccept(key);
        }
 else {
          LOG.error("String_Node_Str" + key);
        }
      }
 else {
        LOG.error("String_Node_Str" + key);
      }
    }
  }
  if (this.listeningSocket != null) {
    try {
      this.listeningSocket.close();
    }
 catch (    IOException ioe) {
      LOG.debug(ioe);
    }
  }
  try {
    this.selector.close();
  }
 catch (  IOException ioe) {
    LOG.debug(StringUtils.stringifyException(ioe));
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!this.isInterrupted()) {
synchronized (this.pendingReadEventSubscribeRequests) {
      while (!this.pendingReadEventSubscribeRequests.isEmpty()) {
        final SelectionKey key=this.pendingReadEventSubscribeRequests.poll();
        final IncomingConnection incomingConnection=(IncomingConnection)key.attachment();
        final SocketChannel socketChannel=(SocketChannel)key.channel();
        try {
          final SelectionKey newKey=socketChannel.register(this.selector,SelectionKey.OP_READ);
          newKey.attach(incomingConnection);
        }
 catch (        ClosedChannelException e) {
          incomingConnection.reportTransmissionProblem(key,e);
        }
      }
    }
    try {
      this.selector.select(500);
    }
 catch (    IOException e) {
      LOG.error(e);
    }
    final Iterator<SelectionKey> iter=this.selector.selectedKeys().iterator();
    while (iter.hasNext()) {
      final SelectionKey key=iter.next();
      iter.remove();
      if (key.isValid()) {
        if (key.isReadable()) {
          doRead(key);
        }
 else         if (key.isAcceptable()) {
          doAccept(key);
        }
 else {
          LOG.error("String_Node_Str" + key);
        }
      }
 else {
        LOG.error("String_Node_Str" + key);
      }
    }
  }
  if (this.listeningSocket != null) {
    try {
      this.listeningSocket.close();
    }
 catch (    IOException ioe) {
      LOG.debug(ioe);
    }
  }
  try {
    this.selector.close();
  }
 catch (  IOException ioe) {
    LOG.debug(StringUtils.stringifyException(ioe));
  }
}