nus-yam/ex-repair huggingface dataset:
Program: 58699
Project: 58699
Buggy source:
public PaymentInvoice createPaymentInvoice(MoveLine moveLine){
  PaymentInvoice paymentInvoice=new PaymentInvoice();
  paymentInvoice.setMoveLine(moveLine);
  if (moveLine.getDebit().compareTo(BigDecimal.ZERO) > 0) {
    paymentInvoice.setDueAmount(moveLine.getDebit());
  }
 else {
    paymentInvoice.setDueAmount(moveLine.getCredit());
  }
  paymentInvoice.setPaidAmount(moveLine.getAmountPaid());
  paymentInvoice.setAmountRemaining(paymentInvoice.getDueAmount().subtract(paymentInvoice.getPaidAmount()));
  paymentInvoice.setCurrency(moveLine.getMove().getCurrency());
  return paymentInvoice;
}

Fixed version (ground truth):
public PaymentInvoice createPaymentInvoice(MoveLine moveLine) throws AxelorException {
  Move move=moveLine.getMove();
  PaymentInvoice paymentInvoice=new PaymentInvoice();
  paymentInvoice.setMoveLine(moveLine);
  paymentInvoice.setDueAmount(moveLine.getCurrencyAmount());
  BigDecimal paidAmountInElementCurrency=currencyService.getAmountCurrencyConvertedAtDate(move.getCompanyCurrency(),move.getCurrency(),moveLine.getAmountPaid(),moveLine.getDate()).setScale(2,RoundingMode.HALF_EVEN);
  paymentInvoice.setPaidAmount(paidAmountInElementCurrency);
  paymentInvoice.setAmountRemaining(paymentInvoice.getDueAmount().subtract(paymentInvoice.getPaidAmount()));
  paymentInvoice.setCurrency(move.getCurrency());
  return paymentInvoice;
}
Program: 58700
Project: 58700
Buggy source:
@Inject public MoveLineExportService(GeneralService generalService,MoveLineReportService moveLineReportService,SequenceService sequenceService,AccountConfigService accountConfigService,MoveRepository moveRepo,MoveLineRepository moveLineRepo,MoveLineReportRepository moveLineReportRepo,JournalRepository journalRepo,AccountRepository accountRepo,MoveLineService moveLineService,PartnerService partnerService,MetaFilesTemp metaFilesTemp,MetaAttachmentRepository metaAttachmentRepo){
  this.moveLineReportService=moveLineReportService;
  this.sequenceService=sequenceService;
  this.accountConfigService=accountConfigService;
  this.moveRepo=moveRepo;
  this.moveLineRepo=moveLineRepo;
  this.moveLineReportRepo=moveLineReportRepo;
  this.journalRepo=journalRepo;
  this.accountRepo=accountRepo;
  this.moveLineService=moveLineService;
  this.partnerService=partnerService;
  this.metaFilesTemp=metaFilesTemp;
  this.metaAttachmentRepo=metaAttachmentRepo;
  todayTime=generalService.getTodayDateTime();
}

