Program: 58871
Project: 58871
Buggy source:
public void getLines(ProjectTask projectTask,List<SaleOrderLine> saleOrderLineList,List<PurchaseOrderLine> purchaseOrderLineList,List<TimesheetLine> timesheetLineList,List<ExpenseLine> expenseLineList,List<ElementsToInvoice> elementsToInvoiceList,List<ProjectTask> projectTaskList,int counter){
  if (counter > MAX_LEVEL_OF_PROJECT) {
    return;
  }
  counter++;
  if (projectTask.getInvoicingTypeSelect() == ProjectTaskRepository.INVOICING_TYPE_FLAT_RATE || projectTask.getInvoicingTypeSelect() == ProjectTaskRepository.INVOICING_TYPE_TIME_BASED) {
    saleOrderLineList.addAll(Beans.get(SaleOrderLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    purchaseOrderLineList.addAll(Beans.get(PurchaseOrderLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    timesheetLineList.addAll(Beans.get(TimesheetLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    expenseLineList.addAll(Beans.get(ExpenseLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    elementsToInvoiceList.addAll(Beans.get(ElementsToInvoiceRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    if (projectTask.getInvoicingTypeSelect() == ProjectTaskRepository.INVOICING_TYPE_FLAT_RATE) {
      projectTaskList.addAll(Beans.get(ProjectTaskRepository.class).all().filter("String_Node_Str",projectTask.getId()).fetch());
    }
  }
  List<ProjectTask> projectTaskChildrenList=Beans.get(ProjectTaskRepository.class).all().filter("String_Node_Str",projectTask).fetch();
  for (  ProjectTask projectTaskChild : projectTaskChildrenList) {
    this.getLines(projectTaskChild,saleOrderLineList,purchaseOrderLineList,timesheetLineList,expenseLineList,elementsToInvoiceList,projectTaskList,counter);
  }
  return;
}

Fixed version (ground truth):
public void getLines(ProjectTask projectTask,List<SaleOrderLine> saleOrderLineList,List<PurchaseOrderLine> purchaseOrderLineList,List<TimesheetLine> timesheetLineList,List<ExpenseLine> expenseLineList,List<ElementsToInvoice> elementsToInvoiceList,List<ProjectTask> projectTaskList,int counter){
  if (counter > MAX_LEVEL_OF_PROJECT) {
    return;
  }
  counter++;
  if (projectTask.getInvoicingTypeSelect() == ProjectTaskRepository.INVOICING_TYPE_FLAT_RATE || projectTask.getInvoicingTypeSelect() == ProjectTaskRepository.INVOICING_TYPE_TIME_BASED) {
    saleOrderLineList.addAll(Beans.get(SaleOrderLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    purchaseOrderLineList.addAll(Beans.get(PurchaseOrderLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    timesheetLineList.addAll(Beans.get(TimesheetLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    expenseLineList.addAll(Beans.get(ExpenseLineRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    elementsToInvoiceList.addAll(Beans.get(ElementsToInvoiceRepository.class).all().filter("String_Node_Str",projectTask).fetch());
    if (projectTask.getInvoicingTypeSelect() == ProjectTaskRepository.INVOICING_TYPE_FLAT_RATE && !projectTask.getInvoiced()) {
      projectTaskList.add(projectTask);
    }
  }
  List<ProjectTask> projectTaskChildrenList=Beans.get(ProjectTaskRepository.class).all().filter("String_Node_Str",projectTask).fetch();
  for (  ProjectTask projectTaskChild : projectTaskChildrenList) {
    this.getLines(projectTaskChild,saleOrderLineList,purchaseOrderLineList,timesheetLineList,expenseLineList,elementsToInvoiceList,projectTaskList,counter);
  }
  return;
}