nus-yam/ex-repair huggingface dataset:
Program: 59077
Project: 59077
Buggy source:
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public PaymentVoucher createPaymentVoucherIPO(Invoice invoice,DateTime dateTime,BigDecimal amount,PaymentMode paymentMode) throws AxelorException {
  MoveLine customerMoveLine=moveService.getCustomerMoveLineByQuery(invoice);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",invoice.getInvoiceId());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",paymentMode.getCode());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",invoice.getCompany().getName());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",invoice.getPartner().getName());
  }
  PaymentVoucher paymentVoucher=this.createPaymentVoucher(invoice.getCompany(),null,null,paymentMode,dateTime,invoice.getPartner(),amount,null,invoice,null,null,null);
  paymentVoucher.setAutoOk(true);
  List<PaymentInvoiceToPay> lines=new ArrayList<PaymentInvoiceToPay>();
  lines.add(paymentInvoiceToPayService.createPaymentInvoiceToPay(paymentVoucher,1,invoice,customerMoveLine,customerMoveLine.getDebit(),customerMoveLine.getAmountRemaining(),amount));
  paymentVoucher.setPaymentInvoiceToPayList(lines);
  paymentVoucher.save();
  paymentVoucherConfirmService.confirmPaymentVoucher(paymentVoucher,false);
  return paymentVoucher;
}

Fixed version (ground truth):
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public PaymentVoucher createPaymentVoucherIPO(Invoice invoice,DateTime dateTime,BigDecimal amount,PaymentMode paymentMode) throws AxelorException {
  MoveLine customerMoveLine=moveService.getCustomerMoveLineByQuery(invoice);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",invoice.getInvoiceId());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",paymentMode.getCode());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",invoice.getCompany().getName());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",invoice.getPartner().getName());
  }
  PaymentVoucher paymentVoucher=this.createPaymentVoucher(invoice.getCompany(),null,null,paymentMode,dateTime,invoice.getPartner(),amount,null,invoice,null,null,null);
  paymentVoucher.setHasAutoInput(true);
  List<PaymentInvoiceToPay> lines=new ArrayList<PaymentInvoiceToPay>();
  lines.add(paymentInvoiceToPayService.createPaymentInvoiceToPay(paymentVoucher,1,invoice,customerMoveLine,customerMoveLine.getDebit(),customerMoveLine.getAmountRemaining(),amount));
  paymentVoucher.setPaymentInvoiceToPayList(lines);
  paymentVoucher.save();
  paymentVoucherConfirmService.confirmPaymentVoucher(paymentVoucher,false);
  return paymentVoucher;
}
Program: 59079
Project: 59079
Buggy source:
/** 
 * Fonction qui crée une liste des factures ou échéances non payées susceptible de l'être
 * @param paymentVoucher Une saisie paiement
 * @param moveLineToPay Une écriture à payer
 * @return Une liste des factures ou échéances non payées
 * @throws AxelorException 
 */
public List<PaymentInvoice> setPaymentInvoiceList(PaymentVoucher paymentVoucher,MoveLine moveLineToPay) throws AxelorException {
  List<MoveLine> moveLineList=this.getMoveLines(paymentVoucher,moveLineToPay);
  List<PaymentInvoice> pil=new ArrayList<PaymentInvoice>();
  for (  MoveLine moveLine : moveLineList) {
    PaymentInvoice paymentInvoice=new PaymentInvoice();
    paymentInvoice.setMoveLine(moveLine);
    paymentInvoice.setInvoiceAmount(moveLine.getDebit());
    paymentInvoice.setPaidAmount(moveLine.getAmountPaid());
    paymentInvoice.setPaymentVoucher(paymentVoucher);
    Move move=moveLine.getMove();
    if (move.getInvoice() != null) {
      paymentInvoice.setCurrency(move.getInvoice().getCurrency());
    }
 else {
      paymentInvoice.setCurrency(move.getCurrency());
    }
    pil.add(paymentInvoice);
  }
  return pil;
}

Fixed version (ground truth):
/** 
 * Fonction qui crée une liste des factures ou échéances non payées susceptible de l'être
 * @param paymentVoucher Une saisie paiement
 * @param moveLineToPay Une écriture à payer
 * @return Une liste des factures ou échéances non payées
 * @throws AxelorException 
 */
public List<PaymentInvoice> setPaymentInvoiceList(PaymentVoucher paymentVoucher,MoveLine moveLineToPay) throws AxelorException {
  List<PaymentInvoice> paymentInvoiceList=new ArrayList<PaymentInvoice>();
  for (  MoveLine moveLine : this.getMoveLines(paymentVoucher,moveLineToPay)) {
    PaymentInvoice paymentInvoice=new PaymentInvoice();
    paymentInvoice.setMoveLine(moveLine);
    if (moveLine.getDebit().compareTo(BigDecimal.ZERO) > 0) {
      paymentInvoice.setInvoiceAmount(moveLine.getDebit());
    }
 else {
      paymentInvoice.setInvoiceAmount(moveLine.getCredit());
    }
    paymentInvoice.setPaidAmount(moveLine.getAmountPaid());
    paymentInvoice.setPaymentVoucher(paymentVoucher);
    Move move=moveLine.getMove();
    if (move.getInvoice() != null) {
      paymentInvoice.setCurrency(move.getInvoice().getCurrency());
    }
 else {
      paymentInvoice.setCurrency(move.getCurrency());
    }
    paymentInvoiceList.add(paymentInvoice);
  }
  return paymentInvoiceList;
}
Program: 59083
Project: 59083
Buggy source:
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public void accept(PurchaseOrderSupplierLine purchaseOrderSupplierLine){
  PurchaseOrderLine purchaseOrderLine=purchaseOrderSupplierLine.getPurchaseOrderLine();
  purchaseOrderLine.setEstimatedDelivDate(purchaseOrderSupplierLine.getEstimatedDelivDate());
  purchaseOrderLine.setSupplierPartner(purchaseOrderSupplierLine.getSupplierPartner());
  purchaseOrderLine.setPrice(purchaseOrderSupplierLine.getPrice());
  purchaseOrderLine.setExTaxTotal(PurchaseOrderLineService.computeAmount(purchaseOrderLine.getQty(),purchaseOrderLine.getPrice()));
  purchaseOrderLine.save();
}

