nus-yam/ex-repair huggingface dataset:
Program: 58848
Project: 58848
Buggy source:
public void finish(ActionRequest request,ActionResponse response) throws AxelorException {
  OperationOrder operationOrder=request.getContext().asType(OperationOrder.class);
  OperationOrderWorkflowService operationOrderWorkflowService=Beans.get(OperationOrderWorkflowService.class);
  operationOrderWorkflowService.finish(operationOrderWorkflowService.find(operationOrder.getId()));
  response.setReload(true);
}

Fixed version (ground truth):
public void finish(ActionRequest request,ActionResponse response) throws AxelorException {
  OperationOrder operationOrder=request.getContext().asType(OperationOrder.class);
  OperationOrderWorkflowService operationOrderWorkflowService=Beans.get(OperationOrderWorkflowService.class);
  operationOrder=operationOrderWorkflowService.finish(operationOrderWorkflowService.find(operationOrder.getId()));
  response.setValues(operationOrder);
}
Program: 58849
Project: 58849
Buggy source:
public void plan(ActionRequest request,ActionResponse response) throws AxelorException {
  OperationOrder operationOrder=request.getContext().asType(OperationOrder.class);
  OperationOrderWorkflowService operationOrderWorkflowService=Beans.get(OperationOrderWorkflowService.class);
  operationOrderWorkflowService.plan(operationOrderWorkflowService.find(operationOrder.getId()));
  response.setReload(true);
}

Fixed version (ground truth):
public void plan(ActionRequest request,ActionResponse response) throws AxelorException {
  OperationOrder operationOrder=request.getContext().asType(OperationOrder.class);
  OperationOrderWorkflowService operationOrderWorkflowService=Beans.get(OperationOrderWorkflowService.class);
  operationOrder=operationOrderWorkflowService.plan(operationOrderWorkflowService.find(operationOrder.getId()));
  response.setValues(operationOrder);
}
Program: 58850
Project: 58850
Buggy source:
@Override public BigDecimal computeAmount(SaleOrderLine saleOrderLine){
  BigDecimal price=this.computeDiscount(saleOrderLine);
  BigDecimal amount=saleOrderLine.getQty().multiply(price).setScale(IAdministration.DEFAULT_NB_DECIMAL_DIGITS,RoundingMode.HALF_EVEN);
  if (ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(saleOrderLine.getProduct().getProductTypeSelect())) {
    amount=amount.multiply(new BigDecimal(saleOrderLine.getSubscriptionList().size())).setScale(IAdministration.DEFAULT_NB_DECIMAL_DIGITS,RoundingMode.HALF_EVEN);
  }
  LOG.debug("String_Node_Str",new Object[]{saleOrderLine.getQty(),price,amount});
  return amount;
}

