Program: 91349
Project: 91349
Buggy source:
static VanillaSharedReplicatedHashMap<Integer,CharSequence> newSocketShmIntString(final byte identifier,final int serverPort,ClientPort... clientSocketChannelProviderMaps) throws IOException {
  final VanillaSharedReplicatedHashMapBuilder builder=new VanillaSharedReplicatedHashMapBuilder().entries(1000).identifier(identifier);
  final VanillaSharedReplicatedHashMap<Integer,CharSequence> result=builder.create(getPersistenceFile(),Integer.class,CharSequence.class);
  final int adjustedEntrySize=result.maxEntrySize();
  final short maxNumberOfEntriesPerChunk=ServerTcpSocketReplicator.toMaxNumberOfEntriesPerChunk(1024 * 8,adjustedEntrySize);
  for (  ClientPort clientSocketChannelProvider : clientSocketChannelProviderMaps) {
    final SocketChannelEntryWriter socketChannelEntryWriter0=new SocketChannelEntryWriter(adjustedEntrySize,maxNumberOfEntriesPerChunk,result);
    final SocketChannelEntryReader socketChannelEntryReader=new SocketChannelEntryReader(adjustedEntrySize,result);
    ClientTcpSocketReplicator clientTcpSocketReplicator=new ClientTcpSocketReplicator(clientSocketChannelProvider,socketChannelEntryReader,socketChannelEntryWriter0,result);
    result.addCloseable(clientTcpSocketReplicator);
  }
  final SocketChannelEntryWriter socketChannelEntryWriter=new SocketChannelEntryWriter(adjustedEntrySize,maxNumberOfEntriesPerChunk,result);
  final ServerTcpSocketReplicator serverTcpSocketReplicator=new ServerTcpSocketReplicator(result,result,serverPort,socketChannelEntryWriter);
  result.addCloseable(serverTcpSocketReplicator);
  return result;
}

Fixed version (ground truth):
static VanillaSharedReplicatedHashMap<Integer,CharSequence> newSocketShmIntString(final byte identifier,final int serverPort,ClientPort... clientSocketChannelProviderMaps) throws IOException {
  final VanillaSharedReplicatedHashMapBuilder builder=new VanillaSharedReplicatedHashMapBuilder().entries(1000).identifier(identifier);
  final VanillaSharedReplicatedHashMap<Integer,CharSequence> result=builder.create(getPersistenceFile(),Integer.class,CharSequence.class);
  final int adjustedEntrySize=result.maxEntrySize() + 128;
  final short maxNumberOfEntriesPerChunk=ServerTcpSocketReplicator.toMaxNumberOfEntriesPerChunk(1024 * 8,adjustedEntrySize);
  for (  ClientPort clientSocketChannelProvider : clientSocketChannelProviderMaps) {
    final SocketChannelEntryWriter socketChannelEntryWriter0=new SocketChannelEntryWriter(adjustedEntrySize,maxNumberOfEntriesPerChunk,result);
    final SocketChannelEntryReader socketChannelEntryReader=new SocketChannelEntryReader(adjustedEntrySize,result);
    ClientTcpSocketReplicator clientTcpSocketReplicator=new ClientTcpSocketReplicator(clientSocketChannelProvider,socketChannelEntryReader,socketChannelEntryWriter0,result);
    result.addCloseable(clientTcpSocketReplicator);
  }
  final SocketChannelEntryWriter socketChannelEntryWriter=new SocketChannelEntryWriter(adjustedEntrySize,maxNumberOfEntriesPerChunk,result);
  final ServerTcpSocketReplicator serverTcpSocketReplicator=new ServerTcpSocketReplicator(result,result,serverPort,socketChannelEntryWriter);
  result.addCloseable(serverTcpSocketReplicator);
  return result;
}