Fixed version (ground truth):
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public void accept(PurchaseOrderSupplierLine purchaseOrderSupplierLine){
  PurchaseOrderLine purchaseOrderLine=purchaseOrderSupplierLine.getPurchaseOrderLine();
  purchaseOrderLine.setEstimatedDelivDate(purchaseOrderSupplierLine.getEstimatedDelivDate());
  purchaseOrderLine.setSupplierPartner(purchaseOrderSupplierLine.getSupplierPartner());
  purchaseOrderLine.setPrice(purchaseOrderSupplierLine.getPrice());
  purchaseOrderLine.setExTaxTotal(PurchaseOrderLineService.computeAmount(purchaseOrderLine.getQty(),purchaseOrderLine.getPrice()));
  purchaseOrderSupplierLine.setStateSelect(IPurchaseOrderSupplierLine.ACCEPTED);
  purchaseOrderSupplierLine.save();
}
Program: 59084
Project: 59084
Buggy source:
/** 
 * Historise l'éxécution
 * @param schedulerI Instance de planificateur
 * @param currentDay Date d'éxécution
 * @param isImmediate Mettre a jour le cycle ? Dans le cas de facturation mémoire immédiate
 * @throws AxelorException
 */
public void addInHistory(SchedulerInstance schedulerI,LocalDate currentDay,boolean isImmediate) throws AxelorException {
  LocalDate date=this.getTheoricalExecutionDate(schedulerI);
  schedulerI.setLastExecutionDate(currentDay);
  if (!isImmediate) {
    schedulerI.setLastTheoreticalExecutionDate(date);
  }
  SchedulerInstanceHistory history=new SchedulerInstanceHistory();
  history.setLastExecutionDate(currentDay);
  history.setLastThoereticalExecutionDate(date);
  history.setSchedulerInstance(schedulerI);
  if (schedulerI.getSchedulerInstanceHistoryList() == null) {
    schedulerI.setSchedulerInstanceHistoryList(new ArrayList<SchedulerInstanceHistory>());
  }
  schedulerI.getSchedulerInstanceHistoryList().add(history);
  schedulerI.save();
}

Fixed version (ground truth):
/** 
 * Historise l'éxécution
 * @param schedulerI Instance de planificateur
 * @param currentDay Date d'éxécution
 * @param isImmediate Mettre a jour le cycle ? Dans le cas de facturation mémoire immédiate
 * @throws AxelorException
 */
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public void addInHistory(SchedulerInstance schedulerI,LocalDate currentDay,boolean isImmediate) throws AxelorException {
  LocalDate date=this.getTheoricalExecutionDate(schedulerI);
  schedulerI.setLastExecutionDate(currentDay);
  if (!isImmediate) {
    schedulerI.setLastTheoreticalExecutionDate(date);
  }
  SchedulerInstanceHistory history=new SchedulerInstanceHistory();
  history.setLastExecutionDate(currentDay);
  history.setLastThoereticalExecutionDate(date);
  history.setSchedulerInstance(schedulerI);
  if (schedulerI.getSchedulerInstanceHistoryList() == null) {
    schedulerI.setSchedulerInstanceHistoryList(new ArrayList<SchedulerInstanceHistory>());
  }
  schedulerI.getSchedulerInstanceHistoryList().add(history);
  schedulerI.save();
}
Program: 59085
Project: 59085
Buggy source:
public StockMove generateStockMove(Inventory inventory) throws AxelorException {
  Location toLocation=inventory.getLocation();
  Company company=toLocation.getCompany();
  if (company == null) {
    throw new AxelorException(String.format("String_Node_Str",toLocation.getName()),IException.CONFIGURATION_ERROR);
  }
  String inventorySeq=inventory.getInventorySeq();
  StockMove stockMove=this.createStockMoveHeader(inventory,company,toLocation,inventory.getDateT().toLocalDate(),inventorySeq);
  for (  InventoryLine inventoryLine : inventory.getInventoryLineList()) {
    BigDecimal currentQty=inventoryLine.getCurrentQty();
    BigDecimal realQty=inventoryLine.getRealQty();
    Product product=inventoryLine.getProduct();
    if (currentQty.compareTo(realQty) != 0) {
      BigDecimal diff=realQty.subtract(currentQty);
      StockMoveLine stockMoveLine=stockMoveLineService.createStockMoveLine(product,diff,product.getUnit(),null,stockMove,0);
      if (stockMoveLine == null) {
        throw new AxelorException("String_Node_Str" + inventorySeq,IException.CONFIGURATION_ERROR);
      }
      if (stockMove.getStockMoveLineList() == null) {
        stockMove.setStockMoveLineList(new ArrayList<StockMoveLine>());
      }
      stockMove.getStockMoveLineList().add(stockMoveLine);
    }
  }
  if (stockMove.getStockMoveLineList() != null) {
    stockMoveService.plan(stockMove);
    stockMoveService.copyQtyToRealQty(stockMove);
    stockMoveService.realize(stockMove);
  }
  return stockMove;
}

Fixed version (ground truth):
public StockMove generateStockMove(Inventory inventory) throws AxelorException {
  Location toLocation=inventory.getLocation();
  Company company=toLocation.getCompany();
  if (company == null) {
    throw new AxelorException(String.format("String_Node_Str",toLocation.getName()),IException.CONFIGURATION_ERROR);
  }
  String inventorySeq=inventory.getInventorySeq();
  StockMove stockMove=this.createStockMoveHeader(inventory,company,toLocation,inventory.getDateT().toLocalDate(),inventorySeq);
  for (  InventoryLine inventoryLine : inventory.getInventoryLineList()) {
    BigDecimal currentQty=inventoryLine.getCurrentQty();
    BigDecimal realQty=inventoryLine.getRealQty();
    Product product=inventoryLine.getProduct();
    if (currentQty.compareTo(realQty) != 0) {
      BigDecimal diff=realQty.subtract(currentQty);
      StockMoveLine stockMoveLine=stockMoveLineService.createStockMoveLine(product,diff,product.getUnit(),null,stockMove,0);
      if (stockMoveLine == null) {
        throw new AxelorException("String_Node_Str" + inventorySeq,IException.CONFIGURATION_ERROR);
      }
      stockMove.addStockMoveLineListItem(stockMoveLine);
    }
  }
  if (stockMove.getStockMoveLineList() != null) {
    stockMoveService.plan(stockMove);
    stockMoveService.copyQtyToRealQty(stockMove);
    stockMoveService.realize(stockMove);
  }
  return stockMove;
}
Program: 59086
Project: 59086
Buggy source:
/** 
 * Permet de créer une ligne détaillée de stock pour un entrepot, un produit, une variante de produit et un numéro de suivi donnés.
 * @param location Un entrepot
 * @param product Un produit
 * @param trackingNumber Un numéro de suivi
 * @return La ligne détaillée de stock
 */