Fixed version (ground truth):
@Inject public MoveLineExportService(GeneralService generalService,MoveLineReportService moveLineReportService,SequenceService sequenceService,AccountConfigService accountConfigService,MoveRepository moveRepo,MoveLineRepository moveLineRepo,MoveLineReportRepository moveLineReportRepo,JournalRepository journalRepo,AccountRepository accountRepo,MoveLineService moveLineService,PartnerService partnerService){
  this.moveLineReportService=moveLineReportService;
  this.sequenceService=sequenceService;
  this.accountConfigService=accountConfigService;
  this.moveRepo=moveRepo;
  this.moveLineRepo=moveLineRepo;
  this.moveLineReportRepo=moveLineReportRepo;
  this.journalRepo=journalRepo;
  this.accountRepo=accountRepo;
  this.moveLineService=moveLineService;
  this.partnerService=partnerService;
  todayTime=generalService.getTodayDateTime();
}
Program: 58703
Project: 58703
Buggy source:
public void exportMoveLine(MoveLineReport moveLineReport) throws AxelorException, IOException {
  moveLineReportService.setStatus(moveLineReport);
switch (moveLineReport.getTypeSelect()) {
case MoveLineReportRepository.EXPORT_SALES:
    this.exportMoveLineTypeSelect6(moveLineReport,false);
  break;
case MoveLineReportRepository.EXPORT_REFUNDS:
this.exportMoveLineTypeSelect7(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_TREASURY:
this.exportMoveLineTypeSelect8(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_PURCHASES:
this.exportMoveLineTypeSelect9(moveLineReport,false);
break;
default :
break;
}
}

Fixed version (ground truth):
public void exportMoveLine(MoveLineReport moveLineReport) throws AxelorException, IOException {
  moveLineReportService.setStatus(moveLineReport);
switch (moveLineReport.getTypeSelect()) {
case MoveLineReportRepository.EXPORT_SALES:
    this.exportMoveLineTypeSelect1006(moveLineReport,false);
  break;
case MoveLineReportRepository.EXPORT_REFUNDS:
this.exportMoveLineTypeSelect1007(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_TREASURY:
this.exportMoveLineTypeSelect1008(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_PURCHASES:
this.exportMoveLineTypeSelect1009(moveLineReport,false);
break;
default :
break;
}
}
Program: 58705
Project: 58705
Buggy source:
public String getMoveLineList(MoveLineReport moveLineReport) throws AxelorException {
  this.buildQuery(moveLineReport);
  int i=1;
  String domainQuery=this.query;
  for (  Object param : params.toArray()) {
    String paramStr="String_Node_Str";
    if (param instanceof Model) {
      paramStr=((Model)param).getId().toString();
    }
 else     if (param instanceof Set) {
      Set<Object> paramSet=(Set<Object>)param;
      for (      Object object : paramSet) {
        if (!paramStr.isEmpty()) {
          paramStr+="String_Node_Str";
        }
        paramStr=((Model)object).getId().toString();
      }
    }
 else     if (param instanceof LocalDate) {
      paramStr="String_Node_Str" + param.toString() + "String_Node_Str";
    }
 else {
      paramStr=param.toString();
    }
    domainQuery=domainQuery.replace("String_Node_Str" + i,paramStr);
    i++;
  }
  log.debug("String_Node_Str",domainQuery);
  return domainQuery;
}

Fixed version (ground truth):
public String getMoveLineList(MoveLineReport moveLineReport) throws AxelorException {
  this.buildQuery(moveLineReport);
  int i=1;
  String domainQuery=this.query;
  for (  Object param : params.toArray()) {
    String paramStr="String_Node_Str";
    if (param instanceof Model) {
      paramStr=((Model)param).getId().toString();
    }
 else     if (param instanceof Set) {
      Set<Object> paramSet=(Set<Object>)param;
      for (      Object object : paramSet) {
        if (!paramStr.isEmpty()) {
          paramStr+="String_Node_Str";
        }
        paramStr+=((Model)object).getId().toString();
      }
    }
 else     if (param instanceof LocalDate) {
      paramStr="String_Node_Str" + param.toString() + "String_Node_Str";
    }
 else {
      paramStr=param.toString();
    }
    domainQuery=domainQuery.replace("String_Node_Str" + i,paramStr);
    i++;
  }
  log.debug("String_Node_Str",domainQuery);
  return domainQuery;
}
Program: 58706
Project: 58706
Buggy source:
/** 
 * @param request
 * @param response
 */
public void replayExport(ActionRequest request,ActionResponse response){
  MoveLineReport moveLineReport=request.getContext().asType(MoveLineReport.class);
  moveLineReport=moveLineReportRepo.find(moveLineReport.getId());
  MoveLineExportService moveLineExportService=Beans.get(MoveLineExportService.class);
  try {
switch (moveLineReport.getTypeSelect()) {
case 6:
      moveLineExportService.exportMoveLineTypeSelect6(moveLineReport,true);
    break;
case 7:
  moveLineExportService.exportMoveLineTypeSelect7(moveLineReport,true);
break;
case 8:
moveLineExportService.exportMoveLineTypeSelect8(moveLineReport,true);
break;
case 9:
moveLineExportService.exportMoveLineTypeSelect9(moveLineReport,true);
break;
default :
break;
}
}
 catch (Exception e) {
TraceBackService.trace(response,e);
}
}

Fixed version (ground truth):
/** 
 * @param request
 * @param response
 */
public void replayExport(ActionRequest request,ActionResponse response){
  MoveLineReport moveLineReport=request.getContext().asType(MoveLineReport.class);
  moveLineReport=moveLineReportRepo.find(moveLineReport.getId());
  MoveLineExportService moveLineExportService=Beans.get(MoveLineExportService.class);
  try {
switch (moveLineReport.getTypeSelect()) {
case MoveLineReportRepository.EXPORT_SALES:
      moveLineExportService.exportMoveLineTypeSelect1006(moveLineReport,true);
    break;
case MoveLineReportRepository.EXPORT_REFUNDS:
  moveLineExportService.exportMoveLineTypeSelect1007(moveLineReport,true);
break;
case MoveLineReportRepository.EXPORT_TREASURY:
moveLineExportService.exportMoveLineTypeSelect1008(moveLineReport,true);
break;
case MoveLineReportRepository.EXPORT_PURCHASES:
moveLineExportService.exportMoveLineTypeSelect1009(moveLineReport,true);
break;
default :
break;
}
}
 catch (Exception e) {
TraceBackService.trace(response,e);
}
}
Program: 58708
Project: 58708
Buggy source:
@Override public MetaModel save(MetaModel metaModel) throws ValidationException {
  if (metaModel.getName().equals("String_Node_Str")) {
    throw new ValidationException(I18n.get("String_Node_Str"));
  }
  if (!metaModel.getCustomised()) {
    boolean addStatus=true;
    for (    MetaField field : metaModel.getMetaFields()) {
      if (field.getName().equals("String_Node_Str")) {
        addStatus=false;
        break;
      }
    }
    if (addStatus) {
      MetaField field=new MetaField("String_Node_Str",false);
      field.setTypeName("String_Node_Str");
      field.setLabel("String_Node_Str");
      field.setFieldType("String_Node_Str");
      metaModel.addMetaField(field);
    }
  }
  if (metaModel.getId() != null) {
    metaModel.setCustomised(true);
    metaModel.setEdited(true);
  }
  recorderService.setUpdateServer();
  return super.save(metaModel);
}

Fixed version (ground truth):
@Override public MetaModel save(MetaModel metaModel) throws ValidationException {
  if (metaModel.getName().equals("String_Node_Str")) {
    throw new ValidationException(I18n.get("String_Node_Str"));
  }
  if (!metaModel.getCustomised()) {
    boolean addStatus=true;
    for (    MetaField field : metaModel.getMetaFields()) {
      if (field.getName().equals("String_Node_Str")) {
        addStatus=false;
        break;
      }
    }
    if (addStatus) {
      MetaField field=new MetaField("String_Node_Str",false);
      field.setTypeName("String_Node_Str");
      field.setLabel("String_Node_Str");
      field.setFieldType("String_Node_Str");
      field.setCustomised(true);
      metaModel.addMetaField(field);
    }
  }
  if (metaModel.getId() != null) {
    metaModel.setCustomised(true);
    metaModel.setEdited(true);
  }
  recorderService.setUpdateServer();
  return super.save(metaModel);
}
Program: 58709
Project: 58709
Buggy source:
private String processValue(Filter filter,String typeName){
  String value=filter.getValue();
  if (value == null) {
    return value;
  }
  String targetType=filter.getTargetType();
  if (targetType != null) {
    typeName=targetType;
  }
  value=value.replace("String_Node_Str","String_Node_Str");
  return value;
}

Fixed version (ground truth):
private String processValue(Filter filter,String typeName){
  String value=filter.getValue();
  if (value == null) {
    return value;
  }
  String targetType=filter.getTargetType();
  if (targetType != null) {
    typeName=targetType;
  }
  value=value.replace("String_Node_Str","String_Node_Str");
  return getTagValue(value,false);
}
Program: 58711
Project: 58711
Buggy source:
/** 
 * Method to get FormView from parent form view or create new if no parent form view.
 * @return FormView
 * @throws JAXBException Exception throws by xml parsing.
 */
private FormView getFormView(ViewBuilder viewBuilder) throws JAXBException {
  FormView formView=null;
  MetaView metaView=viewBuilder.getMetaView();
  ViewBuilder parent=viewBuilder.getParent();
  String viewName=viewBuilder.getName();
  if (metaView != null) {
    ObjectViews objectViews=XMLViews.fromXML(metaView.getXml());
    List<AbstractView> views=objectViews.getViews();
    if (!views.isEmpty()) {
      formView=(FormView)views.get(0);
    }
  }
 else   if (parent != null) {
    formView=builder.getFormView(parent);
  }
 else {
    formView=new FormView();
    formView.setName(viewName);
    formView.setTitle(viewBuilder.getTitle());
    formView.setModel(viewBuilder.getModel());
  }
  formView.setXmlId(viewBuilder.getMetaModule().getName() + "String_Node_Str" + viewName);
  return formView;
}

Fixed version (ground truth):
/** 
 * Method to get FormView from parent form view or create new if no parent form view.
 * @return FormView
 * @throws JAXBException Exception throws by xml parsing.
 */
private FormView getFormView(ViewBuilder viewBuilder) throws JAXBException {
  FormView formView=null;
  MetaView metaView=viewBuilder.getMetaView();
  ViewBuilder parent=viewBuilder.getParent();
  String viewName=viewBuilder.getName();
  if (metaView != null) {
    ObjectViews objectViews=XMLViews.fromXML(metaView.getXml());
    List<AbstractView> views=objectViews.getViews();
    if (!views.isEmpty()) {
      formView=(FormView)views.get(0);
    }
  }
 else   if (parent != null) {
    formView=builderService.getFormView(parent);
  }
 else {
    formView=new FormView();
    formView.setName(viewName);
    formView.setTitle(viewBuilder.getTitle());
    formView.setModel(viewBuilder.getModel());
  }
  formView.setXmlId(viewBuilder.getMetaModule().getName() + "String_Node_Str" + viewName);
  return formView;
}
Program: 58713
Project: 58713
Buggy source:
/** 
 * Root method to accesss the service. It will find all edited and customised MetaModels. Call other methods to process MetaModel founds.
 * @throws AxelorException 
 */
public void build() throws AxelorException {
  try {
    List<MetaModel> customizedModels=metaModelRepo.all().filter("String_Node_Str").fetch();
    removeDeleted(customizedModels);
    List<MetaModel> editedModels=new ArrayList<MetaModel>();
    for (    MetaModel model : customizedModels) {
      if (model.getEdited()) {
        editedModels.add(model);
      }
    }
    recordModel(editedModels.iterator());
    updateEdited(editedModels);
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new AxelorException(I18n.get("String_Node_Str"),4,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Root method to access the service. It will find all edited and customised MetaModels. Call other methods to process MetaModel founds.
 * @throws AxelorException 
 */
public void build() throws AxelorException {
  try {
    List<MetaModel> customizedModels=metaModelRepo.all().filter("String_Node_Str").fetch();
    checkFiles(customizedModels);
    for (    MetaModel model : customizedModels) {
      if (model.getEdited()) {
        recordModel(model);
        updateEdited(model);
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new AxelorException(I18n.get("String_Node_Str"),4,e.getMessage());
  }
}
Program: 58714
Project: 58714
Buggy source:
/** 
 * Method to reset edited boolean to false when processing of model completed.
 * @param models List of MetaModel to process.
 */
@Transactional public void updateEdited(List<MetaModel> models){
  for (  MetaModel model : models) {
    model.setEdited(false);
    metaModelRepo.save(model);
  }
}

Fixed version (ground truth):
/** 
 * Method to reset edited boolean to false when processing of model completed.
 * @param models List of MetaModel to process.
 */
@Transactional public void updateEdited(MetaModel model){
  model.setEdited(false);
  metaModelRepo.save(model);
}
Program: 58716
Project: 58716
Buggy source:
/** 
 * Method to process workflow. It call node and transition service for nodes and transitions linked with workflow.
 * @param wkf Worklfow to process.
 * @return Exception string if any issue in processing else null.
 */
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public String process(Wkf wkf){
  try {
    workflow=wkf;
    inflector=Inflector.getInstance();
    moduleName=wkf.getMetaModule().getName();
    dasherizeModel=inflector.dasherize(workflow.getMetaModel().getName());
    viewBuilder=wkf.getViewBuilder();
    ActionGroup actionGroup=nodeService.process();
    viewBuilder.setEdited(true);
    addWkfStatusView(viewBuilder,workflow.getDisplayTypeSelect());
    transitionService.process(actionGroup);
    trackingService.addTracking(viewBuilder);
    viewBuilderRepo.save(viewBuilder);
    workflow.setEdited(false);
    wkfRepo.save(workflow);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return e.toString();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Method to process workflow. It call node and transition service for nodes and transitions linked with workflow.
 * @param wkf Worklfow to process.
 * @return Exception string if any issue in processing else null.
 */
@Transactional(rollbackOn={AxelorException.class,Exception.class}) public String process(Wkf wkf){
  try {
    workflow=wkf;
    inflector=Inflector.getInstance();
    moduleName=wkf.getMetaModule().getName();
    dasherizeModel=inflector.dasherize(workflow.getMetaModel().getName());
    viewBuilder=wkf.getViewBuilder();
    ActionGroup actionGroup=nodeService.process();
    viewBuilder.setEdited(true);
    addWkfStatusView(viewBuilder,workflow.getDisplayTypeSelect());
    transitionService.process(actionGroup);
    trackingService.addTracking(viewBuilder);
    viewBuilderRepo.save(viewBuilder);
    workflow.setEdited(false);
    workflow.getMetaModel().setEdited(true);
    if (workflow.getWkfField().getMetaModule() == null) {
      workflow.getWkfField().setMetaModule(wkf.getMetaModule());
    }
    wkfRepo.save(workflow);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return e.toString();
  }
  return null;
}
Program: 58717
Project: 58717
Buggy source:
private List<Option> getSelect(MetaField wkfField){
  if (wkfField == null) {
    return null;
  }
  MetaSelect select=wkfField.getMetaSelect();
  if (select != null) {
    return MetaStore.getSelectionList(select.getName());
  }
 else {
    String clsName=wkfField.getMetaModel().getFullName();
    try {
      Property p=Mapper.of(Class.forName(clsName)).getProperty(wkfField.getName());
      return MetaStore.getSelectionList(p.getSelection());
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
private List<Option> getSelect(MetaField wkfField){
  if (wkfField == null) {
    return null;
  }
  MetaSelect select=wkfField.getMetaSelect();
  if (select != null) {
    return MetaStore.getSelectionList(select.getName());
  }
 else {
    String clsName=wkfField.getMetaModel().getFullName();
    try {
      Property p=Mapper.of(Class.forName(clsName)).getProperty(wkfField.getName());
      if (p != null && p.getSelection() != null) {
        return MetaStore.getSelectionList(p.getSelection());
      }
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  return null;
}
Program: 58718
Project: 58718
Buggy source:
public void generateLeaveManagementLines(List<Employee> employeeList){
  for (  Employee employee : employeeList) {
    try {
      createLeaveManagement(employeeRepository.find(employee.getId()));
    }
 catch (    AxelorException e) {
      TraceBackService.trace(e,IException.SENIORITY_LEAVE_MANAGEMENT,batch.getId());
      incrementAnomaly();
      if (e.getcategory() == IException.NO_VALUE) {
        noValueAnomaly++;
      }
      if (e.getcategory() == IException.CONFIGURATION_ERROR) {
        confAnomaly++;
      }
    }
 finally {
      total++;
      JPA.clear();
    }
  }
}

Fixed version (ground truth):
public void generateLeaveManagementLines(List<Employee> employeeList){
  for (  Employee employee : employeeList) {
    try {
      createLeaveManagement(employeeRepository.find(employee.getId()));
    }
 catch (    AxelorException e) {
      TraceBackService.trace(e,IException.LEAVE_MANAGEMENT,batch.getId());
      incrementAnomaly();
      if (e.getcategory() == IException.NO_VALUE) {
        noValueAnomaly++;
      }
      if (e.getcategory() == IException.CONFIGURATION_ERROR) {
        confAnomaly++;
      }
    }
 finally {
      total++;
      JPA.clear();
    }
  }
}
Program: 58719
Project: 58719
Buggy source:
public ImportHistory run() throws AxelorException, IOException {
  File bind=MetaFiles.getPath(configuration.getBindMetaFile()).toFile(), data=MetaFiles.getPath(configuration.getDataMetaFile()).toFile();
  if (!bind.exists() || !data.exists()) {
    throw new AxelorException(I18n.get(IExceptionMessage.IMPORTER_1),IException.CONFIGURATION_ERROR);
  }
  File workspace=createFinalWorkspace(data);
  ImportHistory importHistory=process(bind.getAbsolutePath(),workspace.getAbsolutePath());
  deleteFinalWorkspace(workspace);
  log.debug("String_Node_Str",importHistory.getLog());
  return importHistory;
}

Fixed version (ground truth):
public ImportHistory run() throws AxelorException, IOException {
  File bind=MetaFiles.getPath(configuration.getBindMetaFile()).toFile(), data=MetaFiles.getPath(configuration.getDataMetaFile()).toFile();
  if (!bind.exists()) {
    throw new AxelorException(I18n.get(IExceptionMessage.IMPORTER_1),IException.CONFIGURATION_ERROR);
  }
  if (!data.exists()) {
    throw new AxelorException(I18n.get(IExceptionMessage.IMPORTER_2),IException.CONFIGURATION_ERROR);
  }
  File workspace=createFinalWorkspace(configuration.getDataMetaFile());
  ImportHistory importHistory=process(bind.getAbsolutePath(),workspace.getAbsolutePath());
  deleteFinalWorkspace(workspace);
  log.debug("String_Node_Str",importHistory.getLog());
  return importHistory;
}
Program: 58720
Project: 58720
Buggy source:
protected File createFinalWorkspace(File data) throws IOException {
  File finalWorkspace=new File(workspace,computeFinalWorkspaceName(data));
  finalWorkspace.mkdir();
  if (isZip(data)) {
    unZip(data,finalWorkspace);
  }
 else {
    FileUtils.copyFileToDirectory(data,finalWorkspace);
  }
  return finalWorkspace;
}

Fixed version (ground truth):
protected File createFinalWorkspace(MetaFile metaFile) throws IOException {
  File data=MetaFiles.getPath(metaFile).toFile();
  File finalWorkspace=new File(workspace,computeFinalWorkspaceName(data));
  finalWorkspace.mkdir();
  if (isZip(data)) {
    unZip(data,finalWorkspace);
  }
 else {
    FileUtils.copyFile(data,new File(finalWorkspace,metaFile.getFileName()));
  }
  return finalWorkspace;
}
Program: 58721
Project: 58721
Buggy source:
public void exportMoveLine(MoveLineReport moveLineReport) throws AxelorException, IOException {
  moveLineReportService.setStatus(moveLineReport);
switch (moveLineReport.getTypeSelect()) {
case MoveLineReportRepository.EXPORT_SALES:
    this.exportMoveLineTypeSelect6(moveLineReport,false);
  break;
case MoveLineReportRepository.EXPORT_REFUNDS:
this.exportMoveLineTypeSelect7(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_TREASURY:
this.exportMoveLineTypeSelect8(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_PURCHASES:
this.exportMoveLineTypeSelect9(moveLineReport,false);
break;
default :
break;
}
}

Fixed version (ground truth):
public void exportMoveLine(MoveLineReport moveLineReport) throws AxelorException, IOException {
  moveLineReportService.setStatus(moveLineReport);
switch (moveLineReport.getTypeSelect()) {
case MoveLineReportRepository.EXPORT_SALES:
    this.exportMoveLineTypeSelect1006(moveLineReport,false);
  break;
case MoveLineReportRepository.EXPORT_REFUNDS:
this.exportMoveLineTypeSelect1007(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_TREASURY:
this.exportMoveLineTypeSelect1008(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_PURCHASES:
this.exportMoveLineTypeSelect1009(moveLineReport,false);
break;
case MoveLineReportRepository.EXPORT_PAYROLL_JOURNAL_ENTRY:
this.exportMoveLineTypeSelect1000(moveLineReport);
break;
default :
break;
}
}
Program: 58723
Project: 58723
Buggy source:
public String getMoveLineList(MoveLineReport moveLineReport) throws AxelorException {
  this.buildQuery(moveLineReport);
  int i=1;
  String domainQuery=this.query;
  for (  Object param : params.toArray()) {
    String paramStr="String_Node_Str";
    if (param instanceof Model) {
      paramStr=((Model)param).getId().toString();
    }
 else     if (param instanceof Set) {
      Set<Object> paramSet=(Set<Object>)param;
      for (      Object object : paramSet) {
        if (!paramStr.isEmpty()) {
          paramStr+="String_Node_Str";
        }
        paramStr=((Model)object).getId().toString();
      }
    }
 else     if (param instanceof LocalDate) {
      paramStr="String_Node_Str" + param.toString() + "String_Node_Str";
    }
 else {
      paramStr=param.toString();
    }
    domainQuery=domainQuery.replace("String_Node_Str" + i,paramStr);
    i++;
  }
  log.debug("String_Node_Str",domainQuery);
  return domainQuery;
}

Fixed version (ground truth):
public String getMoveLineList(MoveLineReport moveLineReport) throws AxelorException {
  this.buildQuery(moveLineReport);
  int i=1;
  String domainQuery=this.query;
  for (  Object param : params.toArray()) {
    String paramStr="String_Node_Str";
    if (param instanceof Model) {
      paramStr=((Model)param).getId().toString();
    }
 else     if (param instanceof Set) {
      Set<Object> paramSet=(Set<Object>)param;
      for (      Object object : paramSet) {
        if (!paramStr.isEmpty()) {
          paramStr+="String_Node_Str";
        }
        paramStr+=((Model)object).getId().toString();
      }
    }
 else     if (param instanceof LocalDate) {
      paramStr="String_Node_Str" + param.toString() + "String_Node_Str";
    }
 else {
      paramStr=param.toString();
    }
    domainQuery=domainQuery.replace("String_Node_Str" + i,paramStr);
    i++;
  }
  log.debug("String_Node_Str",domainQuery);
  return domainQuery;
}
Program: 58724
Project: 58724
Buggy source:
public void sign(ActionRequest request,ActionResponse response) throws AxelorException {
  BankOrder bankOrder=JPA.em().find(BankOrder.class,new Long((Integer)((Map)request.getContext().get("String_Node_Str")).get("String_Node_Str")));
  EbicsUser ebicsUser=new EbicsUser();
  String password=null;
  if (request.getContext().get("String_Node_Str") != null) {
    ebicsUser=JPA.em().find(EbicsUser.class,new Long((Integer)((Map)request.getContext().get("String_Node_Str")).get("String_Node_Str")));
  }
 else   response.setError(I18n.get(IExceptionMessage.EBICS_MISSING_NAME));
  if (request.getContext().get("String_Node_Str") != null) {
    password=(String)request.getContext().get("String_Node_Str");
  }
 else   response.setError(I18n.get(IExceptionMessage.EBICS_MISSING_PASSWORD));
  if (!ebicsUser.getPassword().equals(password)) {
    response.setValue("String_Node_Str","String_Node_Str");
    response.setError(I18n.get(IExceptionMessage.EBICS_WRONG_PASSWORD));
  }
 else {
    bankOrderService.sign(bankOrder);
  }
}

Fixed version (ground truth):
public void sign(ActionRequest request,ActionResponse response) throws AxelorException {
  BankOrder bankOrder=JPA.em().find(BankOrder.class,new Long((Integer)((Map)request.getContext().get("String_Node_Str")).get("String_Node_Str")));
  EbicsUser ebicsUser=new EbicsUser();
  String password=null;
  if (request.getContext().get("String_Node_Str") != null) {
    ebicsUser=JPA.em().find(EbicsUser.class,new Long((Integer)((Map)request.getContext().get("String_Node_Str")).get("String_Node_Str")));
  }
 else   response.setError(I18n.get("String_Node_Str"));
  if (request.getContext().get("String_Node_Str") != null) {
    password=(String)request.getContext().get("String_Node_Str");
  }
 else   response.setError(I18n.get("String_Node_Str"));
  if (!ebicsUser.getPassword().equals(password)) {
    response.setValue("String_Node_Str","String_Node_Str");
    response.setError(I18n.get(IExceptionMessage.EBICS_WRONG_PASSWORD));
  }
 else {
    bankOrderService.sign(bankOrder);
  }
}
Program: 58727
Project: 58727
Buggy source:
/** 
 * Sets the user certificates
 */
private void setUserCertificates(){
  user.setA005Certificate(a005Certificate.toString());
  user.setX002Certificate(x002Certificate.toString());
  user.setE002Certificate(e002Certificate.toString());
}

Fixed version (ground truth):
/** 
 * Sets the user certificates
 */
private void setUserCertificates(){
  user.setA005Certificate(a005Certificate.toString());
  user.setX002Certificate(x002Certificate.toString());
  user.setE002Certificate(e002Certificate.toString());
  user.setA005PrivateKey(a005PrivateKey.toString());
  user.setX002PrivateKey(x002PrivateKey.toString());
  user.setE002PrivateKey(e002PrivateKey.toString());
}
Program: 58729
Project: 58729
Buggy source:
private Action createActionView(MetaModel model,ActionBuilder actionBuilder){
  ViewBuilder viewBuilder=actionBuilder.getViewBuilder();
  String viewName=viewBuilder.getName();
  String viewType=viewBuilder.getViewType();
  String title=viewBuilder.getTitle();
  ActionViewBuilder builder=ActionView.define(title);
  builder.add(viewType,viewName);
  builder.name(actionBuilder.getName());
  builder.param("String_Node_Str",actionBuilder.getPopup().toString());
  if (!viewType.equals("String_Node_Str")) {
    viewType=viewType.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
    builder.add(viewType);
    if (model != null) {
      builder.model(model.getFullName());
    }
    updateDomainContext(builder,actionBuilder);
  }
  return builder.get();
}

Fixed version (ground truth):
private Action createActionView(MetaModel model,ActionBuilder actionBuilder){
  ViewBuilder viewBuilder=actionBuilder.getViewBuilder();
  String viewName=null;
  String viewType=null;
  String title=null;
  if (viewBuilder != null) {
    viewName=viewBuilder.getName();
    viewType=viewBuilder.getViewType();
    title=viewBuilder.getTitle();
  }
  MetaView view=actionBuilder.getMetaView();
  if (view != null) {
    viewName=view.getName();
    viewType=view.getType();
    title=view.getTitle();
  }
  if (actionBuilder.getTitle() != null) {
    title=actionBuilder.getTitle();
  }
  ActionViewBuilder builder=ActionView.define(title);
  builder.add(viewType,viewName);
  builder.name(actionBuilder.getName());
  builder.param("String_Node_Str",actionBuilder.getPopup().toString());
  if (!viewType.equals("String_Node_Str")) {
    viewType=viewType.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
    builder.add(viewType);
    if (model != null) {
      builder.model(model.getFullName());
    }
    if (actionBuilder.getDomainCondition() != null) {
      builder=addDomainContext(builder,actionBuilder);
    }
 else {
      processFilters(builder,actionBuilder);
    }
  }
  return builder.get();
}
Program: 58730
Project: 58730
Buggy source:
private void processActionBuilder(Iterator<ActionBuilder> actionIter){
  if (!actionIter.hasNext()) {
    return;
  }
  ActionBuilder actionBuilder=actionIter.next();
  log.debug("String_Node_Str",actionBuilder.getName(),actionBuilder.getTypeSelect());
  MetaModel model=getModel(actionBuilder);
  log.debug("String_Node_Str",model);
  Integer actionType=actionBuilder.getTypeSelect();
  Action action=null;
switch (actionType) {
case 0:
    action=createActionRecord(model,actionBuilder,true);
  break;
case 1:
action=createActionRecord(model,actionBuilder,false);
break;
case 2:
action=createActionView(model,actionBuilder);
break;
case 3:
action=createActionReport(model,actionBuilder);
break;
case 4:
action=createActionEmail(model,actionBuilder);
break;
case 5:
action=createActionValidation(actionBuilder);
break;
default :
processActionBuilder(actionIter);
}
String modelName="String_Node_Str";
if (model != null) {
modelName=model.getFullName();
}
updateModelActionMap(modelName,action);
processActionBuilder(actionIter);
}

Fixed version (ground truth):
private void processActionBuilder(Iterator<ActionBuilder> actionIter){
  if (!actionIter.hasNext()) {
    return;
  }
  ActionBuilder actionBuilder=actionIter.next();
  log.debug("String_Node_Str",actionBuilder.getName(),actionBuilder.getTypeSelect());
  MetaModel model=getModel(actionBuilder);
  log.debug("String_Node_Str",model);
  Integer actionType=actionBuilder.getTypeSelect();
  Action action=null;
switch (actionType) {
case 0:
    action=createActionRecord(model,actionBuilder,true);
  break;
case 1:
action=createActionRecord(model,actionBuilder,false);
break;
case 2:
action=createActionView(model,actionBuilder);
break;
case 3:
action=createActionReport(model,actionBuilder);
break;
case 4:
action=createActionEmail(model,actionBuilder);
break;
case 5:
action=createActionValidation(actionBuilder);
break;
}
if (action != null) {
String modelName="String_Node_Str";
if (model != null) {
modelName=model.getFullName();
}
action.setXmlId(actionBuilder.getMetaModule().getName() + "String_Node_Str" + action.getName());
updateModelActionMap(modelName,action);
}
processActionBuilder(actionIter);
}
Program: 58731
Project: 58731
Buggy source:
public List<AbstractWidget> processItems(List<ViewItem> viewItems,Panel panel,String level){
  List<AbstractWidget> items=new ArrayList<AbstractWidget>();
  for (  ViewItem viewItem : viewItems) {
    Integer type=viewItem.getTypeSelect();
switch (type) {
case 0:
      String fieldType=viewItem.getFieldType();
    if (fieldType != null && viewItem.getNestedViewItems().isEmpty() && "String_Node_Str".contains(fieldType)) {
      setPanelRelated(viewItem,items,level);
    }
 else {
      items.add(createField(viewItem));
    }
  checkDefaultValues(fieldType,viewItem);
break;
case 1:
if (viewItem.getPanelTop()) {
setMenuItem(viewItem,panel);
}
 else {
items.add(getButton(viewItem));
}
break;
case 2:
setLabel(viewItem,items);
break;
case 3:
setSpacer(viewItem,items);
}
}
return items;
}

Fixed version (ground truth):
public List<AbstractWidget> processItems(List<ViewItem> viewItems,Panel panel,String level){
  List<AbstractWidget> items=new ArrayList<AbstractWidget>();
  for (  ViewItem viewItem : viewItems) {
    Integer type=viewItem.getTypeSelect();
switch (type) {
case 0:
      String fieldType=viewItem.getFieldType();
    if (isPanelRelated(fieldType,viewItem)) {
      setPanelRelated(viewItem,items,level);
    }
 else {
      items.add(createField(viewItem));
    }
  checkDefaultValues(fieldType,viewItem);
break;
case 1:
if (viewItem.getPanelTop()) {
setMenuItem(viewItem,panel);
}
 else {
items.add(getButton(viewItem));
}
break;
case 2:
setLabel(viewItem,items);
break;
case 3:
setSpacer(viewItem,items);
break;
case 4:
setDashlet(viewItem,items);
break;
}
}
return items;
}
Program: 58732
Project: 58732
Buggy source:
/** 
 * Method to update AbstractPanel from ViewPanel of formView .
 * @param abstractPanel Destination panel to be updated.
 * @param viewPanel Source panel.
 */
private AbstractPanel updatePanel(AbstractPanel abstractPanel,ViewPanel viewPanel){
  abstractPanel.setTitle(viewPanel.getTitle());
  String colspan=viewPanel.getColspan();
  if (colspan != null && StringUtils.isNumeric(colspan)) {
    abstractPanel.setColSpan(Integer.parseInt(colspan));
  }
  abstractPanel.setName(viewPanel.getName());
  if (abstractPanel instanceof Panel) {
    List<AbstractWidget> panelItems=new ArrayList<AbstractWidget>();
    Panel panel=(Panel)abstractPanel;
    if (panel.getItems() != null) {
      panelItems=panel.getItems();
    }
    List<ViewItem> itemList=viewPanel.getViewItemList();
    List<AbstractWidget> items=processItems(itemList,panel,viewPanel.getPanelLevel());
    if (viewPanel.getPlace() == 0) {
      panelItems.addAll(0,items);
    }
 else {
      panelItems.addAll(items);
    }
    if (viewPanel.getReadonly()) {
      panel.setReadonly(true);
    }
    panel.setReadonlyIf(viewPanel.getReadonlyIf());
    if (viewPanel.getHidden()) {
      panel.setHidden(true);
    }
    panel.setHideIf(viewPanel.getHideIf());
    panel.setShowIf(viewPanel.getShowIf());
    panel.setModuleToCheck(viewPanel.getIfModule());
    panel.setConditionToCheck(viewPanel.getIfConfig());
    panel.setItems(panelItems);
    return panel;
  }
  return abstractPanel;
}

Fixed version (ground truth):
/** 
 * Method to update AbstractPanel from ViewPanel of formView .
 * @param abstractPanel Destination panel to be updated.
 * @param viewPanel Source panel.
 */
private AbstractPanel updatePanel(AbstractPanel abstractPanel,ViewPanel viewPanel){
  abstractPanel.setTitle(viewPanel.getTitle());
  String colspan=viewPanel.getColspan();
  if (colspan != null && StringUtils.isNumeric(colspan)) {
    abstractPanel.setColSpan(Integer.parseInt(colspan));
  }
  abstractPanel.setName(viewPanel.getName());
  abstractPanel.setShowIf(viewPanel.getShowIf());
  abstractPanel.setModuleToCheck(viewPanel.getIfModule());
  abstractPanel.setConditionToCheck(viewPanel.getIfConfig());
  abstractPanel.setReadonlyIf(viewPanel.getReadonlyIf());
  abstractPanel.setHideIf(viewPanel.getHideIf());
  if (viewPanel.getReadonly()) {
    abstractPanel.setReadonly(true);
  }
  if (viewPanel.getHidden()) {
    abstractPanel.setHidden(true);
  }
  if (abstractPanel instanceof Panel) {
    List<AbstractWidget> panelItems=new ArrayList<AbstractWidget>();
    Panel panel=(Panel)abstractPanel;
    if (panel.getItems() != null) {
      panelItems=panel.getItems();
    }
    List<ViewItem> itemList=viewPanel.getViewItemList();
    List<AbstractWidget> items=processItems(itemList,panel,viewPanel.getPanelLevel());
    if (viewPanel.getPlace() == 0) {
      panelItems.addAll(0,items);
    }
 else {
      panelItems.addAll(items);
    }
    panel.setItems(panelItems);
    return panel;
  }
  return abstractPanel;
}
Program: 58736
Project: 58736
Buggy source:
@Override public void savePurchaseOrderPDFAsAttachment(PurchaseOrder purchaseOrder) throws AxelorException {
  String language="String_Node_Str";
  try {
    language=purchaseOrder.getSupplierPartner().getLanguageSelect() != null ? purchaseOrder.getSupplierPartner().getLanguageSelect() : purchaseOrder.getCompany().getPrintingSettings().getLanguageSelect() != null ? purchaseOrder.getCompany().getPrintingSettings().getLanguageSelect() : "String_Node_Str";
  }
 catch (  NullPointerException e) {
    language="String_Node_Str";
  }
  language=language.equals("String_Node_Str") ? "String_Node_Str" : language;
  String title=I18n.get("String_Node_Str") + purchaseOrder.getPurchaseOrderSeq() + ((purchaseOrder.getVersionNumber() > 1) ? "String_Node_Str" + purchaseOrder.getVersionNumber() : "String_Node_Str");
  ReportFactory.createReport(IReport.PURCHASE_ORDER,title + "String_Node_Str").addParam("String_Node_Str",purchaseOrder.getId()).addParam("String_Node_Str",language).addModel(purchaseOrder).generate().getFileLink();
}

Fixed version (ground truth):
@Override public void savePurchaseOrderPDFAsAttachment(PurchaseOrder purchaseOrder) throws AxelorException {
  String language="String_Node_Str";
  try {
    language=purchaseOrder.getSupplierPartner().getLanguageSelect() != null ? purchaseOrder.getSupplierPartner().getLanguageSelect() : purchaseOrder.getCompany().getPrintingSettings().getLanguageSelect() != null ? purchaseOrder.getCompany().getPrintingSettings().getLanguageSelect() : "String_Node_Str";
  }
 catch (  NullPointerException e) {
    language="String_Node_Str";
  }
  language=language.equals("String_Node_Str") ? "String_Node_Str" : language;
  String title=I18n.get("String_Node_Str") + purchaseOrder.getPurchaseOrderSeq() + ((purchaseOrder.getVersionNumber() > 1) ? "String_Node_Str" + purchaseOrder.getVersionNumber() : "String_Node_Str");
  ReportFactory.createReport(IReport.PURCHASE_ORDER,title + "String_Node_Str").addParam("String_Node_Str",purchaseOrder.getId().toString()).addParam("String_Node_Str",language).addModel(purchaseOrder).generate().getFileLink();
}
Program: 58737
Project: 58737
Buggy source:
public void computeFullName(TimesheetLine timesheetLine){
  try {
    timesheetLine.setFullName(timesheetLine.getAffectedToTimeSheet().getFullName() + "String_Node_Str" + timesheetLine.getDate()+ "String_Node_Str"+ timesheetLine.getId());
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void computeFullName(TimesheetLine timesheetLine){
  timesheetLine.setFullName(timesheetLine.getAffectedToTimeSheet().getFullName() + "String_Node_Str" + timesheetLine.getDate()+ "String_Node_Str"+ timesheetLine.getId());
}
Program: 58738
Project: 58738
Buggy source:
@Override public TimesheetLine save(TimesheetLine timesheetLine){
  computeFullName(timesheetLine);
  return super.save(timesheetLine);
}

Fixed version (ground truth):
@Override public TimesheetLine save(TimesheetLine timesheetLine){
  try {
    computeFullName(timesheetLine);
    return super.save(timesheetLine);
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}
Program: 58739
Project: 58739
Buggy source:
@Override @Transactional(rollbackOn={Exception.class}) public void cancelTimesheet(Timesheet timesheet){
  timesheet.setStatusSelect(TimesheetRepository.STATUS_CANCELED);
  List<TimesheetLine> timesheetLineList=timesheet.getTimesheetLineList();
  for (  TimesheetLine timesheetLine : timesheetLineList) {
    if (timesheetLine.getProjectTask() != null)     timesheetLine.setAffectedToTimeSheet(null);
  }
  Beans.get(TimesheetRepository.class).save(timesheet);
}

Fixed version (ground truth):
@Override @Transactional(rollbackOn={Exception.class}) public void cancelTimesheet(Timesheet timesheet){
  timesheet.setStatusSelect(TimesheetRepository.STATUS_CANCELED);
  Beans.get(TimesheetRepository.class).save(timesheet);
}
Program: 58740
Project: 58740
Buggy source:
@Override @Transactional public PurchaseOrder mergePurchaseOrders(List<PurchaseOrder> purchaseOrderList,Currency currency,Partner supplierPartner,Company company,Partner contactPartner,PriceList priceList) throws AxelorException {
  String numSeq="String_Node_Str";
  String externalRef="String_Node_Str";
  for (  PurchaseOrder purchaseOrderLocal : purchaseOrderList) {
    if (!numSeq.isEmpty()) {
      numSeq+="String_Node_Str";
    }
    numSeq+=purchaseOrderLocal.getPurchaseOrderSeq();
    if (!externalRef.isEmpty()) {
      externalRef+="String_Node_Str";
    }
    if (purchaseOrderLocal.getExternalReference() != null) {
      externalRef+=purchaseOrderLocal.getExternalReference();
    }
  }
  PurchaseOrder purchaseOrderMerged=this.createPurchaseOrder(AuthUtils.getUser(),company,contactPartner,currency,null,numSeq,externalRef,LocalDate.now(),priceList,supplierPartner);
  for (  PurchaseOrder purchaseOrder : purchaseOrderList) {
    int countLine=1;
    for (    PurchaseOrderLine purchaseOrderLine : purchaseOrder.getPurchaseOrderLineList()) {
      purchaseOrderLine.setSequence(countLine * 10);
      purchaseOrderMerged.addPurchaseOrderLineListItem(purchaseOrderLine);
      countLine++;
    }
  }
  this.computePurchaseOrder(purchaseOrderMerged);
  purchaseOrderRepo.save(purchaseOrderMerged);
  for (  PurchaseOrder purchaseOrder : purchaseOrderList) {
    purchaseOrderRepo.remove(purchaseOrder);
  }
  return purchaseOrderMerged;
}

Fixed version (ground truth):
@Override @Transactional public PurchaseOrder mergePurchaseOrders(List<PurchaseOrder> purchaseOrderList,Currency currency,Partner supplierPartner,Company company,Partner contactPartner,PriceList priceList) throws AxelorException {
  String numSeq="String_Node_Str";
  String externalRef="String_Node_Str";
  for (  PurchaseOrder purchaseOrderLocal : purchaseOrderList) {
    if (!numSeq.isEmpty()) {
      numSeq+="String_Node_Str";
    }
    numSeq+=purchaseOrderLocal.getPurchaseOrderSeq();
    if (!externalRef.isEmpty()) {
      externalRef+="String_Node_Str";
    }
    if (purchaseOrderLocal.getExternalReference() != null) {
      externalRef+=purchaseOrderLocal.getExternalReference();
    }
  }
  PurchaseOrder purchaseOrderMerged=this.createPurchaseOrder(AuthUtils.getUser(),company,contactPartner,currency,null,numSeq,externalRef,LocalDate.now(),priceList,supplierPartner);
  this.attachToNewPurchaseOrder(purchaseOrderList,purchaseOrderMerged);
  this.computePurchaseOrder(purchaseOrderMerged);
  purchaseOrderRepo.save(purchaseOrderMerged);
  this.removeOldPurchaseOrders(purchaseOrderList);
  return purchaseOrderMerged;
}
Program: 58741
Project: 58741
Buggy source:
@Override public TSTimer save(TSTimer tsTimer){
  if (tsTimer.getStatusSelect() == TSTimerRepository.STATUS_STOP) {
    if (tsTimer.getTimeSheetLine() != null)     updateTimesheetLine(tsTimer);
 else     tsTimerService.generateTimesheetLine(tsTimer);
  }
  return super.save(tsTimer);
}

Fixed version (ground truth):
@Override public TSTimer save(TSTimer tsTimer){
  if (tsTimer.getStatusSelect() == TSTimerRepository.STATUS_STOP) {
    if (tsTimer.getTimesheetLine() != null)     updateTimesheetLine(tsTimer);
 else     tsTimerService.generateTimesheetLine(tsTimer);
  }
  return super.save(tsTimer);
}
Program: 58742
Project: 58742
Buggy source:
public void updateTimesheetLine(TSTimer tsTimer){
  TimesheetLine timesheetLine=tsTimer.getTimeSheetLine();
  timesheetLine.setProjectTask(tsTimer.getProjectTask());
  timesheetLine.setProduct(tsTimer.getProduct());
  timesheetLine.setDurationStored(BigDecimal.valueOf(tsTimer.getDuration() / 3600));
  timesheetLine.setComments(tsTimer.getComments());
  Beans.get(TimesheetLineRepository.class).save(timesheetLine);
}

Fixed version (ground truth):
public void updateTimesheetLine(TSTimer tsTimer){
  TimesheetLine timesheetLine=tsTimer.getTimesheetLine();
  timesheetLine.setProjectTask(tsTimer.getProjectTask());
  timesheetLine.setProduct(tsTimer.getProduct());
  timesheetLine.setDurationStored(tsTimerService.convertSecondDurationInHours(tsTimer.getDuration()));
  timesheetLine.setComments(tsTimer.getComments());
  Beans.get(TimesheetLineRepository.class).save(timesheetLine);
}
Program: 58743
Project: 58743
Buggy source:
public String computeFullName(Timesheet timeSheet);

Fixed version (ground truth):
public String computeFullName(Timesheet timesheet);
Program: 58744
Project: 58744
Buggy source:
public String computeFullName(Timesheet timeSheet){
  if (timeSheet.getUser() != null && timeSheet.getCreatedOn() != null) {
    return timeSheet.getUser().getFullName() + "String_Node_Str" + timeSheet.getCreatedOn().getDayOfMonth()+ "String_Node_Str"+ timeSheet.getCreatedOn().getMonthOfYear()+ "String_Node_Str"+ timeSheet.getCreatedOn().getYear()+ "String_Node_Str"+ timeSheet.getCreatedOn().getHourOfDay()+ "String_Node_Str"+ timeSheet.getCreatedOn().getMinuteOfHour();
  }
 else   if (timeSheet.getUser() != null) {
    return timeSheet.getUser().getFullName() + "String_Node_Str" + timeSheet.getId();
  }
 else {
    return "String_Node_Str" + timeSheet.getId();
  }
}

Fixed version (ground truth):
public String computeFullName(Timesheet timesheet){
  User timesheetUser=timesheet.getUser();
  LocalDateTime createdOn=timesheet.getCreatedOn();
  if (timesheetUser != null && createdOn != null) {
    return timesheetUser.getFullName() + "String_Node_Str" + createdOn.getDayOfMonth()+ "String_Node_Str"+ createdOn.getMonthOfYear()+ "String_Node_Str"+ timesheet.getCreatedOn().getYear()+ "String_Node_Str"+ createdOn.getHourOfDay()+ "String_Node_Str"+ createdOn.getMinuteOfHour();
  }
 else   if (timesheetUser != null) {
    return timesheetUser.getFullName() + "String_Node_Str" + timesheet.getId();
  }
 else {
    return "String_Node_Str" + timesheet.getId();
  }
}
Program: 58745
Project: 58745
Buggy source:
public List<TimesheetLine> computeVisibleDuration(Timesheet timesheet){
  List<TimesheetLine> timesheetLineList=timesheet.getTimesheetLineList();
  for (  TimesheetLine timesheetLine : timesheetLineList)   timesheetLine.setVisibleDuration(Beans.get(EmployeeService.class).getUserDuration(timesheetLine.getDurationStored(),timesheetLine.getUser().getEmployee().getDailyWorkHours(),false));
  timesheetLineList=projectTaskService._sortTimesheetLineByDate(timesheetLineList);
  return timesheetLineList;
}

Fixed version (ground truth):
public List<TimesheetLine> computeVisibleDuration(Timesheet timesheet){
  List<TimesheetLine> timesheetLineList=timesheet.getTimesheetLineList();
  Employee timesheetEmployee=timesheet.getUser().getEmployee();
  BigDecimal employeeDailyWorkHours=timesheetEmployee.getDailyWorkHours();
  for (  TimesheetLine timesheetLine : timesheetLineList) {
    timesheetLine.setVisibleDuration(employeeService.getUserDuration(timesheetLine.getDurationStored(),employeeDailyWorkHours,false));
  }
  timesheetLineList=projectTaskService._sortTimesheetLineByDate(timesheetLineList);
  return timesheetLineList;
}