Program: 167448
Project: 167448
Buggy source:
@SuppressWarnings("String_Node_Str") public void start(String executionId,Map<String,IResourceRuntime> deployedResources,Agent agent,List<Notification> notifications,Map<String,String> globalSettings) throws InterruptedException {
  this.stepRuntimes=new HashMap<String,StepRuntime>();
  this.agent=agent;
  this.notifications=notifications;
  this.mailSession=new MailSession(globalSettings);
  Map<String,Serializable> parameters=getFlowParameters(deployment.getAgentDeploymentParameters(),agent.getAgentParameters());
  this.flowParameters=MapUtils.typedMap(parameters,String.class,String.class);
  Flow flow=deployment.getFlow();
  List<FlowStep> steps=flow.getFlowSteps();
  executionTracker.beforeFlow(executionId);
  sendNotifications(Notification.EventType.FLOW_START);
  for (  FlowStep flowStep : steps) {
    boolean enabled=flowStep.getComponent().getBoolean(AbstractComponentRuntime.ENABLED,true);
    if (enabled) {
      ComponentContext context=new ComponentContext(flowStep,flow,executionTracker,deployedResources.get(flowStep.getComponent().getResourceId()),parameters,globalSettings);
      StepRuntime stepRuntime=new StepRuntime(componentFactory.create(flowStep.getComponent().getType()),context,this);
      stepRuntimes.put(flowStep.getId(),stepRuntime);
    }
  }
  List<FlowStepLink> links=flow.getFlowStepLinks();
  for (  String stepId : stepRuntimes.keySet()) {
    List<StepRuntime> targetStepRuntimes=new ArrayList<StepRuntime>();
    List<StepRuntime> sourceStepRuntimes=new ArrayList<StepRuntime>();
    for (    FlowStepLink flowStepLink : links) {
      if (stepId.equals(flowStepLink.getSourceStepId())) {
        StepRuntime runtime=stepRuntimes.get(flowStepLink.getTargetStepId());
        if (runtime != null) {
          targetStepRuntimes.add(runtime);
        }
      }
 else       if (stepId.equals(flowStepLink.getTargetStepId())) {
        StepRuntime runtime=stepRuntimes.get(flowStepLink.getSourceStepId());
        if (runtime != null) {
          sourceStepRuntimes.add(runtime);
        }
      }
    }
    StepRuntime runtime=stepRuntimes.get(stepId);
    if (runtime != null) {
      runtime.setTargetStepRuntimes(targetStepRuntimes);
      runtime.setSourceStepRuntimes(sourceStepRuntimes);
    }
  }
  List<StepRuntime> startSteps=findStartSteps();
  flow.calculateApproximateOrder();
  List<FlowStep> flowSteps=flow.getFlowSteps();
  for (  FlowStep flowStep : flowSteps) {
    StepRuntime stepRuntime=stepRuntimes.get(flowStep.getId());
    try {
      stepRuntime.start(executionTracker,resourceFactory);
    }
 catch (    RuntimeException ex) {
      stepRuntime.error=ex;
      throw ex;
    }
  }
  for (  StepRuntime stepRuntime : stepRuntimes.values()) {
    stepRuntime.setRunning(true);
    threadService.execute(stepRuntime);
  }
  StartupMessage startMessage=new StartupMessage();
  for (  StepRuntime stepRuntime : startSteps) {
    stepRuntime.queue(startMessage);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void start(String executionId,Map<String,IResourceRuntime> deployedResources,Agent agent,List<Notification> notifications,Map<String,String> globalSettings) throws InterruptedException {
  this.stepRuntimes=new HashMap<String,StepRuntime>();
  this.agent=agent;
  this.notifications=notifications;
  this.mailSession=new MailSession(globalSettings);
  Map<String,Serializable> parameters=getFlowParameters(deployment.getAgentDeploymentParameters(),agent.getAgentParameters());
  this.flowParameters=MapUtils.typedMap(parameters,String.class,String.class);
  Flow flow=deployment.getFlow();
  List<FlowStep> steps=flow.getFlowSteps();
  executionTracker.beforeFlow(executionId);
  sendNotifications(Notification.EventType.FLOW_START);
  for (  FlowStep flowStep : steps) {
    boolean enabled=flowStep.getComponent().getBoolean(AbstractComponentRuntime.ENABLED,true);
    if (enabled) {
      ComponentContext context=new ComponentContext(flowStep,flow,executionTracker,deployedResources.get(flowStep.getComponent().getResourceId()),parameters,globalSettings);
      StepRuntime stepRuntime=new StepRuntime(componentFactory.create(flowStep.getComponent().getType()),context,this);
      stepRuntimes.put(flowStep.getId(),stepRuntime);
    }
  }
  List<FlowStepLink> links=flow.getFlowStepLinks();
  for (  String stepId : stepRuntimes.keySet()) {
    List<StepRuntime> targetStepRuntimes=new ArrayList<StepRuntime>();
    List<StepRuntime> sourceStepRuntimes=new ArrayList<StepRuntime>();
    for (    FlowStepLink flowStepLink : links) {
      if (stepId.equals(flowStepLink.getSourceStepId())) {
        StepRuntime runtime=stepRuntimes.get(flowStepLink.getTargetStepId());
        if (runtime != null) {
          targetStepRuntimes.add(runtime);
        }
      }
 else       if (stepId.equals(flowStepLink.getTargetStepId())) {
        StepRuntime runtime=stepRuntimes.get(flowStepLink.getSourceStepId());
        if (runtime != null) {
          sourceStepRuntimes.add(runtime);
        }
      }
    }
    StepRuntime runtime=stepRuntimes.get(stepId);
    if (runtime != null) {
      runtime.setTargetStepRuntimes(targetStepRuntimes);
      runtime.setSourceStepRuntimes(sourceStepRuntimes);
    }
  }
  List<StepRuntime> startSteps=findStartSteps();
  flow.calculateApproximateOrder();
  List<FlowStep> flowSteps=flow.getFlowSteps();
  for (  FlowStep flowStep : flowSteps) {
    StepRuntime stepRuntime=stepRuntimes.get(flowStep.getId());
    if (stepRuntime != null) {
      try {
        stepRuntime.start(executionTracker,resourceFactory);
      }
 catch (      RuntimeException ex) {
        stepRuntime.error=ex;
        throw ex;
      }
    }
  }
  for (  StepRuntime stepRuntime : stepRuntimes.values()) {
    stepRuntime.setRunning(true);
    threadService.execute(stepRuntime);
  }
  StartupMessage startMessage=new StartupMessage();
  for (  StepRuntime stepRuntime : startSteps) {
    stepRuntime.queue(startMessage);
  }
}