Program: 189202
Project: 189202
Buggy source:
protected void exportMilestone(Milestone milestone,StringBuffer ret){
  final boolean burndown=Boolean.parseBoolean(milestone.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_BURNDOWN));
  ret.append("String_Node_Str");
  ret.append(milestone.getName());
  ret.append("String_Node_Str");
  if (milestone.getDueDate() == null) {
    ret.append("String_Node_Str");
  }
 else {
    ret.append(milestone.getDueDate());
  }
  ret.append("String_Node_Str");
  List<Date> dates=((HibernateStorage)Manager.getStorageInstance()).getResourceManager().getMilestoneDates(milestone,true);
  if (burndown) {
    ret.append("String_Node_Str");
  }
 else {
    ret.append("String_Node_Str");
  }
  ret.append("String_Node_Str");
  if (burndown) {
    ret.append("String_Node_Str");
  }
 else {
    ret.append("String_Node_Str");
  }
  boolean first=true;
  for (  Date date : dates) {
    if (first) {
      first=false;
      continue;
    }
    ret.append("String_Node_Str");
    ret.append(date);
  }
  ret.append("String_Node_Str");
  for (  Issue issue : milestone.getIssues()) {
    ret.append("String_Node_Str");
    ret.append(issue.getId());
    ret.append("String_Node_Str");
    ret.append(issue.getSummary().replace("String_Node_Str","String_Node_Str"));
    ret.append("String_Node_Str");
    ret.append(IssueUtils.getStatusName(issue.getStatus()));
    ret.append("String_Node_Str");
    if (issue.getAssignee() != null) {
      ret.append(issue.getAssignee().getUsername());
    }
    Duration estimate=null;
    if (burndown) {
      estimate=issue.getTimeEstimate();
      Date firstDay=dates.get(0);
      for (      DurationWorked worked : issue.getTimeWorked()) {
        if (estimate == null || (worked.getDay().before(firstDay) && worked.getUpdatedRequired() != null && worked.getUpdatedRequired().getHours() < estimate.getHours())) {
          estimate=worked.getUpdatedRequired();
        }
      }
    }
    if (estimate == null) {
      estimate=new Duration(0);
      Date firstDay=dates.get(0);
      for (      DurationWorked worked : issue.getTimeWorked()) {
        if (worked.getDay().before(firstDay) && worked.getUpdatedRequired() != null && worked.getUpdatedRequired().getHours() > estimate.getHours()) {
          estimate=worked.getUpdatedRequired();
        }
      }
    }
    for (    Date date : dates) {
      Duration est=((HibernateStorage)Manager.getStorageInstance()).getResourceManager().lastEstimateForDay(issue,date);
      if (est != null) {
        estimate=est;
      }
      ret.append("String_Node_Str");
      ret.append(estimate.getHours());
    }
    ret.append("String_Node_Str");
  }
  ret.append("String_Node_Str");
  dates.remove(0);
  ret.append("String_Node_Str");
  for (  Date date : dates) {
    ret.append("String_Node_Str");
    ret.append(date);
  }
  ret.append("String_Node_Str");
  for (  Issue issue : milestone.getIssues()) {
    ret.append(issue.getId());
    ret.append("String_Node_Str");
    ret.append("String_Node_Str");
    ret.append(issue.getSummary());
    ret.append("String_Node_Str");
    ret.append(IssueUtils.getStatusName(issue.getStatus()));
    StringBuilder hourLog=new StringBuilder();
    double totalHours=0;
    for (    Date date : dates) {
      hourLog.append("String_Node_Str");
      Duration total=((HibernateStorage)Manager.getStorageInstance()).getResourceManager().totalWorkedForDay(issue,date);
      if (total != null) {
        hourLog.append(total.getHours());
        totalHours+=total.getHours();
      }
 else {
        hourLog.append("String_Node_Str");
      }
    }
    ret.append("String_Node_Str");
    if (issue.getAssignee() != null) {
      ret.append(issue.getAssignee().getUsername());
    }
    ret.append("String_Node_Str");
    ret.append(totalHours);
    ret.append(hourLog.toString());
    ret.append("String_Node_Str");
  }
  ret.append("String_Node_Str");
}