public LocationLine createDetailLocationLine(Location location,Product product,TrackingNumber trackingNumber){
  LOG.debug("String_Node_Str",new Object[]{location.getName(),product.getCode(),trackingNumber.getTrackingNumberSeq()});
  LocationLine detailLocationLine=new LocationLine();
  detailLocationLine.setDetailsLocation(location);
  detailLocationLine.setProduct(product);
  detailLocationLine.setCurrentQty(BigDecimal.ZERO);
  detailLocationLine.setFutureQty(BigDecimal.ZERO);
  detailLocationLine.setTrackingNumber(trackingNumber);
  return detailLocationLine;
}

Fixed version (ground truth):
/** 
 * Permet de créer une ligne détaillée de stock pour un entrepot, un produit, une variante de produit et un numéro de suivi donnés.
 * @param location Un entrepot
 * @param product Un produit
 * @param trackingNumber Un numéro de suivi
 * @return La ligne détaillée de stock
 */
public LocationLine createDetailLocationLine(Location location,Product product,TrackingNumber trackingNumber){
  LOG.debug("String_Node_Str",new Object[]{location.getName(),product.getCode(),trackingNumber.getTrackingNumberSeq()});
  LocationLine detailLocationLine=new LocationLine();
  detailLocationLine.setDetailsLocation(location);
  location.addDetailsLocationLineListItem(detailLocationLine);
  detailLocationLine.setProduct(product);
  detailLocationLine.setCurrentQty(BigDecimal.ZERO);
  detailLocationLine.setFutureQty(BigDecimal.ZERO);
  detailLocationLine.setTrackingNumber(trackingNumber);
  return detailLocationLine;
}
Program: 59087
Project: 59087
Buggy source:
/** 
 * Permet de créer une ligne de stock pour un entrepot et un produit donnés.
 * @param location Un entrepot
 * @param product Un produit
 * @return La ligne de stock
 */
public LocationLine createLocationLine(Location location,Product product){
  LOG.debug("String_Node_Str",new Object[]{location.getName(),product.getCode()});
  LocationLine locationLine=new LocationLine();
  locationLine.setLocation(location);
  locationLine.setProduct(product);
  locationLine.setCurrentQty(BigDecimal.ZERO);
  locationLine.setFutureQty(BigDecimal.ZERO);
  return locationLine;
}

Fixed version (ground truth):
/** 
 * Permet de créer une ligne de stock pour un entrepot et un produit donnés.
 * @param location Un entrepot
 * @param product Un produit
 * @return La ligne de stock
 */
public LocationLine createLocationLine(Location location,Product product){
  LOG.debug("String_Node_Str",new Object[]{location.getName(),product.getCode()});
  LocationLine locationLine=new LocationLine();
  locationLine.setLocation(location);
  location.addLocationLineListItem(locationLine);
  locationLine.setProduct(product);
  locationLine.setCurrentQty(BigDecimal.ZERO);
  locationLine.setFutureQty(BigDecimal.ZERO);
  return locationLine;
}
Program: 59088
Project: 59088
Buggy source:
public TrackingNumber createTrackingNumber(Product product,Company company,LocalDate date) throws AxelorException {
  TrackingNumber trackingNumber=new TrackingNumber();
  if (product.getIsPerishable()) {
    trackingNumber.setPerishableExpirationDate(date.plusMonths(product.getPerishableNbrOfMonths()));
  }
  if (product.getHasWarranty()) {
    trackingNumber.setWarrantyExpirationDate(date.plusMonths(product.getWarrantyNbrOfMonths()));
  }
  trackingNumber.setProduct(product);
  trackingNumber.setCounter(0);
  String seq=sequenceService.getSequence(IAdministration.PRODUCT_TRACKING_NUMBER,product,company,false);
  if (seq == null) {
    throw new AxelorException(String.format("String_Node_Str",exceptionMsg,company.getName(),product.getCode()),IException.CONFIGURATION_ERROR);
  }
  trackingNumber.setTrackingNumberSeq(seq);
  return trackingNumber;
}

Fixed version (ground truth):
public TrackingNumber createTrackingNumber(Product product,Company company,LocalDate date) throws AxelorException {
  TrackingNumber trackingNumber=new TrackingNumber();
  if (product.getIsPerishable()) {
    trackingNumber.setPerishableExpirationDate(date.plusMonths(product.getPerishableNbrOfMonths()));
  }
  if (product.getHasWarranty()) {
    trackingNumber.setWarrantyExpirationDate(date.plusMonths(product.getWarrantyNbrOfMonths()));
  }
  trackingNumber.setProduct(product);
  trackingNumber.setCounter(BigDecimal.ZERO);
  String seq=sequenceService.getSequence(IAdministration.PRODUCT_TRACKING_NUMBER,product,company,false);
  if (seq == null) {
    throw new AxelorException(String.format("String_Node_Str",exceptionMsg,company.getName(),product.getCode()),IException.CONFIGURATION_ERROR);
  }
  trackingNumber.setTrackingNumberSeq(seq);
  return trackingNumber;
}
Program: 59089
Project: 59089
Buggy source:
public TrackingNumber getTrackingNumber(Product product,int sizeOfLot,Company company,LocalDate date) throws AxelorException {
  TrackingNumber trackingNumber=TrackingNumber.all().filter("String_Node_Str",product,sizeOfLot).fetchOne();
  if (trackingNumber == null) {
    trackingNumber=this.createTrackingNumber(product,company,date);
  }
  trackingNumber.setCounter(trackingNumber.getCounter() + 1);
  return trackingNumber;
}