Fixed version (ground truth):
@Override public BigDecimal computeAmount(SaleOrderLine saleOrderLine){
  BigDecimal price=this.computeDiscount(saleOrderLine);
  BigDecimal amount=saleOrderLine.getQty().multiply(price).setScale(IAdministration.DEFAULT_NB_DECIMAL_DIGITS,RoundingMode.HALF_EVEN);
  if (ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(saleOrderLine.getProduct().getProductTypeSelect()) && saleOrderLine.getSubscriptionList() != null && !saleOrderLine.getSubscriptionList().isEmpty()) {
    amount=amount.multiply(new BigDecimal(saleOrderLine.getSubscriptionList().size())).setScale(IAdministration.DEFAULT_NB_DECIMAL_DIGITS,RoundingMode.HALF_EVEN);
  }
  LOG.debug("String_Node_Str",new Object[]{saleOrderLine.getQty(),price,amount});
  return amount;
}
Program: 58851
Project: 58851
Buggy source:
public BigDecimal convertDiscountAmount(InvoiceLine invoiceLine,Invoice invoice){
  BigDecimal discountAmount=BigDecimal.ZERO;
  if (invoiceLine.getDiscountTypeSelect() == IPriceListLine.AMOUNT_TYPE_FIXED) {
    discountAmount=invoiceLine.getProduct().getSalePrice().subtract(this.computeDiscount(invoiceLine,invoice));
    if (invoice.getOperationTypeSelect() < 2) {
      discountAmount=invoiceLine.getProduct().getPurchasePrice().subtract(this.computeDiscount(invoiceLine,invoice));
    }
  }
 else {
    discountAmount=(invoiceLine.getProduct().getSalePrice().subtract(this.computeDiscount(invoiceLine,invoice))).multiply(new BigDecimal(100)).divide(invoiceLine.getProduct().getSalePrice());
    if (invoice.getOperationTypeSelect() < 2) {
      discountAmount=(invoiceLine.getProduct().getPurchasePrice().subtract(this.computeDiscount(invoiceLine,invoice))).multiply(new BigDecimal(100)).divide(invoiceLine.getProduct().getPurchasePrice());
    }
  }
  if (invoiceLine.getProduct().getInAti() && !invoice.getInAti()) {
    discountAmount=discountAmount.divide(invoiceLine.getTaxLine().getValue().add(new BigDecimal(1)),2,BigDecimal.ROUND_HALF_UP);
  }
 else   if (!invoiceLine.getProduct().getInAti() && invoice.getInAti()) {
    discountAmount=discountAmount.add(discountAmount.multiply(invoiceLine.getTaxLine().getValue()));
  }
  return discountAmount;
}

Fixed version (ground truth):
public BigDecimal convertDiscountAmount(InvoiceLine invoiceLine,Invoice invoice){
  BigDecimal discountAmount=BigDecimal.ZERO;
  if (invoiceLine.getDiscountTypeSelect() == IPriceListLine.AMOUNT_TYPE_FIXED) {
    discountAmount=invoiceLine.getPrice().subtract(this.computeDiscount(invoiceLine,invoice));
    if (invoice.getOperationTypeSelect() < 2) {
      discountAmount=invoiceLine.getPrice().subtract(this.computeDiscount(invoiceLine,invoice));
    }
  }
 else {
    discountAmount=(invoiceLine.getPrice().subtract(this.computeDiscount(invoiceLine,invoice))).multiply(new BigDecimal(100)).divide(invoiceLine.getProduct().getSalePrice());
    if (invoice.getOperationTypeSelect() < 2) {
      discountAmount=(invoiceLine.getPrice().subtract(this.computeDiscount(invoiceLine,invoice))).multiply(new BigDecimal(100)).divide(invoiceLine.getProduct().getPurchasePrice());
    }
  }
  if (invoiceLine.getProduct().getInAti() && !invoice.getInAti()) {
    discountAmount=discountAmount.divide(invoiceLine.getTaxLine().getValue().add(new BigDecimal(1)),2,BigDecimal.ROUND_HALF_UP);
  }
 else   if (!invoiceLine.getProduct().getInAti() && invoice.getInAti()) {
    discountAmount=discountAmount.add(discountAmount.multiply(invoiceLine.getTaxLine().getValue()));
  }
  return discountAmount;
}
Program: 58852
Project: 58852
Buggy source:
public LeaveLine computeQuantityAvailable(LeaveLine leaveLine){
  List<LeaveManagement> leaveManagementList=leaveLine.getLeaveManagementList();
  for (  LeaveManagement leaveManagement : leaveManagementList) {
    if (!leaveManagement.getCounted()) {
      leaveLine.setQuantity(leaveLine.getQuantity().subtract(leaveManagement.getOldValue()));
      leaveLine.setQuantity(leaveLine.getQuantity().add(leaveManagement.getValue()));
      leaveManagement.setOldValue(leaveManagement.getValue());
      leaveManagement.setCounted(true);
    }
  }
  return leaveLine;
}