Fixed version (ground truth):
protected void exportMilestone(Milestone milestone,StringBuffer ret){
  final boolean burndown=Boolean.parseBoolean(milestone.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_BURNDOWN));
  ret.append("String_Node_Str");
  ret.append(milestone.getName());
  ret.append("String_Node_Str");
  if (milestone.getDueDate() == null) {
    ret.append("String_Node_Str");
  }
 else {
    ret.append(milestone.getDueDate());
  }
  ret.append("String_Node_Str");
  List<Date> dates=((HibernateStorage)Manager.getStorageInstance()).getResourceManager().getMilestoneDates(milestone,true);
  if (burndown) {
    ret.append("String_Node_Str");
  }
 else {
    ret.append("String_Node_Str");
  }
  ret.append("String_Node_Str");
  if (burndown) {
    ret.append("String_Node_Str");
  }
 else {
    ret.append("String_Node_Str");
  }
  boolean first=true;
  for (  Date date : dates) {
    if (first) {
      first=false;
      continue;
    }
    ret.append("String_Node_Str");
    ret.append(date);
  }
  ret.append("String_Node_Str");
  for (  Issue issue : milestone.getIssues()) {
    ret.append("String_Node_Str");
    ret.append(issue.getId());
    ret.append("String_Node_Str");
    ret.append(issue.getSummary().replace("String_Node_Str","String_Node_Str"));
    ret.append("String_Node_Str");
    ret.append(IssueUtils.getStatusName(issue.getStatus()));
    ret.append("String_Node_Str");
    if (issue.getAssignee() != null) {
      ret.append(issue.getAssignee().getUsername());
    }
    Duration estimate=null;
    if (burndown) {
      estimate=issue.getTimeEstimate();
      if (dates.size() > 0) {
        Date firstDay=dates.get(0);
        for (        DurationWorked worked : issue.getTimeWorked()) {
          if (estimate == null || (worked.getDay().before(firstDay) && worked.getUpdatedRequired() != null && worked.getUpdatedRequired().getHours() < estimate.getHours())) {
            estimate=worked.getUpdatedRequired();
          }
        }
      }
    }
    if (estimate == null) {
      estimate=new Duration(0);
      if (dates.size() > 0) {
        Date firstDay=dates.get(0);
        for (        DurationWorked worked : issue.getTimeWorked()) {
          if (worked.getDay().before(firstDay) && worked.getUpdatedRequired() != null && worked.getUpdatedRequired().getHours() > estimate.getHours()) {
            estimate=worked.getUpdatedRequired();
          }
        }
      }
    }
    for (    Date date : dates) {
      Duration est=((HibernateStorage)Manager.getStorageInstance()).getResourceManager().lastEstimateForDay(issue,date);
      if (est != null) {
        estimate=est;
      }
      ret.append("String_Node_Str");
      ret.append(estimate.getHours());
    }
    ret.append("String_Node_Str");
  }
  ret.append("String_Node_Str");
  if (dates.size() > 0) {
    dates.remove(0);
  }
  ret.append("String_Node_Str");
  for (  Date date : dates) {
    ret.append("String_Node_Str");
    ret.append(date);
  }
  ret.append("String_Node_Str");
  for (  Issue issue : milestone.getIssues()) {
    ret.append(issue.getId());
    ret.append("String_Node_Str");
    ret.append("String_Node_Str");
    ret.append(issue.getSummary());
    ret.append("String_Node_Str");
    ret.append(IssueUtils.getStatusName(issue.getStatus()));
    StringBuilder hourLog=new StringBuilder();
    double totalHours=0;
    for (    Date date : dates) {
      hourLog.append("String_Node_Str");
      Duration total=((HibernateStorage)Manager.getStorageInstance()).getResourceManager().totalWorkedForDay(issue,date);
      if (total != null) {
        hourLog.append(total.getHours());
        totalHours+=total.getHours();
      }
 else {
        hourLog.append("String_Node_Str");
      }
    }
    ret.append("String_Node_Str");
    if (issue.getAssignee() != null) {
      ret.append(issue.getAssignee().getUsername());
    }
    ret.append("String_Node_Str");
    ret.append(totalHours);
    ret.append(hourLog.toString());
    ret.append("String_Node_Str");
  }
  ret.append("String_Node_Str");
}