Fixed version (ground truth):
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public TrackingNumber getTrackingNumber(Product product,BigDecimal sizeOfLot,Company company,LocalDate date) throws AxelorException {
  TrackingNumber trackingNumber=TrackingNumber.all().filter("String_Node_Str",product,sizeOfLot).fetchOne();
  if (trackingNumber == null) {
    trackingNumber=this.createTrackingNumber(product,company,date).save();
  }
  trackingNumber.setCounter(trackingNumber.getCounter().add(sizeOfLot));
  return trackingNumber;
}
Program: 59090
Project: 59090
Buggy source:
public void checkStockMin(LocationLine locationLine,boolean isDetailLocationLine) throws AxelorException {
  if (!isDetailLocationLine && locationLine.getCurrentQty().compareTo(BigDecimal.ZERO) == -1 && locationLine.getLocation().getTypeSelect() == ILocation.INTERNAL) {
    throw new AxelorException(String.format("String_Node_Str",locationLine.getProduct().getName(),locationLine.getProduct().getCode()),IException.CONFIGURATION_ERROR);
  }
 else   if (isDetailLocationLine && locationLine.getCurrentQty().compareTo(BigDecimal.ZERO) == -1 && locationLine.getLocation().getTypeSelect() == ILocation.INTERNAL) {
    String trackingNumber="String_Node_Str";
    if (locationLine.getTrackingNumber() != null) {
      trackingNumber=locationLine.getTrackingNumber().getTrackingNumberSeq();
    }
    throw new AxelorException(String.format("String_Node_Str",locationLine.getProduct().getName(),locationLine.getProduct().getCode(),trackingNumber),IException.CONFIGURATION_ERROR);
  }
}

Fixed version (ground truth):
public void checkStockMin(LocationLine locationLine,boolean isDetailLocationLine) throws AxelorException {
  if (!isDetailLocationLine && locationLine.getCurrentQty().compareTo(BigDecimal.ZERO) == -1 && locationLine.getLocation().getTypeSelect() == ILocation.INTERNAL) {
    throw new AxelorException(String.format("String_Node_Str",locationLine.getProduct().getName(),locationLine.getProduct().getCode()),IException.CONFIGURATION_ERROR);
  }
 else   if (isDetailLocationLine && locationLine.getCurrentQty().compareTo(BigDecimal.ZERO) == -1 && ((locationLine.getLocation() != null && locationLine.getLocation().getTypeSelect() == ILocation.INTERNAL) || (locationLine.getDetailsLocation() != null && locationLine.getDetailsLocation().getTypeSelect() == ILocation.INTERNAL))) {
    String trackingNumber="String_Node_Str";
    if (locationLine.getTrackingNumber() != null) {
      trackingNumber=locationLine.getTrackingNumber().getTrackingNumberSeq();
    }
    throw new AxelorException(String.format("String_Node_Str",locationLine.getProduct().getName(),locationLine.getProduct().getCode(),trackingNumber),IException.CONFIGURATION_ERROR);
  }
}
Program: 59092
Project: 59092
Buggy source:
public void createTasks(ActionRequest request,ActionResponse response) throws AxelorException {
  SalesOrder salesOrder=request.getContext().asType(SalesOrder.class);
  taskSalesOrderService.createTasks(SalesOrder.find(salesOrder.getId()));
  response.setReload(true);
}

Fixed version (ground truth):
public void createTasks(ActionRequest request,ActionResponse response) throws AxelorException {
  SalesOrder salesOrder=request.getContext().asType(SalesOrder.class);
  taskSalesOrderService.createTasks(SalesOrder.find(salesOrder.getId()));
}
Program: 59093
Project: 59093
Buggy source:
public long computeEntireCycleDuration(ProdResource prodResource,BigDecimal qty){
  long entireCycleDuration=0;
  entireCycleDuration+=prodResource.getStartingDuration();
  BigDecimal durationPerCycle=new BigDecimal(prodResource.getDurationPerCycle());
  entireCycleDuration+=(qty.divide(prodResource.getCapacityPerCycle())).multiply(durationPerCycle).longValue();
  entireCycleDuration+=prodResource.getEndingDuration();
  return entireCycleDuration;
}

Fixed version (ground truth):
public long computeEntireCycleDuration(ProdResource prodResource,BigDecimal qty){
  long machineDuration=this.computeMachineDuration(prodResource,qty);
  long humanDuration=this.computeHumanDuration(prodResource,qty);
  if (machineDuration >= humanDuration) {
    return machineDuration;
  }
 else {
    return humanDuration;
  }
}
Program: 59094
Project: 59094
Buggy source:
public void updateSalePrice(Product product) throws AxelorException {
  BigDecimal costPrice=product.getCostPrice();
  BigDecimal managePriceCoef=product.getManagPriceCoef();
  LOG.debug("String_Node_Str",costPrice);
  LOG.debug("String_Node_Str",costPrice);
  if (costPrice != null && managePriceCoef != null) {
    product.setSalePrice((costPrice.multiply(managePriceCoef)).setScale(5,BigDecimal.ROUND_HALF_UP));
    LOG.debug("String_Node_Str",product.getSalePrice());
  }
}

Fixed version (ground truth):
public void updateSalePrice(Product product) throws AxelorException {
  BigDecimal costPrice=product.getCostPrice();
  BigDecimal managePriceCoef=product.getManagPriceCoef();
  if (costPrice != null && managePriceCoef != null) {
    product.setSalePrice((costPrice.multiply(managePriceCoef)).setScale(5,BigDecimal.ROUND_HALF_UP));
  }
}
Program: 59095
Project: 59095
Buggy source:
public void updateSalePrice(Product product) throws AxelorException {
  BigDecimal costPrice=product.getCostPrice();
  BigDecimal managePriceCoef=product.getManagPriceCoef();
  if (costPrice != null && managePriceCoef != null) {
    product.setSalePrice(costPrice.multiply(managePriceCoef));
  }
}