Fixed version (ground truth):
public LeaveLine computeQuantityAvailable(LeaveLine leaveLine){
  List<LeaveManagement> leaveManagementList=leaveLine.getLeaveManagementList();
  leaveLine.setQuantity(BigDecimal.ZERO);
  if (leaveManagementList != null && !leaveManagementList.isEmpty()) {
    for (    LeaveManagement leaveManagement : leaveManagementList) {
      leaveLine.setQuantity(leaveLine.getQuantity().add(leaveManagement.getValue()));
    }
  }
  return leaveLine;
}
Program: 58853
Project: 58853
Buggy source:
@Override public Invoice save(Invoice invoice){
  try {
    invoice=super.save(invoice);
    Beans.get(InvoiceService.class).setDraftSequence(invoice);
    return invoice;
  }
 catch (  Exception e) {
    JPA.em().getTransaction().rollback();
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public Invoice save(Invoice invoice){
  try {
    invoice=super.save(invoice);
    Beans.get(InvoiceService.class).setDraftSequence(invoice);
    return invoice;
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}
Program: 58854
Project: 58854
Buggy source:
@Override public Partner save(Partner partner){
  try {
    super.save(partner);
    List<AccountingSituation> accountingSituationList=Beans.get(AccountingSituationService.class).createAccountingSituation(Beans.get(PartnerRepository.class).find(partner.getId()));
    if (accountingSituationList != null) {
      partner.setAccountingSituationList(accountingSituationList);
    }
    return JPA.save(partner);
  }
 catch (  Exception e) {
    JPA.em().getTransaction().rollback();
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public Partner save(Partner partner){
  try {
    List<AccountingSituation> accountingSituationList=Beans.get(AccountingSituationService.class).createAccountingSituation(Beans.get(PartnerRepository.class).find(partner.getId()));
    if (accountingSituationList != null) {
      partner.setAccountingSituationList(accountingSituationList);
    }
    return super.save(partner);
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}
Program: 58855
Project: 58855
Buggy source:
@Override public Duration save(Duration duration){
  try {
    duration.setName(this.computeName(duration.getTypeSelect(),duration.getValue()));
    return super.save(duration);
  }
 catch (  Exception e) {
    JPA.em().getTransaction().rollback();
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public Duration save(Duration duration){
  try {
    duration.setName(this.computeName(duration.getTypeSelect(),duration.getValue()));
    return super.save(duration);
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}
Program: 58856
Project: 58856
Buggy source:
@Override public Partner save(Partner partner){
  try {
    if (partner.getPartnerSeq() == null) {
      String seq=Beans.get(SequenceService.class).getSequenceNumber(IAdministration.PARTNER);
      if (seq == null)       throw new AxelorException(I18n.get(IExceptionMessage.PARTNER_1),IException.CONFIGURATION_ERROR);
      partner.setPartnerSeq(seq);
    }
    return super.save(partner);
  }
 catch (  Exception e) {
    JPA.em().getTransaction().rollback();
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public Partner save(Partner partner){
  try {
    if (partner.getPartnerSeq() == null) {
      String seq=Beans.get(SequenceService.class).getSequenceNumber(IAdministration.PARTNER);
      if (seq == null)       throw new AxelorException(I18n.get(IExceptionMessage.PARTNER_1),IException.CONFIGURATION_ERROR);
      partner.setPartnerSeq(seq);
    }
    return super.save(partner);
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}
Program: 58857
Project: 58857
Buggy source:
public void ventilate(ActionRequest request,ActionResponse response) throws AxelorException {
  Expense expense=request.getContext().asType(Expense.class);
  expense=Beans.get(ExpenseRepository.class).find(expense.getId());
  Move move=expenseService.ventilate(expense);
  response.setReload(true);
  response.setView(ActionView.define("String_Node_Str").model(Move.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").context("String_Node_Str",String.valueOf(move.getId())).map());
}

Fixed version (ground truth):
public void ventilate(ActionRequest request,ActionResponse response) throws AxelorException {
  Expense expense=request.getContext().asType(Expense.class);
  expense=Beans.get(ExpenseRepository.class).find(expense.getId());
  Move move=expenseService.ventilate(expense);
  response.setReload(true);
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Move.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").context("String_Node_Str",String.valueOf(move.getId())).map());
}
Program: 58858
Project: 58858
Buggy source:
public void validateExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Query.of(Expense.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  if (AuthUtils.getUser().getEmployee() != null && AuthUtils.getUser().getEmployee().getManager() == null) {
    expenseList=Query.of(Expense.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  }
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  String expenseListIdStr="String_Node_Str";
  if (!expenseListId.isEmpty()) {
    expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
  }
  response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
}

Fixed version (ground truth):
public void validateExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Query.of(Expense.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  if (AuthUtils.getUser().getEmployee() != null && AuthUtils.getUser().getEmployee().getManager() == null) {
    expenseList=Query.of(Expense.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  }
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  String expenseListIdStr="String_Node_Str";
  if (!expenseListId.isEmpty()) {
    expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
  }
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
}
Program: 58859
Project: 58859
Buggy source:
public void editExpenseSelected(ActionRequest request,ActionResponse response){
  Map expenseMap=(Map)request.getContext().get("String_Node_Str");
  Expense expense=Beans.get(ExpenseRepository.class).find(new Long((Integer)expenseMap.get("String_Node_Str")));
  response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseMap.get("String_Node_Str")).context("String_Node_Str",String.valueOf(expense.getId())).map());
}

Fixed version (ground truth):
public void editExpenseSelected(ActionRequest request,ActionResponse response){
  Map expenseMap=(Map)request.getContext().get("String_Node_Str");
  Expense expense=Beans.get(ExpenseRepository.class).find(new Long((Integer)expenseMap.get("String_Node_Str")));
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseMap.get("String_Node_Str")).context("String_Node_Str",String.valueOf(expense.getId())).map());
}
Program: 58860
Project: 58860
Buggy source:
public void allExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Beans.get(ExpenseRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  String expenseListIdStr="String_Node_Str";
  if (!expenseListId.isEmpty()) {
    expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
  }
  response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
}

Fixed version (ground truth):
public void allExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Beans.get(ExpenseRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  String expenseListIdStr="String_Node_Str";
  if (!expenseListId.isEmpty()) {
    expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
  }
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
}
Program: 58861
Project: 58861
Buggy source:
public void showSubordinateExpenses(ActionRequest request,ActionResponse response){
  List<User> userList=Query.of(User.class).filter("String_Node_Str",AuthUtils.getUser()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  User user : userList) {
    List<Expense> expenseList=Query.of(Expense.class).filter("String_Node_Str",user,AuthUtils.getUser().getActiveCompany()).fetch();
    for (    Expense expense : expenseList) {
      expenseListId.add(expense.getId());
    }
  }
  if (expenseListId.isEmpty()) {
    response.setNotify(I18n.get("String_Node_Str"));
  }
 else {
    String expenseListIdStr="String_Node_Str";
    if (!expenseListId.isEmpty()) {
      expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
    }
    response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
  }
}

Fixed version (ground truth):
public void showSubordinateExpenses(ActionRequest request,ActionResponse response){
  List<User> userList=Query.of(User.class).filter("String_Node_Str",AuthUtils.getUser()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  User user : userList) {
    List<Expense> expenseList=Query.of(Expense.class).filter("String_Node_Str",user,AuthUtils.getUser().getActiveCompany()).fetch();
    for (    Expense expense : expenseList) {
      expenseListId.add(expense.getId());
    }
  }
  if (expenseListId.isEmpty()) {
    response.setNotify(I18n.get("String_Node_Str"));
  }
 else {
    String expenseListIdStr="String_Node_Str";
    if (!expenseListId.isEmpty()) {
      expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
    }
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
  }
}
Program: 58862
Project: 58862
Buggy source:
public void editExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Beans.get(ExpenseRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  if (expenseList.isEmpty()) {
    response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").map());
  }
 else   if (expenseList.size() == 1) {
    response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").context("String_Node_Str",String.valueOf(expenseList.get(0).getId())).map());
  }
 else {
    response.setView(ActionView.define("String_Node_Str").model(Wizard.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").map());
  }
}

Fixed version (ground truth):
public void editExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Beans.get(ExpenseRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  if (expenseList.isEmpty()) {
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").map());
  }
 else   if (expenseList.size() == 1) {
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").context("String_Node_Str",String.valueOf(expenseList.get(0).getId())).map());
  }
 else {
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Wizard.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").map());
  }
}
Program: 58863
Project: 58863
Buggy source:
public void historicExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Beans.get(ExpenseRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  String expenseListIdStr="String_Node_Str";
  if (!expenseListId.isEmpty()) {
    expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
  }
  response.setView(ActionView.define("String_Node_Str").model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
}

Fixed version (ground truth):
public void historicExpense(ActionRequest request,ActionResponse response){
  List<Expense> expenseList=Beans.get(ExpenseRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> expenseListId=new ArrayList<Long>();
  for (  Expense expense : expenseList) {
    expenseListId.add(expense.getId());
  }
  String expenseListIdStr="String_Node_Str";
  if (!expenseListId.isEmpty()) {
    expenseListIdStr=Joiner.on("String_Node_Str").join(expenseListId);
  }
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Expense.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + expenseListIdStr + "String_Node_Str").map());
}
Program: 58864
Project: 58864
Buggy source:
public void validateLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Query.of(LeaveRequest.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  if (AuthUtils.getUser().getEmployee() != null && AuthUtils.getUser().getEmployee().getManager() == null) {
    leaveList=Query.of(LeaveRequest.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  }
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  String leaveListIdStr="String_Node_Str";
  if (!leaveListId.isEmpty()) {
    leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
  }
  response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
}

Fixed version (ground truth):
public void validateLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Query.of(LeaveRequest.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  if (AuthUtils.getUser().getEmployee() != null && AuthUtils.getUser().getEmployee().getManager() == null) {
    leaveList=Query.of(LeaveRequest.class).filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  }
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  String leaveListIdStr="String_Node_Str";
  if (!leaveListId.isEmpty()) {
    leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
  }
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
}
Program: 58865
Project: 58865
Buggy source:
public void allLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Beans.get(LeaveRequestRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  String leaveListIdStr="String_Node_Str";
  if (!leaveListId.isEmpty()) {
    leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
  }
  response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
}

Fixed version (ground truth):
public void allLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Beans.get(LeaveRequestRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  String leaveListIdStr="String_Node_Str";
  if (!leaveListId.isEmpty()) {
    leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
  }
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
}
Program: 58866
Project: 58866
Buggy source:
public void historicLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Beans.get(LeaveRequestRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  String leaveListIdStr="String_Node_Str";
  if (!leaveListId.isEmpty()) {
    leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
  }
  response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
}

Fixed version (ground truth):
public void historicLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Beans.get(LeaveRequestRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  LeaveRequest leave : leaveList) {
    leaveListId.add(leave.getId());
  }
  String leaveListIdStr="String_Node_Str";
  if (!leaveListId.isEmpty()) {
    leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
  }
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
}
Program: 58867
Project: 58867
Buggy source:
public void editLeaveSelected(ActionRequest request,ActionResponse response){
  Map leaveMap=(Map)request.getContext().get("String_Node_Str");
  LeaveRequest leave=Beans.get(LeaveRequestRepository.class).find(new Long((Integer)leaveMap.get("String_Node_Str")));
  response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveMap.get("String_Node_Str")).context("String_Node_Str",String.valueOf(leave.getId())).map());
}

Fixed version (ground truth):
public void editLeaveSelected(ActionRequest request,ActionResponse response){
  Map leaveMap=(Map)request.getContext().get("String_Node_Str");
  LeaveRequest leave=Beans.get(LeaveRequestRepository.class).find(new Long((Integer)leaveMap.get("String_Node_Str")));
  response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveMap.get("String_Node_Str")).context("String_Node_Str",String.valueOf(leave.getId())).map());
}
Program: 58868
Project: 58868
Buggy source:
public void showSubordinateLeaves(ActionRequest request,ActionResponse response){
  List<User> userList=Query.of(User.class).filter("String_Node_Str",AuthUtils.getUser()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  User user : userList) {
    List<LeaveRequest> leaveList=Query.of(LeaveRequest.class).filter("String_Node_Str",user,AuthUtils.getUser().getActiveCompany()).fetch();
    for (    LeaveRequest leave : leaveList) {
      leaveListId.add(leave.getId());
    }
  }
  if (leaveListId.isEmpty()) {
    response.setNotify(I18n.get("String_Node_Str"));
  }
 else {
    String leaveListIdStr="String_Node_Str";
    if (!leaveListId.isEmpty()) {
      leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
    }
    response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
  }
}

Fixed version (ground truth):
public void showSubordinateLeaves(ActionRequest request,ActionResponse response){
  List<User> userList=Query.of(User.class).filter("String_Node_Str",AuthUtils.getUser()).fetch();
  List<Long> leaveListId=new ArrayList<Long>();
  for (  User user : userList) {
    List<LeaveRequest> leaveList=Query.of(LeaveRequest.class).filter("String_Node_Str",user,AuthUtils.getUser().getActiveCompany()).fetch();
    for (    LeaveRequest leave : leaveList) {
      leaveListId.add(leave.getId());
    }
  }
  if (leaveListId.isEmpty()) {
    response.setNotify(I18n.get("String_Node_Str"));
  }
 else {
    String leaveListIdStr="String_Node_Str";
    if (!leaveListId.isEmpty()) {
      leaveListIdStr=Joiner.on("String_Node_Str").join(leaveListId);
    }
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + leaveListIdStr + "String_Node_Str").map());
  }
}
Program: 58869
Project: 58869
Buggy source:
public void editLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Beans.get(LeaveRequestRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  if (leaveList.isEmpty()) {
    response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").map());
  }
 else   if (leaveList.size() == 1) {
    response.setView(ActionView.define("String_Node_Str").model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").context("String_Node_Str",String.valueOf(leaveList.get(0).getId())).map());
  }
 else {
    response.setView(ActionView.define("String_Node_Str").model(Wizard.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").map());
  }
}

Fixed version (ground truth):
public void editLeave(ActionRequest request,ActionResponse response){
  List<LeaveRequest> leaveList=Beans.get(LeaveRequestRepository.class).all().filter("String_Node_Str",AuthUtils.getUser(),AuthUtils.getUser().getActiveCompany()).fetch();
  if (leaveList.isEmpty()) {
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").map());
  }
 else   if (leaveList.size() == 1) {
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(LeaveRequest.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").context("String_Node_Str",String.valueOf(leaveList.get(0).getId())).map());
  }
 else {
    response.setView(ActionView.define(I18n.get("String_Node_Str")).model(Wizard.class.getName()).add("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").param("String_Node_Str","String_Node_Str").map());
  }
}
Program: 58872
Project: 58872
Buggy source:
public String getDurationHoursImport(String duration){
  BigDecimal visibleDuration=new BigDecimal(duration);
  BigDecimal durationStored=employeeService.getDurationHours(visibleDuration);
  return durationStored.toString();
}

Fixed version (ground truth):
public String getDurationHoursImport(String duration) throws AxelorException {
  BigDecimal visibleDuration=new BigDecimal(duration);
  BigDecimal durationStored=employeeService.getDurationHours(visibleDuration);
  return durationStored.toString();
}
Program: 58873
Project: 58873
Buggy source:
public CurrencyService(LocalDate today){
  this.today=today;
}

Fixed version (ground truth):
public CurrencyService(LocalDate today){
  this.generalService=Beans.get(GeneralService.class);
  this.today=today;
}
Program: 58874
Project: 58874
Buggy source:
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<PurchaseOrderLine> purchaseOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  PurchaseOrderLine purchaseOrderLine : purchaseOrderLineList) {
    if (ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(purchaseOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,purchaseOrderLine));
      invoiceLineList.get(invoiceLineList.size() - 1).setProject(purchaseOrderLine.getProjectTask());
      purchaseOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}

Fixed version (ground truth):
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<PurchaseOrderLine> purchaseOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  PurchaseOrderLine purchaseOrderLine : purchaseOrderLineList) {
    if (!ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(purchaseOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,purchaseOrderLine));
      invoiceLineList.get(invoiceLineList.size() - 1).setProject(purchaseOrderLine.getProjectTask());
      purchaseOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}
Program: 58875
Project: 58875
Buggy source:
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<SaleOrderLine> saleOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  SaleOrderLine saleOrderLine : saleOrderLineList) {
    if (ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(saleOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,saleOrderLine));
      invoiceLineList.get(invoiceLineList.size() - 1).setProject(saleOrderLine.getProject());
      saleOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}

Fixed version (ground truth):
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<SaleOrderLine> saleOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  SaleOrderLine saleOrderLine : saleOrderLineList) {
    if (!ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(saleOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,saleOrderLine));
      invoiceLineList.get(invoiceLineList.size() - 1).setProject(saleOrderLine.getProject());
      saleOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}
Program: 58876
Project: 58876
Buggy source:
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<PurchaseOrderLine> purchaseOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  PurchaseOrderLine purchaseOrderLine : purchaseOrderLineList) {
    if (ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(purchaseOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,purchaseOrderLine));
      purchaseOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}

Fixed version (ground truth):
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<PurchaseOrderLine> purchaseOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  PurchaseOrderLine purchaseOrderLine : purchaseOrderLineList) {
    if (!ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(purchaseOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,purchaseOrderLine));
      purchaseOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}
Program: 58877
Project: 58877
Buggy source:
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<SaleOrderLine> saleOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  SaleOrderLine saleOrderLine : saleOrderLineList) {
    if (ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(saleOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,saleOrderLine));
      saleOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}

Fixed version (ground truth):
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<SaleOrderLine> saleOrderLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  SaleOrderLine saleOrderLine : saleOrderLineList) {
    if (!ProductRepository.PRODUCT_TYPE_SUBSCRIPTABLE.equals(saleOrderLine.getProduct().getProductTypeSelect())) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,saleOrderLine));
      saleOrderLine.setInvoiced(true);
    }
  }
  return invoiceLineList;
}
Program: 58878
Project: 58878
Buggy source:
@Inject public AccountCustomerService(AccountingSituationService accountingSituationService){
  this.today=generalService.getTodayDate();
  this.accountingSituationService=accountingSituationService;
}

