Program: 91295
Project: 91295
Buggy source:
private void process(@NotNull final ReplicatedSharedHashMap map,final int serializedEntrySize,@NotNull final EntryExternalizable externalizable,@NotNull final TcpReplicatorBuilder tcpReplicatorBuilder) throws IOException {
  final byte identifier=map.identifier();
  final short packetSize=tcpReplicatorBuilder.packetSize();
  try {
    final InetSocketAddress address=tcpReplicatorBuilder.serverInetSocketAddress();
    final Details serverDetails=new Details(address,closeables,identifier,pendingRegistrations);
    connectorBySocket.put(address,new ServerConnector(serverDetails));
    for (    InetSocketAddress client : tcpReplicatorBuilder.endpoints()) {
      final Details clientDetails=new Details(client,closeables,identifier,pendingRegistrations);
      connectorBySocket.put(client,new ClientConnector(clientDetails));
    }
    for (    AbstractConnector connector : connectorBySocket.values()) {
      connector.connect();
    }
    if (tcpReplicatorBuilder.throttle() > 0)     throttler=new Throttler(selector,throttleInterval,maxBytesInInterval);
    for (; ; ) {
      register(pendingRegistrations);
      if (!selector.isOpen())       return;
      final int nSelectedKeys=selector.select(100);
      if (throttler != null)       throttler.checkThrottleInterval();
      if (nSelectedKeys == 0) {
        continue;
      }
      final long approxTime=System.currentTimeMillis();
      final Set<SelectionKey> selectionKeys=selector.selectedKeys();
      for (      final SelectionKey key : selectionKeys) {
        try {
          if (!key.isValid())           continue;
          if (key.isAcceptable())           onAccept(key,serializedEntrySize,externalizable,packetSize,map.identifier());
          if (key.isConnectable())           onConnect(packetSize,serializedEntrySize,externalizable,key,map.identifier());
          if (key.isReadable())           onRead(map,key,approxTime,tcpReplicatorBuilder.heartBeatInterval());
          if (key.isWritable())           onWrite(key,approxTime);
          checkHeartbeat(key,approxTime,identifier);
        }
 catch (        CancelledKeyException e) {
          quietClose(key,e);
        }
catch (        ClosedSelectorException e) {
          quietClose(key,e);
        }
catch (        IOException e) {
          quietClose(key,e);
        }
catch (        Exception e) {
          LOG.info("String_Node_Str",e);
          close(key);
        }
      }
      selectionKeys.clear();
    }
  }
 catch (  ClosedSelectorException e) {
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str",e);
  }
catch (  ClosedChannelException e) {
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str",e);
  }
catch (  ConnectException e) {
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str",e);
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    if (selector != null)     try {
      selector.close();
    }
 catch (    IOException e) {
      if (LOG.isDebugEnabled())       LOG.debug("String_Node_Str",e);
    }
    close();
  }
}

Fixed version (ground truth):
private void process(@NotNull final ReplicatedSharedHashMap map,final int serializedEntrySize,@NotNull final EntryExternalizable externalizable,@NotNull final TcpReplicatorBuilder tcpReplicatorBuilder) throws IOException {
  final byte identifier=map.identifier();
  final short packetSize=tcpReplicatorBuilder.packetSize();
  try {
    final InetSocketAddress address=tcpReplicatorBuilder.serverInetSocketAddress();
    final Details serverDetails=new Details(address,closeables,identifier);
    connectorBySocket.put(address,new ServerConnector(serverDetails));
    for (    InetSocketAddress client : tcpReplicatorBuilder.endpoints()) {
      final Details clientDetails=new Details(client,closeables,identifier);
      connectorBySocket.put(client,new ClientConnector(clientDetails));
    }
    for (    AbstractConnector connector : connectorBySocket.values()) {
      connector.connect();
    }
    if (tcpReplicatorBuilder.throttle() > 0)     throttler=new Throttler(selector,throttleInterval,maxBytesInInterval);
    for (; ; ) {
      register(pendingRegistrations);
      if (!selector.isOpen())       return;
      final int nSelectedKeys=selector.select(100);
      if (throttler != null)       throttler.checkThrottleInterval();
      if (nSelectedKeys == 0) {
        continue;
      }
      final long approxTime=System.currentTimeMillis();
      final Set<SelectionKey> selectionKeys=selector.selectedKeys();
      for (      final SelectionKey key : selectionKeys) {
        try {
          if (!key.isValid())           continue;
          if (key.isAcceptable())           onAccept(key,serializedEntrySize,externalizable,packetSize,map.identifier());
          if (key.isConnectable())           onConnect(packetSize,serializedEntrySize,externalizable,key,map.identifier());
          if (key.isReadable())           onRead(map,key,approxTime,tcpReplicatorBuilder.heartBeatInterval());
          if (key.isWritable())           onWrite(key,approxTime);
          checkHeartbeat(key,approxTime,identifier);
        }
 catch (        CancelledKeyException e) {
          quietClose(key,e);
        }
catch (        ClosedSelectorException e) {
          quietClose(key,e);
        }
catch (        IOException e) {
          quietClose(key,e);
        }
catch (        Exception e) {
          LOG.info("String_Node_Str",e);
          close(key);
        }
      }
      selectionKeys.clear();
    }
  }
 catch (  ClosedSelectorException e) {
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str",e);
  }
catch (  ClosedChannelException e) {
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str",e);
  }
catch (  ConnectException e) {
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str",e);
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    if (selector != null)     try {
      selector.close();
    }
 catch (    IOException e) {
      if (LOG.isDebugEnabled())       LOG.debug("String_Node_Str",e);
    }
    close();
  }
}