Program: 59022
Project: 59022
Buggy source:
public void runCreateReimbursementExport(Company company){
  List<Reimbursement> reimbursementList=Reimbursement.filter("String_Node_Str",company).fetch();
  List<Partner> partnerList=Partner.filter("String_Node_Str",company).fetch();
  int i=0;
  for (  Reimbursement reimbursement : reimbursementList) {
    LOG.debug("String_Node_Str",reimbursement.getRef());
    updateReimbursement(Reimbursement.find(reimbursement.getId()));
  }
  for (  Partner partner : partnerList) {
    try {
      partner=Partner.find(partner.getId());
      LOG.debug("String_Node_Str",partner.getName());
      if (reimbursementExportService.canBeReimbursed(partner,Company.find(company.getId()))) {
        List<MoveLine> moveLineList=MoveLine.all().filter("String_Node_Str" + "String_Node_Str" + "String_Node_Str",IMove.VALIDATED_MOVE,Partner.find(partner.getId()),Company.find(company.getId()),IAccount.NULL).fetch();
        LOG.debug("String_Node_Str",moveLineList);
        if (moveLineList != null && moveLineList.size() != 0) {
          Reimbursement reimbursement=reimbursementExportService.runCreateReimbursement(moveLineList,Company.find(company.getId()),Partner.find(partner.getId()));
          if (reimbursement != null) {
            updateReimbursement(Reimbursement.find(reimbursement.getId()));
            this.totalAmount=this.totalAmount.add(Reimbursement.find(reimbursement.getId()).getAmountToReimburse());
            i++;
          }
        }
      }
    }
 catch (    AxelorException e) {
      TraceBackService.trace(new AxelorException(String.format("String_Node_Str",Partner.find(partner.getId()).getName()),e,e.getcategory()),IException.REIMBURSEMENT,batch.getId());
      incrementAnomaly();
    }
catch (    Exception e) {
      TraceBackService.trace(new Exception(String.format("String_Node_Str",Partner.find(partner.getId()).getName()),e),IException.REIMBURSEMENT,batch.getId());
      incrementAnomaly();
      LOG.error("String_Node_Str",Partner.find(partner.getId()).getName());
    }
 finally {
      if (i % 10 == 0) {
        JPA.clear();
      }
    }
  }
}

Fixed version (ground truth):
public void runCreateReimbursementExport(Company company){
  List<Reimbursement> reimbursementList=(List<Reimbursement>)Reimbursement.filter("String_Node_Str",company).fetch();
  List<Partner> partnerList=(List<Partner>)Partner.filter("String_Node_Str",company).fetch();
  int i=0;
  for (  Reimbursement reimbursement : reimbursementList) {
    LOG.debug("String_Node_Str",reimbursement.getRef());
    updateReimbursement(Reimbursement.find(reimbursement.getId()));
  }
  for (  Partner partner : partnerList) {
    try {
      partner=Partner.find(partner.getId());
      LOG.debug("String_Node_Str",partner.getName());
      if (reimbursementExportService.canBeReimbursed(partner,Company.find(company.getId()))) {
        List<MoveLine> moveLineList=(List<MoveLine>)MoveLine.all().filter("String_Node_Str" + "String_Node_Str" + "String_Node_Str",IMove.VALIDATED_MOVE,Partner.find(partner.getId()),Company.find(company.getId()),IAccount.NULL).fetch();
        LOG.debug("String_Node_Str",moveLineList);
        if (moveLineList != null && moveLineList.size() != 0) {
          Reimbursement reimbursement=reimbursementExportService.runCreateReimbursement(moveLineList,Company.find(company.getId()),Partner.find(partner.getId()));
          if (reimbursement != null) {
            updateReimbursement(Reimbursement.find(reimbursement.getId()));
            this.totalAmount=this.totalAmount.add(Reimbursement.find(reimbursement.getId()).getAmountToReimburse());
            i++;
          }
        }
      }
    }
 catch (    AxelorException e) {
      TraceBackService.trace(new AxelorException(String.format("String_Node_Str",Partner.find(partner.getId()).getName()),e,e.getcategory()),IException.REIMBURSEMENT,batch.getId());
      incrementAnomaly();
    }
catch (    Exception e) {
      TraceBackService.trace(new Exception(String.format("String_Node_Str",Partner.find(partner.getId()).getName()),e),IException.REIMBURSEMENT,batch.getId());
      incrementAnomaly();
      LOG.error("String_Node_Str",Partner.find(partner.getId()).getName());
    }
 finally {
      if (i % 10 == 0) {
        JPA.clear();
      }
    }
  }
}