Fixed version (ground truth):
@Inject public AccountCustomerService(AccountingSituationService accountingSituationService){
  this.today=Beans.get(GeneralService.class).getTodayDate();
  this.accountingSituationService=accountingSituationService;
}
Program: 58879
Project: 58879
Buggy source:
@Inject public IrrecoverableService(){
  this.date=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public IrrecoverableService(){
  this.date=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58880
Project: 58880
Buggy source:
@Inject public MoveLineService(AccountManagementServiceAccountImpl accountManagementService,TaxAccountService taxAccountService,FiscalPositionServiceAccountImpl fiscalPositionService){
  toDay=generalService.getTodayDate();
  this.accountManagementService=accountManagementService;
  this.taxAccountService=taxAccountService;
  this.fiscalPositionService=fiscalPositionService;
}

Fixed version (ground truth):
@Inject public MoveLineService(AccountManagementServiceAccountImpl accountManagementService,TaxAccountService taxAccountService,FiscalPositionServiceAccountImpl fiscalPositionService){
  toDay=Beans.get(GeneralService.class).getTodayDate();
  this.accountManagementService=accountManagementService;
  this.taxAccountService=taxAccountService;
  this.fiscalPositionService=fiscalPositionService;
}
Program: 58881
Project: 58881
Buggy source:
@Inject public MoveService(){
  toDay=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public MoveService(){
  toDay=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58882
Project: 58882
Buggy source:
@Inject public PaymentScheduleExportService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public PaymentScheduleExportService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58883
Project: 58883
Buggy source:
@Inject public PaymentScheduleImportService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public PaymentScheduleImportService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58884
Project: 58884
Buggy source:
@Inject public PaymentScheduleService(){
  date=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public PaymentScheduleService(){
  date=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58885
Project: 58885
Buggy source:
@Inject public ReconcileService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public ReconcileService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58886
Project: 58886
Buggy source:
@Inject public ReimbursementExportService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public ReimbursementExportService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58887
Project: 58887
Buggy source:
@Inject public DoubtfulCustomerService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public DoubtfulCustomerService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58888
Project: 58888
Buggy source:
@Inject public PayerQualityService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public PayerQualityService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58889
Project: 58889
Buggy source:
@Inject public ReminderActionService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public ReminderActionService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58890
Project: 58890
Buggy source:
@Inject public ReminderService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public ReminderService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58891
Project: 58891
Buggy source:
@Inject public ReminderSessionService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public ReminderSessionService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58892
Project: 58892
Buggy source:
protected InvoiceGenerator(){
  this.today=generalService.getTodayDate();
  this.journalService=new JournalService();
}

Fixed version (ground truth):
protected InvoiceGenerator(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
  this.journalService=new JournalService();
}
Program: 58893
Project: 58893
Buggy source:
@Inject public PaymentService(){
  date=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public PaymentService(){
  date=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58894
Project: 58894
Buggy source:
@Inject public BlockingService(){
  this.today=generalService.getTodayDate();
}

Fixed version (ground truth):
@Inject public BlockingService(){
  this.today=Beans.get(GeneralService.class).getTodayDate();
}
Program: 58895
Project: 58895
Buggy source:
public void setDraftSequence(SaleOrder saleOrder){
  if (saleOrder.getId() != null && Strings.isNullOrEmpty(saleOrder.getSaleOrderSeq())) {
    saleOrder.setSaleOrderSeq(this.getDraftSequence(saleOrder));
  }
}

Fixed version (ground truth):
@Override public void setDraftSequence(SaleOrder saleOrder){
  if (saleOrder.getId() != null && Strings.isNullOrEmpty(saleOrder.getSaleOrderSeq())) {
    saleOrder.setSaleOrderSeq(this.getDraftSequence(saleOrder));
  }
}
Program: 58896
Project: 58896
Buggy source:
public SaleOrder computeEndOfValidityDate(SaleOrder saleOrder){
  saleOrder.setEndOfValidityDate(Beans.get(DurationService.class).computeDuration(saleOrder.getDuration(),saleOrder.getCreationDate()));
  return saleOrder;
}

Fixed version (ground truth):
@Override public SaleOrder computeEndOfValidityDate(SaleOrder saleOrder){
  saleOrder.setEndOfValidityDate(Beans.get(DurationService.class).computeDuration(saleOrder.getDuration(),saleOrder.getCreationDate()));
  return saleOrder;
}
Program: 58899
Project: 58899
Buggy source:
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<StockMoveLine> stockMoveLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  StockMoveLine stockMoveLine : stockMoveLineList) {
    if (stockMoveLine.getRealQty().compareTo(BigDecimal.ZERO) == 1) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,stockMoveLine));
      stockMoveLine.getSaleOrderLine().setInvoiced(true);
    }
  }
  return invoiceLineList;
}

Fixed version (ground truth):
@Override public List<InvoiceLine> createInvoiceLines(Invoice invoice,List<StockMoveLine> stockMoveLineList) throws AxelorException {
  List<InvoiceLine> invoiceLineList=new ArrayList<InvoiceLine>();
  for (  StockMoveLine stockMoveLine : stockMoveLineList) {
    if (stockMoveLine.getRealQty().compareTo(BigDecimal.ZERO) == 1) {
      invoiceLineList.addAll(this.createInvoiceLine(invoice,stockMoveLine));
      if (stockMoveLine.getSaleOrderLine() != null) {
        stockMoveLine.getSaleOrderLine().setInvoiced(true);
      }
 else {
        stockMoveLine.getPurchaseOrderLine().setInvoiced(true);
      }
    }
  }
  return invoiceLineList;
}