Program: 48979
Project: 48979
Buggy source:
@Override public void onReplicationEvent(WanReplicationEvent replicationEvent){
  Object eventObject=replicationEvent.getEventObject();
  if (eventObject instanceof MapReplicationUpdate) {
    MapReplicationUpdate replicationUpdate=(MapReplicationUpdate)eventObject;
    EntryView entryView=replicationUpdate.getEntryView();
    MapMergePolicy mergePolicy=replicationUpdate.getMergePolicy();
    String mapName=replicationUpdate.getMapName();
    MapContainer mapContainer=getMapContainer(mapName);
    MergeOperation operation=new MergeOperation(mapName,toData(entryView.getKey(),mapContainer.getPartitionStrategy()),entryView,mergePolicy);
    try {
      int partitionId=nodeEngine.getPartitionService().getPartitionId(entryView.getKey());
      Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).build();
      invocation.invoke().get();
    }
 catch (    Throwable t) {
      throw ExceptionUtil.rethrow(t);
    }
  }
 else   if (eventObject instanceof MapReplicationRemove) {
    MapReplicationRemove replicationRemove=(MapReplicationRemove)eventObject;
    String mapName=replicationRemove.getMapName();
    DeleteOperation operation=new DeleteOperation(replicationRemove.getMapName(),replicationRemove.getKey());
    try {
      int partitionId=nodeEngine.getPartitionService().getPartitionId(replicationRemove.getKey());
      Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).build();
      invocation.invoke().get();
    }
 catch (    Throwable t) {
      throw ExceptionUtil.rethrow(t);
    }
  }
}

Fixed version (ground truth):
@Override public void onReplicationEvent(WanReplicationEvent replicationEvent){
  Object eventObject=replicationEvent.getEventObject();
  if (eventObject instanceof MapReplicationUpdate) {
    MapReplicationUpdate replicationUpdate=(MapReplicationUpdate)eventObject;
    EntryView entryView=replicationUpdate.getEntryView();
    MapMergePolicy mergePolicy=replicationUpdate.getMergePolicy();
    String mapName=replicationUpdate.getMapName();
    MapContainer mapContainer=getMapContainer(mapName);
    MergeOperation operation=new MergeOperation(mapName,toData(entryView.getKey(),mapContainer.getPartitionStrategy()),entryView,mergePolicy);
    try {
      int partitionId=nodeEngine.getPartitionService().getPartitionId(entryView.getKey());
      Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).build();
      invocation.invoke().get();
    }
 catch (    Throwable t) {
      throw ExceptionUtil.rethrow(t);
    }
  }
 else   if (eventObject instanceof MapReplicationRemove) {
    MapReplicationRemove replicationRemove=(MapReplicationRemove)eventObject;
    DeleteOperation operation=new DeleteOperation(replicationRemove.getMapName(),replicationRemove.getKey());
    try {
      int partitionId=nodeEngine.getPartitionService().getPartitionId(replicationRemove.getKey());
      Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).build();
      invocation.invoke().get();
    }
 catch (    Throwable t) {
      throw ExceptionUtil.rethrow(t);
    }
  }
}