Fixed version (ground truth):
public void updateSalePrice(Product product) throws AxelorException {
  BigDecimal costPrice=product.getCostPrice();
  BigDecimal managePriceCoef=product.getManagPriceCoef();
  LOG.debug("String_Node_Str",costPrice);
  LOG.debug("String_Node_Str",costPrice);
  if (costPrice != null && managePriceCoef != null) {
    product.setSalePrice((costPrice.multiply(managePriceCoef)).setScale(5,BigDecimal.ROUND_HALF_UP));
    LOG.debug("String_Node_Str",product.getSalePrice());
  }
}
Program: 59096
Project: 59096
Buggy source:
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public void cancel(ManufOrder manufOrder){
  if (manufOrder.getOperationOrderList() != null) {
    for (    OperationOrder operationOrder : manufOrder.getOperationOrderList()) {
      operationOrder.setStatusSelect(IOperationOrder.STATUS_CANCELED);
    }
  }
  manufOrder.setStatusSelect(IManufOrder.STATUS_CANCELED);
  manufOrder.save();
}

Fixed version (ground truth):
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public void cancel(ManufOrder manufOrder) throws AxelorException {
  if (manufOrder.getOperationOrderList() != null) {
    for (    OperationOrder operationOrder : manufOrder.getOperationOrderList()) {
      if (operationOrder.getStatusSelect() != IOperationOrder.STATUS_CANCELED) {
        operationOrderWorkflowService.cancel(operationOrder);
      }
    }
  }
  manufOrderStockMoveService.cancel(manufOrder);
  manufOrder.setStatusSelect(IManufOrder.STATUS_CANCELED);
  manufOrder.save();
}
Program: 59097
Project: 59097
Buggy source:
public void cancel(OperationOrder operationOrder) throws AxelorException {
  StockMove stockMove=operationOrder.getInStockMove();
  if (stockMove != null && stockMove.getStockMoveLineList() != null) {
    stockMoveService.cancel(stockMove);
  }
}

Fixed version (ground truth):
public void cancel(OperationOrder operationOrder) throws AxelorException {
  StockMove stockMove=operationOrder.getInStockMove();
  if (stockMove != null && stockMove.getStockMoveLineList() != null) {
    stockMoveService.cancel(stockMove);
    for (    StockMoveLine stockMoveLine : stockMove.getStockMoveLineList()) {
      stockMoveLine.setConsumedOperationOrder(null);
    }
  }
}
Program: 59098
Project: 59098
Buggy source:
private BigDecimal _computeToConsumeProduct(BillOfMaterial billOfMaterial) throws AxelorException {
  BigDecimal costPrice=BigDecimal.ZERO;
  if (billOfMaterial.getBillOfMaterialList() != null) {
    for (    BillOfMaterial billOfMaterialLine : billOfMaterial.getBillOfMaterialList()) {
      Product product=billOfMaterialLine.getProduct();
      if (product != null) {
        if (billOfMaterialLine.getIsRawMaterial()) {
          costPrice=costPrice.add(product.getCostPrice());
        }
 else {
          costPrice=costPrice.add(this._computeCostPrice(billOfMaterialLine));
        }
      }
    }
  }
  return costPrice;
}

Fixed version (ground truth):
private BigDecimal _computeToConsumeProduct(BillOfMaterial billOfMaterial) throws AxelorException {
  BigDecimal costPrice=BigDecimal.ZERO;
  if (billOfMaterial.getBillOfMaterialList() != null) {
    for (    BillOfMaterial billOfMaterialLine : billOfMaterial.getBillOfMaterialList()) {
      Product product=billOfMaterialLine.getProduct();
      if (product != null) {
        if (billOfMaterialLine.getIsRawMaterial()) {
          BigDecimal unitPrice=unitConversionService.convert(product.getUnit(),billOfMaterialLine.getUnit(),product.getCostPrice());
          costPrice=costPrice.add(unitPrice.multiply(billOfMaterialLine.getQty()));
        }
 else {
          costPrice=costPrice.add(this._computeCostPrice(billOfMaterialLine));
        }
      }
    }
  }
  return costPrice;
}
Program: 59101
Project: 59101
Buggy source:
public void resetProductInformation(ActionResponse response){
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
}

Fixed version (ground truth):
public void resetProductInformation(ActionResponse response){
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
}
Program: 59103
Project: 59103
Buggy source:
public void resetProductInformation(ActionResponse response){
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
}

Fixed version (ground truth):
public void resetProductInformation(ActionResponse response){
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
}
Program: 59104
Project: 59104
Buggy source:
public void compute(ActionRequest request,ActionResponse response){
  PurchaseOrderLine purchaseOrderLine=request.getContext().asType(PurchaseOrderLine.class);
  BigDecimal exTaxTotal=BigDecimal.ZERO;
  BigDecimal companyExTaxTotal=BigDecimal.ZERO;
  try {
    if (purchaseOrderLine.getPrice() != null && purchaseOrderLine.getQty() != null) {
      exTaxTotal=PurchaseOrderLineService.computeAmount(purchaseOrderLine.getQty(),purchaseOrderLineService.computeDiscount(purchaseOrderLine));
    }
    if (exTaxTotal != null) {
      PurchaseOrder purchaseOrder=purchaseOrderLine.getPurchaseOrder();
      if (purchaseOrder == null) {
        purchaseOrder=request.getContext().getParentContext().asType(PurchaseOrder.class);
      }
      if (purchaseOrder != null) {
        companyExTaxTotal=purchaseOrderLineService.getCompanyExTaxTotal(exTaxTotal,purchaseOrder);
      }
    }
    response.setValue("String_Node_Str",exTaxTotal);
    response.setValue("String_Node_Str",companyExTaxTotal);
  }
 catch (  Exception e) {
    response.setFlash(e.getMessage());
  }
}

