Program: 167377
Project: 167377
Buggy source:
void handleEntityListPayload(EntityDataMessage inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  Map<String,ArrayList<EntityData>> outboundMessages=new HashMap<String,ArrayList<EntityData>>();
  ArrayList<EntityData> inputDatas=inputMessage.getPayload();
  for (  EntityData entityData : inputDatas) {
    getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
    bindEntityData(scriptEngine,inputMessage,entityData);
    if (routes != null) {
      for (      Route route : routes) {
        try {
          if (Boolean.TRUE.equals(scriptEngine.eval(route.getMatchExpression()))) {
            getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
            ArrayList<EntityData> outboundPayload=outboundMessages.get(route.getTargetStepId());
            if (outboundPayload == null) {
              outboundPayload=new ArrayList<EntityData>();
              outboundMessages.put(route.getTargetStepId(),outboundPayload);
            }
            if (outboundPayload.size() >= rowsPerMessage) {
              outboundMessages.remove(route.getTargetStepId());
              callback.sendEntityDataMessage(null,outboundPayload,route.getTargetStepId());
              targetStepsThatNeedControlMessages.add(route.getTargetStepId());
            }
            outboundPayload.add(entityData.copy());
            if (onlyRouteFirstMatch) {
              break;
            }
          }
        }
 catch (        ScriptException e) {
          throw new RuntimeException(e);
        }
      }
    }
  }
  for (  String targetFlowStepId : outboundMessages.keySet()) {
    callback.sendEntityDataMessage(null,outboundMessages.get(targetFlowStepId),targetFlowStepId);
    targetStepsThatNeedControlMessages.add(targetFlowStepId);
  }
}

Fixed version (ground truth):
void handleEntityListPayload(EntityDataMessage inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  Map<String,ArrayList<EntityData>> outboundMessages=new HashMap<String,ArrayList<EntityData>>();
  ArrayList<EntityData> inputDatas=inputMessage.getPayload();
  for (  EntityData entityData : inputDatas) {
    getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
    bindEntityData(scriptEngine,inputMessage,entityData);
    if (routes != null) {
      for (      Route route : routes) {
        try {
          if (Boolean.TRUE.equals(scriptEngine.eval(route.getMatchExpression()))) {
            ArrayList<EntityData> outboundPayload=outboundMessages.get(route.getTargetStepId());
            if (outboundPayload == null) {
              outboundPayload=new ArrayList<EntityData>();
              outboundMessages.put(route.getTargetStepId(),outboundPayload);
            }
            if (outboundPayload.size() >= rowsPerMessage) {
              outboundMessages.remove(route.getTargetStepId());
              callback.sendEntityDataMessage(null,outboundPayload,route.getTargetStepId());
              targetStepsThatNeedControlMessages.add(route.getTargetStepId());
            }
            outboundPayload.add(entityData.copy());
            if (onlyRouteFirstMatch) {
              break;
            }
          }
        }
 catch (        ScriptException e) {
          throw new RuntimeException(e);
        }
      }
    }
  }
  for (  String targetFlowStepId : outboundMessages.keySet()) {
    callback.sendEntityDataMessage(null,outboundMessages.get(targetFlowStepId),targetFlowStepId);
    targetStepsThatNeedControlMessages.add(targetFlowStepId);
  }
}