Program: 46636
Project: 46636
Buggy source:
@Override public void run(){
  final Semaphore semaphore=new Semaphore(0);
  int recordCount=0;
  final ILogger logger=nodeEngine.getLogger(MapSplitBrainHandlerService.class);
  ExecutionCallback mergeCallback=new ExecutionCallback(){
    @Override public void onResponse(    Object response){
      semaphore.release(1);
    }
    @Override public void onFailure(    Throwable t){
      logger.warning("String_Node_Str" + t.getMessage());
      semaphore.release(1);
    }
  }
;
  for (  MapContainer mapContainer : recordMap.keySet()) {
    String mapName=mapContainer.getName();
    Collection<Record> recordList=recordMap.get(mapContainer);
    String mergePolicyName=mapContainer.getMapConfig().getMergePolicy();
    final MapMergePolicy finalMergePolicy=mapServiceContext.getMergePolicyProvider().getMergePolicy(mergePolicyName);
    MapOperationProvider operationProvider=mapServiceContext.getMapOperationProvider(mapName);
    for (    Record record : recordList) {
      recordCount++;
      EntryView entryView=EntryViews.createSimpleEntryView(record.getKey(),mapServiceContext.toData(record.getValue()),record);
      MapOperation operation=operationProvider.createMergeOperation(mapName,record.getKey(),entryView,finalMergePolicy,false);
      try {
        int partitionId=nodeEngine.getPartitionService().getPartitionId(record.getKey());
        ICompletableFuture f=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
        f.andThen(mergeCallback);
      }
 catch (      Throwable t) {
        throw ExceptionUtil.rethrow(t);
      }
    }
  }
  try {
    semaphore.tryAcquire(recordCount,recordCount * TIMEOUT_FACTOR,TimeUnit.MILLISECONDS);
  }
 catch (  InterruptedException e) {
    logger.finest("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  final Semaphore semaphore=new Semaphore(0);
  int recordCount=0;
  final ILogger logger=nodeEngine.getLogger(MapSplitBrainHandlerService.class);
  ExecutionCallback mergeCallback=new ExecutionCallback(){
    @Override public void onResponse(    Object response){
      semaphore.release(1);
    }
    @Override public void onFailure(    Throwable t){
      logger.warning("String_Node_Str" + t.getMessage());
      semaphore.release(1);
    }
  }
;
  for (  Map.Entry<MapContainer,Collection<Record>> recordMapEntry : recordMap.entrySet()) {
    MapContainer mapContainer=recordMapEntry.getKey();
    Collection<Record> recordList=recordMapEntry.getValue();
    String mergePolicyName=mapContainer.getMapConfig().getMergePolicy();
    String mapName=mapContainer.getName();
    final MapMergePolicy finalMergePolicy=mapServiceContext.getMergePolicyProvider().getMergePolicy(mergePolicyName);
    MapOperationProvider operationProvider=mapServiceContext.getMapOperationProvider(mapName);
    for (    Record record : recordList) {
      recordCount++;
      EntryView entryView=EntryViews.createSimpleEntryView(record.getKey(),mapServiceContext.toData(record.getValue()),record);
      MapOperation operation=operationProvider.createMergeOperation(mapName,record.getKey(),entryView,finalMergePolicy,false);
      try {
        int partitionId=nodeEngine.getPartitionService().getPartitionId(record.getKey());
        ICompletableFuture f=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
        f.andThen(mergeCallback);
      }
 catch (      Throwable t) {
        throw ExceptionUtil.rethrow(t);
      }
    }
  }
  try {
    semaphore.tryAcquire(recordCount,recordCount * TIMEOUT_FACTOR,TimeUnit.MILLISECONDS);
  }
 catch (  InterruptedException e) {
    logger.finest("String_Node_Str");
  }
}