Fixed version (ground truth):
public void compute(ActionRequest request,ActionResponse response){
  PurchaseOrderLine purchaseOrderLine=request.getContext().asType(PurchaseOrderLine.class);
  BigDecimal exTaxTotal=BigDecimal.ZERO;
  BigDecimal companyExTaxTotal=BigDecimal.ZERO;
  try {
    if (purchaseOrderLine.getPrice() != null && purchaseOrderLine.getQty() != null) {
      exTaxTotal=PurchaseOrderLineService.computeAmount(purchaseOrderLine.getQty(),purchaseOrderLineService.computeDiscount(purchaseOrderLine));
    }
    if (exTaxTotal != null) {
      PurchaseOrder purchaseOrder=purchaseOrderLine.getPurchaseOrder();
      if (purchaseOrder == null) {
        purchaseOrder=request.getContext().getParentContext().asType(PurchaseOrder.class);
      }
      if (purchaseOrder != null) {
        companyExTaxTotal=purchaseOrderLineService.getCompanyExTaxTotal(exTaxTotal,purchaseOrder);
      }
      response.setValue("String_Node_Str",purchaseOrderLineService.getMinSalePrice(purchaseOrder,purchaseOrderLine));
      response.setValue("String_Node_Str",purchaseOrderLineService.getSalePrice(purchaseOrder,purchaseOrderLine.getPrice()));
    }
    response.setValue("String_Node_Str",exTaxTotal);
    response.setValue("String_Node_Str",companyExTaxTotal);
  }
 catch (  Exception e) {
    response.setFlash(e.getMessage());
  }
}
Program: 59106
Project: 59106
Buggy source:
public BigDecimal getMinSalePrice(PurchaseOrder purchaseOrder,PurchaseOrderLine purchaseOrderLine) throws AxelorException {
  Product product=purchaseOrderLine.getProduct();
  return currencyService.getAmountCurrencyConverted(product.getPurchaseCurrency(),purchaseOrder.getCurrency(),product.getSalePrice(),purchaseOrder.getOrderDate());
}

Fixed version (ground truth):
public BigDecimal getMinSalePrice(PurchaseOrder purchaseOrder,PurchaseOrderLine purchaseOrderLine) throws AxelorException {
  Product product=purchaseOrderLine.getProduct();
  return currencyService.getAmountCurrencyConverted(product.getSaleCurrency(),purchaseOrder.getCurrency(),product.getSalePrice(),purchaseOrder.getOrderDate());
}
Program: 59108
Project: 59108
Buggy source:
public void compute(ActionRequest request,ActionResponse response){
  PurchaseOrderLine purchaseOrderLine=request.getContext().asType(PurchaseOrderLine.class);
  BigDecimal exTaxTotal=BigDecimal.ZERO;
  BigDecimal companyExTaxTotal=BigDecimal.ZERO;
  try {
    if (purchaseOrderLine.getPrice() != null && purchaseOrderLine.getQty() != null) {
      exTaxTotal=PurchaseOrderLineService.computeAmount(purchaseOrderLine.getQty(),purchaseOrderLineService.computeDiscount(purchaseOrderLine));
    }
    if (exTaxTotal != null) {
      PurchaseOrder purchaseOrder=purchaseOrderLine.getPurchaseOrder();
      if (purchaseOrder == null) {
        purchaseOrder=request.getContext().getParentContext().asType(PurchaseOrder.class);
      }
      if (purchaseOrder != null) {
        companyExTaxTotal=purchaseOrderLineService.getCompanyExTaxTotal(exTaxTotal,purchaseOrder);
      }
      response.setValue("String_Node_Str",purchaseOrderLineService.getMinSalePrice(purchaseOrder,purchaseOrderLine));
      response.setValue("String_Node_Str",purchaseOrderLineService.getSalePrice(purchaseOrder,purchaseOrderLine.getPrice()));
    }
    response.setValue("String_Node_Str",exTaxTotal);
    response.setValue("String_Node_Str",companyExTaxTotal);
  }
 catch (  Exception e) {
    response.setFlash(e.getMessage());
  }
}

Fixed version (ground truth):
public void compute(ActionRequest request,ActionResponse response){
  PurchaseOrderLine purchaseOrderLine=request.getContext().asType(PurchaseOrderLine.class);
  BigDecimal exTaxTotal=BigDecimal.ZERO;
  BigDecimal companyExTaxTotal=BigDecimal.ZERO;
  try {
    if (purchaseOrderLine.getPrice() != null && purchaseOrderLine.getQty() != null) {
      exTaxTotal=PurchaseOrderLineService.computeAmount(purchaseOrderLine.getQty(),purchaseOrderLineService.computeDiscount(purchaseOrderLine));
    }
    if (exTaxTotal != null) {
      PurchaseOrder purchaseOrder=purchaseOrderLine.getPurchaseOrder();
      if (purchaseOrder == null) {
        purchaseOrder=request.getContext().getParentContext().asType(PurchaseOrder.class);
      }
      if (purchaseOrder != null) {
        companyExTaxTotal=purchaseOrderLineService.getCompanyExTaxTotal(exTaxTotal,purchaseOrder);
        response.setValue("String_Node_Str",purchaseOrderLineService.getMinSalePrice(purchaseOrder,purchaseOrderLine));
        response.setValue("String_Node_Str",purchaseOrderLineService.getSalePrice(purchaseOrder,purchaseOrderLine.getPrice()));
      }
    }
    response.setValue("String_Node_Str",exTaxTotal);
    response.setValue("String_Node_Str",companyExTaxTotal);
  }
 catch (  Exception e) {
    response.setFlash(e.getMessage());
  }
}
Program: 59109
Project: 59109
Buggy source:
public void resetProductInformation(ActionResponse response){
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
}

Fixed version (ground truth):
public void resetProductInformation(ActionResponse response){
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
  response.setValue("String_Node_Str",null);
}
Program: 59110
Project: 59110
Buggy source:
public BigDecimal getAmountCurrencyConverted(Currency currencyStart,Currency currencyEnd,BigDecimal amountToPay,LocalDate localDate) throws AxelorException {
  if (!currencyStart.equals(currencyEnd)) {
    CurrencyConversionLine currencyConversionLine=this.getCurrencyConversionLine(currencyStart,currencyEnd,localDate);
    if (currencyConversionLine != null) {
      return amountToPay.multiply(currencyConversionLine.getExchangeRate()).setScale(2,RoundingMode.HALF_UP);
    }
 else {
      currencyConversionLine=this.getCurrencyConversionLine(currencyEnd,currencyStart,localDate);
    }
    if (currencyConversionLine == null) {
      throw new AxelorException(String.format(metaTranslations.get(IExceptionMessage.CURRENCY_1),currencyStart.getName(),currencyEnd.getName(),today),IException.CONFIGURATION_ERROR);
    }
    return amountToPay.divide(currencyConversionLine.getExchangeRate(),2,RoundingMode.HALF_UP).setScale(2,RoundingMode.HALF_UP);
  }
  return amountToPay;
}

