Program: 141076
Project: 141076
Buggy source:
/** 
 * Convert the workflow to Graphviz format
 * @return a string with the workflow converted to Graphviz format
 */
private String convert(){
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + Globals.APP_NAME + "String_Node_Str"+ Globals.APP_VERSION_STRING);
  sb.append('\n');
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  for (  Step step : this.workflow.getSteps()) {
    if (step == this.workflow.getFirstStep() || step == this.workflow.getCheckerStep()) {
      continue;
    }
    sb.append("String_Node_Str");
    sb.append(step.getNumber());
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append(step.getId());
    sb.append("String_Node_Str");
    addRow(sb,step.getModuleName() + "String_Node_Str" + step.getStepVersion());
    for (    Parameter p : step.getParameters()) {
      addRow(sb,xmlEscape(p.getName()) + "String_Node_Str" + xmlEscape(p.getValue()));
    }
    sb.append("String_Node_Str");
  }
  sb.append('\n');
  final Multimap<AbstractStep,AbstractStep> linkedSteps=HashMultimap.create();
  for (  Step step : this.workflow.getSteps()) {
    if (step == this.workflow.getFirstStep() || step == this.workflow.getCheckerStep()) {
      continue;
    }
    final int stepNumber=step.getNumber();
    AbstractStep abstractStep=(AbstractStep)step;
    for (    StepOutputPort outputPort : abstractStep.getWorkflowOutputPorts()) {
      for (      StepInputPort link : outputPort.getLinks()) {
        final AbstractStep linkedStep=link.getStep();
        if (linkedStep == this.workflow.getFirstStep() || linkedStep == this.workflow.getCheckerStep()) {
          continue;
        }
        linkedSteps.put(linkedStep,abstractStep);
        sb.append("String_Node_Str");
        sb.append(stepNumber);
        sb.append("String_Node_Str");
        sb.append(linkedStep.getNumber());
        sb.append("String_Node_Str");
        final DataFormat format=outputPort.getFormat();
        String formatName=format.getAlias() == null || "String_Node_Str".equals(format.getAlias()) ? format.getName() : format.getAlias();
        sb.append(formatName);
        sb.append("String_Node_Str");
      }
    }
  }
  for (  Step step : this.workflow.getSteps()) {
    if (step == this.workflow.getFirstStep() || step == this.workflow.getCheckerStep()) {
      continue;
    }
    AbstractStep abstractStep=(AbstractStep)step;
    StepStateObserver observer=((AbstractStep)step).getStepStateObserver();
    Set<AbstractStep> requiredSteps=new HashSet<>(observer.getRequiredSteps());
    requiredSteps.removeAll(linkedSteps.get(abstractStep));
    requiredSteps.remove(this.workflow.getFirstStep());
    requiredSteps.remove(this.workflow.getCheckerStep());
    for (    AbstractStep requiredStep : requiredSteps) {
      sb.append("String_Node_Str");
      sb.append(requiredStep.getNumber());
      sb.append("String_Node_Str");
      sb.append(step.getNumber());
      sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Convert the workflow to Graphviz format
 * @return a string with the workflow converted to Graphviz format
 */
private String convert(){
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + Globals.APP_NAME + "String_Node_Str");
  sb.append(Globals.APP_VERSION_STRING);
  sb.append('\n');
  sb.append("String_Node_Str");
  sb.append("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  for (  Step step : this.workflow.getSteps()) {
    if (step == this.workflow.getFirstStep() || step == this.workflow.getCheckerStep()) {
      continue;
    }
    sb.append("String_Node_Str");
    sb.append(step.getNumber());
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append(step.getId());
    sb.append("String_Node_Str");
    addRow(sb,step.getModuleName() + "String_Node_Str" + step.getStepVersion());
    for (    Parameter p : step.getParameters()) {
      addRow(sb,xmlEscape(p.getName()) + "String_Node_Str" + xmlEscape(p.getValue()));
    }
    sb.append("String_Node_Str");
  }
  sb.append('\n');
  final Multimap<AbstractStep,AbstractStep> linkedSteps=HashMultimap.create();
  for (  Step step : this.workflow.getSteps()) {
    if (step == this.workflow.getFirstStep() || step == this.workflow.getCheckerStep()) {
      continue;
    }
    final int stepNumber=step.getNumber();
    AbstractStep abstractStep=(AbstractStep)step;
    for (    StepOutputPort outputPort : abstractStep.getWorkflowOutputPorts()) {
      for (      StepInputPort link : outputPort.getLinks()) {
        final AbstractStep linkedStep=link.getStep();
        if (linkedStep == this.workflow.getFirstStep() || linkedStep == this.workflow.getCheckerStep()) {
          continue;
        }
        linkedSteps.put(linkedStep,abstractStep);
        sb.append("String_Node_Str");
        sb.append(stepNumber);
        sb.append("String_Node_Str");
        sb.append(linkedStep.getNumber());
        sb.append("String_Node_Str");
        final DataFormat format=outputPort.getFormat();
        String formatName=format.getAlias() == null || "String_Node_Str".equals(format.getAlias()) ? format.getName() : format.getAlias();
        sb.append(formatName);
        sb.append("String_Node_Str");
      }
    }
  }
  for (  Step step : this.workflow.getSteps()) {
    if (step == this.workflow.getFirstStep() || step == this.workflow.getCheckerStep()) {
      continue;
    }
    AbstractStep abstractStep=(AbstractStep)step;
    StepStateObserver observer=((AbstractStep)step).getStepStateObserver();
    Set<AbstractStep> requiredSteps=new HashSet<>(observer.getRequiredSteps());
    requiredSteps.removeAll(linkedSteps.get(abstractStep));
    requiredSteps.remove(this.workflow.getFirstStep());
    requiredSteps.remove(this.workflow.getCheckerStep());
    for (    AbstractStep requiredStep : requiredSteps) {
      sb.append("String_Node_Str");
      sb.append(requiredStep.getNumber());
      sb.append("String_Node_Str");
      sb.append(step.getNumber());
      sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}