Fixed version (ground truth):
public BigDecimal getAmountCurrencyConverted(Currency currencyStart,Currency currencyEnd,BigDecimal amountToPay,LocalDate localDate) throws AxelorException {
  if (!currencyStart.equals(currencyEnd)) {
    CurrencyConversionLine currencyConversionLine=this.getCurrencyConversionLine(currencyStart,currencyEnd,localDate);
    if (currencyConversionLine != null) {
      return amountToPay.multiply(currencyConversionLine.getExchangeRate()).setScale(2,RoundingMode.HALF_UP);
    }
 else {
      currencyConversionLine=this.getCurrencyConversionLine(currencyEnd,currencyStart,localDate);
    }
    if (currencyConversionLine == null) {
      throw new AxelorException(String.format(metaTranslations.get(IExceptionMessage.CURRENCY_1),currencyStart.getName(),currencyEnd.getName(),today),IException.CONFIGURATION_ERROR);
    }
    BigDecimal exchangeRate=currencyConversionLine.getExchangeRate();
    if (exchangeRate == null || exchangeRate.compareTo(BigDecimal.ZERO) == 0) {
      throw new AxelorException(String.format(metaTranslations.get(IExceptionMessage.CURRENCY_2),currencyStart.getName(),currencyEnd.getName(),today),IException.CONFIGURATION_ERROR);
    }
    return amountToPay.divide(exchangeRate,2,RoundingMode.HALF_UP).setScale(2,RoundingMode.HALF_UP);
  }
  return amountToPay;
}
Program: 59111
Project: 59111
Buggy source:
public Address createPrimaryAddress(Map<String,Object> context){
  String addressL4=(String)context.get("String_Node_Str");
  String addressL5=(String)context.get("String_Node_Str");
  String addressL6=(String)context.get("String_Node_Str") + "String_Node_Str" + (String)context.get("String_Node_Str");
  ;
  Country addressL7Country=null;
  Map<String,Object> countryContext=(Map<String,Object>)context.get("String_Node_Str");
  if (countryContext != null) {
    addressL7Country=Country.find(((Integer)countryContext.get("String_Node_Str")).longValue());
  }
  Address address=addressService.getAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  if (address == null) {
    addressService.createAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  }
  return address;
}

Fixed version (ground truth):
public Address createPrimaryAddress(Map<String,Object> context){
  String addressL4=(String)context.get("String_Node_Str");
  String addressL5=(String)context.get("String_Node_Str");
  String addressL6=(String)context.get("String_Node_Str") + "String_Node_Str" + (String)context.get("String_Node_Str");
  ;
  Country addressL7Country=null;
  Map<String,Object> countryContext=(Map<String,Object>)context.get("String_Node_Str");
  if (countryContext != null) {
    addressL7Country=Country.find(((Integer)countryContext.get("String_Node_Str")).longValue());
  }
  Address address=addressService.getAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  if (address == null) {
    address=addressService.createAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  }
  return address;
}
Program: 59112
Project: 59112
Buggy source:
public Address createOtherAddress(Map<String,Object> context){
  String addressL4=(String)context.get("String_Node_Str");
  String addressL5=(String)context.get("String_Node_Str");
  String addressL6=(String)context.get("String_Node_Str") + "String_Node_Str" + (String)context.get("String_Node_Str");
  Country addressL7Country=null;
  Map<String,Object> countryContext=(Map<String,Object>)context.get("String_Node_Str");
  if (countryContext != null) {
    addressL7Country=Country.find(((Integer)countryContext.get("String_Node_Str")).longValue());
  }
  Address address=addressService.getAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  if (address == null) {
    addressService.createAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  }
  return address;
}

Fixed version (ground truth):
public Address createOtherAddress(Map<String,Object> context){
  String addressL4=(String)context.get("String_Node_Str");
  String addressL5=(String)context.get("String_Node_Str");
  String addressL6=(String)context.get("String_Node_Str") + "String_Node_Str" + (String)context.get("String_Node_Str");
  Country addressL7Country=null;
  Map<String,Object> countryContext=(Map<String,Object>)context.get("String_Node_Str");
  if (countryContext != null) {
    addressL7Country=Country.find(((Integer)countryContext.get("String_Node_Str")).longValue());
  }
  Address address=addressService.getAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  if (address == null) {
    address=addressService.createAddress(null,null,addressL4,addressL5,addressL6,addressL7Country);
  }
  return address;
}
Program: 59113
Project: 59113
Buggy source:
/** 
 * Convert lead into a partner
 * @param lead
 * @return
 * @throws AxelorException
 */
@Transactional public Lead convertLead(Lead lead,Partner partner,Partner contactPartner,Opportunity opportunity,Event callEvent,Event meetingEvent,Event taskEvent) throws AxelorException {
  if (partner != null && contactPartner != null) {
    if (partner.getContactPartnerSet() == null) {
      partner.setContactPartnerSet(new HashSet<Partner>());
    }
    partner.getContactPartnerSet().add(contactPartner);
  }
  if (opportunity != null && partner != null) {
    opportunity.setPartner(partner);
  }
  if (partner != null) {
    lead.setPartner(partner);
    partner.save();
  }
  if (contactPartner != null) {
    contactPartner.save();
  }
  if (opportunity != null) {
    opportunity.save();
  }
  if (callEvent != null) {
    callEvent.save();
  }
  if (meetingEvent != null) {
    meetingEvent.save();
  }
  if (taskEvent != null) {
    taskEvent.save();
  }
  lead.setPartner(partner);
  lead.setStatusSelect(ILead.STATUS_CONVERTED);
  lead.save();
  return lead;
}

Fixed version (ground truth):
/** 
 * Convert lead into a partner
 * @param lead
 * @return
 * @throws AxelorException
 */
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public Lead convertLead(Lead lead,Partner partner,Partner contactPartner,Opportunity opportunity,Event callEvent,Event meetingEvent,Event taskEvent) throws AxelorException {
  if (partner != null && contactPartner != null) {
    if (partner.getContactPartnerSet() == null) {
      partner.setContactPartnerSet(new HashSet<Partner>());
    }
    partner.getContactPartnerSet().add(contactPartner);
  }
  if (opportunity != null && partner != null) {
    opportunity.setPartner(partner);
  }
  if (partner != null) {
    lead.setPartner(partner);
    partner.save();
  }
  if (contactPartner != null) {
    contactPartner.save();
  }
  if (opportunity != null) {
    opportunity.save();
  }
  if (callEvent != null) {
    callEvent.save();
  }
  if (meetingEvent != null) {
    meetingEvent.save();
  }
  if (taskEvent != null) {
    taskEvent.save();
  }
  lead.setPartner(partner);
  lead.setStatusSelect(ILead.STATUS_CONVERTED);
  lead.save();
  return lead;
}
Program: 59114
Project: 59114
Buggy source:
public ManufOrder createManufOrder(BigDecimal qty,int priority,boolean isToInvoice,Company company,BillOfMaterial billOfMaterial,LocalDateTime plannedStartDateT) throws AxelorException {
  logger.debug("String_Node_Str",priority);
  ProdProcess prodProcess=billOfMaterial.getProdProcess();
  ManufOrder manufOrder=new ManufOrder(isToInvoice,qty,company,this.getManufOrderSeq(),priority,this.isManagedConsumedProduct(billOfMaterial),billOfMaterial,prodProcess,plannedStartDateT,IManufOrder.STATUS_DRAFT);
  for (  ProdProcessLine prodProcessLine : this._sortProdProcessLineByPriority(prodProcess.getProdProcessLineList())) {
    OperationOrder operationOrder=operationOrderService.createOperationOrder(manufOrder,prodProcessLine.getPriority(),isToInvoice,prodProcessLine.getProdResource(),prodProcessLine.getProdResource(),prodProcessLine);
    operationOrder=operationOrderWorkflowService.plan(operationOrder);
    manufOrder.addOperationOrderListItem(operationOrder);
  }
  return manufOrder;
}

Fixed version (ground truth):
public ManufOrder createManufOrder(BigDecimal qty,int priority,boolean isToInvoice,Company company,BillOfMaterial billOfMaterial,LocalDateTime plannedStartDateT) throws AxelorException {
  logger.debug("String_Node_Str",priority);
  ProdProcess prodProcess=billOfMaterial.getProdProcess();
  ManufOrder manufOrder=new ManufOrder(isToInvoice,qty,company,this.getManufOrderSeq(),priority,this.isManagedConsumedProduct(billOfMaterial),billOfMaterial,prodProcess,plannedStartDateT,IManufOrder.STATUS_DRAFT);
  for (  ProdProcessLine prodProcessLine : this._sortProdProcessLineByPriority(prodProcess.getProdProcessLineList())) {
    manufOrder.addOperationOrderListItem(operationOrderService.createOperationOrder(manufOrder,prodProcessLine,isToInvoice));
  }
  if (!manufOrder.getIsConsProOnOperation()) {
    this.createToConsumeProdProductList(manufOrder,billOfMaterial);
  }
  this.createToProduceProdProductList(manufOrder,billOfMaterial);
  return manufOrder;
}
Program: 59115
Project: 59115
Buggy source:
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public ManufOrder generateManufOrder(BigDecimal qty,int priority,boolean isToInvoice,Company company,BillOfMaterial billOfMaterial,LocalDateTime plannedStartDateT) throws AxelorException {
  ManufOrder manufOrder=this.createManufOrder(qty,priority,IS_TO_INVOICE,company,billOfMaterial,plannedStartDateT);
  if (!manufOrder.getIsConsProOnOperation()) {
    this.createToConsumeProdProductList(manufOrder,billOfMaterial);
  }
  this.createToProduceProdProductList(manufOrder,billOfMaterial);
  manufOrder.setStatusSelect(IManufOrder.STATUS_DRAFT);
  return manufOrder.save();
}

Fixed version (ground truth):
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public ManufOrder generateManufOrder(BigDecimal qty,int priority,boolean isToInvoice,Company company,BillOfMaterial billOfMaterial,LocalDateTime plannedStartDateT) throws AxelorException {
  ManufOrder manufOrder=this.createManufOrder(qty,priority,IS_TO_INVOICE,company,billOfMaterial,plannedStartDateT);
  manufOrder=manufOrderWorkflowService.plan(manufOrder);
  return manufOrder.save();
}
Program: 59116
Project: 59116
Buggy source:
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public OperationOrder createOperationOrder(ManufOrder manufOrder,int priority,boolean isToInvoice,ProdResource prodResource,ProdResource machineProdResource,ProdProcessLine prodProcessLine) throws AxelorException {
  logger.debug("String_Node_Str",priority,manufOrder.getManufOrderSeq());
  OperationOrder operationOrder=new OperationOrder(priority,this.computeName(manufOrder,priority),isToInvoice,manufOrder,prodResource,machineProdResource,IOperationOrder.STATUS_DRAFT,prodProcessLine);
  this._createToConsumeProdProductList(operationOrder,prodProcessLine);
  this._createHumanResourceList(operationOrder,machineProdResource);
  operationOrder.setStatusSelect(IOperationOrder.STATUS_DRAFT);
  return operationOrder.save();
}

Fixed version (ground truth):
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public OperationOrder createOperationOrder(ManufOrder manufOrder,int priority,boolean isToInvoice,ProdResource prodResource,ProdResource machineProdResource,ProdProcessLine prodProcessLine) throws AxelorException {
  logger.debug("String_Node_Str",priority,manufOrder.getManufOrderSeq());
  OperationOrder operationOrder=new OperationOrder(priority,this.computeName(manufOrder,priority),isToInvoice,manufOrder,prodResource,machineProdResource,IOperationOrder.STATUS_DRAFT,prodProcessLine);
  this._createToConsumeProdProductList(operationOrder,prodProcessLine);
  this._createHumanResourceList(operationOrder,machineProdResource);
  return operationOrder.save();
}