nus-yam/ex-repair huggingface dataset:
Program: 58520
Project: 58520
Buggy source:
/** 
 * Create toolbar ViewButton in ViewBuilder from WkfTransition. Method called if WkfTransition is based on button.
 * @param viewBuilder ViewBuilder to update.
 * @param transition WkfTransition to process.
 * @param condition Condition to show button
 * @param sequence Sequence of button to add in toolbar.
 */
private void addButton(WkfTransition transition,String condition,Integer sequence){
  String source=transition.getSource().getName();
  String title=transition.getButtonTitle();
  String name=wkfService.inflector.camelize(source + "String_Node_Str" + title,true);
  if (name.equals("String_Node_Str") || name.equals("String_Node_Str") || name.equals("String_Node_Str")) {
    name="String_Node_Str" + name;
  }
  wkfButtonNames.add(name);
  MetaJsonField button=wkfService.getJsonField(name,"String_Node_Str");
  button.setTitle(title);
  ;
  button.setShowIf(condition);
  button.setSequence(sequence);
  button.setHiddenInGrid(true);
  button.setIsWkf(true);
  button.setWidgetAttrs("String_Node_Str");
  button.setOnClick(addButtonActions(transition,name));
  log.debug("String_Node_Str",button.getName());
  wkfService.saveJsonField(button);
}

Fixed version (ground truth):
/** 
 * Create toolbar ViewButton in ViewBuilder from WkfTransition. Method called if WkfTransition is based on button.
 * @param viewBuilder ViewBuilder to update.
 * @param transition WkfTransition to process.
 * @param condition Condition to show button
 * @param sequence Sequence of button to add in toolbar.
 */
private void addButton(WkfTransition transition,String condition,Integer sequence){
  String source=transition.getSource().getName();
  String title=transition.getButtonTitle();
  String name=wkfService.inflector.camelize(source + "String_Node_Str" + title,true);
  if (name.equals("String_Node_Str") || name.equals("String_Node_Str") || name.equals("String_Node_Str")) {
    name="String_Node_Str" + name;
  }
  wkfButtonNames.add(name);
  MetaJsonField button=wkfService.getJsonField(name,"String_Node_Str");
  button.setTitle(title);
  ;
  button.setShowIf(condition);
  button.setSequence(sequence);
  button.setVisibleInGrid(false);
  button.setIsWkf(true);
  button.setWidgetAttrs("String_Node_Str");
  button.setOnClick(addButtonActions(transition,name));
  log.debug("String_Node_Str",button.getName());
  wkfService.saveJsonField(button);
}
Program: 58521
Project: 58521
Buggy source:
@Override public Ticket save(Ticket ticket){
  computeSeq(ticket);
  ticketService.computeSLA(ticket);
  ticketService.checkSLAcompleted(ticket);
  return super.save(ticket);
}

Fixed version (ground truth):
@Override public Ticket save(Ticket ticket){
  ticketService.computeSeq(ticket);
  ticketService.computeSLA(ticket);
  ticketService.checkSLAcompleted(ticket);
  return super.save(ticket);
}
Program: 58522
Project: 58522
Buggy source:
public void assignToMeTicket(ActionRequest request,ActionResponse response){
  if (request.getContext().get("String_Node_Str") != null) {
    Ticket ticket=ticketRepo.find((Long)request.getContext().get("String_Node_Str"));
    ticket.setAssignedTo(AuthUtils.getUser());
    ticketRepo.save(ticket);
  }
 else   if (!((List<?>)request.getContext().get("String_Node_Str")).isEmpty()) {
    for (    Ticket ticket : ticketRepo.all().filter("String_Node_Str",request.getContext().get("String_Node_Str")).fetch()) {
      ticket.setAssignedTo(AuthUtils.getUser());
      ticketRepo.save(ticket);
    }
  }
  response.setReload(true);
}

Fixed version (ground truth):
public void assignToMeTicket(ActionRequest request,ActionResponse response){
  Long id=(Long)request.getContext().get("String_Node_Str");
  List<?> ids=(List<?>)request.getContext().get("String_Node_Str");
  ticketService.assignToMeTicket(id,ids);
  response.setReload(true);
}
Program: 58523
Project: 58523
Buggy source:
public void computeSLA(Ticket ticket){
  AppHelpdesk helpdesk=appHelpdeskRepo.all().fetchOne();
  if (helpdesk.getIsSLApolicies()) {
    if (ticket.getAssignedTo() != null) {
      SLA sla;
      SLA slaPriority=slaRepo.all().filter("String_Node_Str").fetchOne();
      if (slaPriority != null) {
        sla=slaRepo.all().filter("String_Node_Str",ticket.getAssignedTo().getActiveTeam(),ticket.getTicketType()).fetchOne();
      }
 else {
        sla=slaRepo.all().filter("String_Node_Str",ticket.getAssignedTo().getActiveTeam(),ticket.getPriority(),ticket.getTicketType()).fetchOne();
      }
      if (sla != null) {
        ticket.setSlaPolicy(sla);
        try {
          this.computeDuration(ticket,sla);
        }
 catch (        AxelorException e) {
          e.printStackTrace();
        }
      }
 else {
        this.setEmptySLA(ticket);
      }
    }
 else {
      this.setEmptySLA(ticket);
    }
  }
}

Fixed version (ground truth):
public void computeSLA(Ticket ticket){
  AppHelpdesk helpdesk=appHelpdeskRepo.all().fetchOne();
  if (helpdesk.getIsSLApolicies()) {
    if (ticket.getAssignedTo() != null) {
      SLA sla=slaRepo.all().filter("String_Node_Str",ticket.getAssignedTo().getActiveTeam(),ticket.getTicketType(),ticket.getPriority()).fetchOne();
      if (sla != null) {
        ticket.setSlaPolicy(sla);
        try {
          this.computeDuration(ticket,sla);
        }
 catch (        AxelorException e) {
          e.printStackTrace();
        }
      }
 else {
        this.setEmptySLA(ticket);
      }
    }
 else {
      this.setEmptySLA(ticket);
    }
  }
}
Program: 58524
Project: 58524
Buggy source:
public void setEmptySLA(Ticket ticket){
  ticket.setDeadline(null);
  ticket.setSlaPolicy(null);
}

Fixed version (ground truth):
public void setEmptySLA(Ticket ticket){
  ticket.setSlaPolicy(null);
}
Program: 58525
Project: 58525
Buggy source:
@Override @Transactional public void preFillOperations(QualityControl qualityControl) throws AxelorException {
  if (qualityControl.getQualityProcess() != null) {
    QualityProcess process=qualityControl.getQualityProcess();
    if (process != null && process.getControlPointModel() != null) {
      qualityControl.getControlPoint().clear();
      for (      ControlPointModel model : process.getControlPointModel()) {
        ControlPoint point=new ControlPoint();
        point.setStatus(1);
        point.setName(model.getName());
        point.setPriority(model.getPriority());
        point.setProduct(model.getProduct());
        point.setTeam(model.getTeam());
        point.setResponsible(model.getResponsible());
        point.setControlType(model.getControlType());
        point.setTestType(model.getTestType());
        point.setInstructions(model.getInstructions());
        point.setNotes(model.getNotes());
        point.setMessageIfFailure(model.getMessageIfFailure());
        point.setControlFrequency(model.getControlFrequency());
        point.setQualityControl(qualityControl);
        controlPointRepo.save(point);
        qualityControl.addControlPoint(point);
      }
    }
  }
}

Fixed version (ground truth):
@Override @Transactional public void preFillOperations(QualityControl qualityControl) throws AxelorException {
  if (qualityControl.getQualityProcess() != null) {
    QualityProcess process=qualityControl.getQualityProcess();
    if (process != null && process.getControlPointModel() != null) {
      qualityControl.getControlPoint().clear();
      for (      ControlPointModel model : process.getControlPointModel()) {
        ControlPoint point=new ControlPoint();
        point.setStatus(1);
        point.setName(model.getName());
        point.setPriority(model.getPriority());
        point.setProduct(model.getProduct());
        point.setTeam(model.getTeam());
        point.setResponsible(model.getResponsible());
        point.setControlType(model.getControlType());
        point.setTestType(model.getTestType());
        point.setInstructions(model.getInstructions());
        point.setNotes(model.getNotes());
        point.setMessageIfFailure(model.getMessageIfFailure());
        point.setControlFrequency(model.getControlFrequency());
        point.setControlPointDate(qualityControl.getStartDate());
        point.setQualityControl(qualityControl);
        controlPointRepo.save(point);
        qualityControl.addControlPoint(point);
      }
    }
  }
}
Program: 58526
Project: 58526
Buggy source:
@SuppressWarnings("String_Node_Str") private List<List<String>> getAllRecords(List<String> fieldList,String object){
  String query="String_Node_Str";
  for (  String field : fieldList) {
    query+="String_Node_Str" + field;
  }
  List<List<Object>> resultList=JPA.em().createQuery(query + "String_Node_Str" + object+ "String_Node_Str").getResultList();
  List<List<String>> records=new ArrayList<List<String>>();
  for (  List<Object> result : resultList) {
    List<String> record=new ArrayList<String>();
    for (    Object field : result) {
      if (field == null) {
        continue;
      }
      if (field instanceof Model) {
        record.add(((Model)field).getId().toString());
      }
 else {
        record.add(field.toString());
      }
    }
    records.add(record);
  }
  return records;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<List<String>> getAllRecords(List<String> fieldList,String object,String selectedRecored){
  String query="String_Node_Str";
  for (  String field : fieldList) {
    query+="String_Node_Str" + field;
  }
  List<List<Object>> resultList=new ArrayList<>();
  if (selectedRecored.isEmpty() || selectedRecored == null) {
    resultList=JPA.em().createQuery(query + "String_Node_Str" + object+ "String_Node_Str").getResultList();
  }
 else {
    resultList=JPA.em().createQuery(query + "String_Node_Str" + object+ "String_Node_Str"+ selectedRecored+ "String_Node_Str").getResultList();
  }
  List<List<String>> records=new ArrayList<List<String>>();
  for (  List<Object> result : resultList) {
    List<String> record=new ArrayList<String>();
    for (    Object field : result) {
      if (field == null) {
        continue;
      }
      if (field instanceof Model) {
        record.add(((Model)field).getId().toString());
      }
 else {
        record.add(field.toString());
      }
    }
    records.add(record);
  }
  return records;
}
Program: 58527
Project: 58527
Buggy source:
private String findDuplicateRecords(List<String> fieldList,String object){
  List<List<String>> allRecords=getAllRecords(fieldList,object);
  Map<String,List<String>> recordMap=new HashMap<String,List<String>>();
  for (  List<String> rec : allRecords) {
    List<String> record=new ArrayList<String>();
    for (    String field : rec) {
      if (field != null) {
        record.add(StringTool.deleteAccent(field.toLowerCase()));
      }
    }
    String recId=record.get(0);
    record.remove(0);
    if (!record.isEmpty()) {
      recordMap.put(recId,record);
    }
  }
  Iterator<String> keys=recordMap.keySet().iterator();
  List<String> ids=getDuplicateIds(keys,recordMap,new ArrayList<String>());
  return Joiner.on("String_Node_Str").join(ids);
}

Fixed version (ground truth):
private String findDuplicateRecords(List<String> fieldList,String object,String selectedRecored){
  List<List<String>> allRecords=getAllRecords(fieldList,object,selectedRecored);
  Map<String,List<String>> recordMap=new HashMap<String,List<String>>();
  for (  List<String> rec : allRecords) {
    List<String> record=new ArrayList<String>();
    for (    String field : rec) {
      if (field != null) {
        record.add(StringTool.deleteAccent(field.toLowerCase()));
      }
    }
    String recId=record.get(0);
    record.remove(0);
    if (!record.isEmpty()) {
      recordMap.put(recId,record);
    }
  }
  Iterator<String> keys=recordMap.keySet().iterator();
  List<String> ids=getDuplicateIds(keys,recordMap,new ArrayList<String>());
  return Joiner.on("String_Node_Str").join(ids);
}
Program: 58528
Project: 58528
Buggy source:
@SuppressWarnings("String_Node_Str") public void showDuplicate(ActionRequest request,ActionResponse response){
  String model=(String)request.getContext().get("String_Node_Str");
  List<String> fields=new ArrayList<String>();
  if (model == null) {
    model=request.getModel();
    String searchFields=(String)request.getContext().get("String_Node_Str");
    if (searchFields != null) {
      fields.addAll(Arrays.asList(searchFields.split("String_Node_Str")));
    }
  }
 else {
    List<HashMap<String,Object>> fieldsSet=(List<HashMap<String,Object>>)request.getContext().get("String_Node_Str");
    for (    HashMap<String,Object> field : fieldsSet) {
      if (field.get("String_Node_Str") != null && (Boolean)field.get("String_Node_Str")) {
        MetaField metaField=metaFieldRepo.find(Long.parseLong(field.get("String_Node_Str").toString()));
        fields.add(metaField.getName());
      }
    }
  }
  LOG.debug("String_Node_Str",model);
  if (fields.size() > 0) {
    LOG.debug("String_Node_Str",fields);
    String ids=findDuplicateRecords(fields,model);
    if (ids.isEmpty())     response.setFlash(I18n.get(IExceptionMessage.GENERAL_1));
 else {
      response.setView(ActionView.define(I18n.get(IExceptionMessage.GENERAL_2)).model(model).domain("String_Node_Str" + ids + "String_Node_Str").map());
      response.setCanClose(true);
    }
  }
 else   response.setFlash(I18n.get(IExceptionMessage.GENERAL_3));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void showDuplicate(ActionRequest request,ActionResponse response){
  String model=(String)request.getContext().get("String_Node_Str");
  List<String> fields=new ArrayList<String>();
  if (model == null) {
    model=request.getModel();
    String searchFields=(String)request.getContext().get("String_Node_Str");
    if (searchFields != null) {
      fields.addAll(Arrays.asList(searchFields.split("String_Node_Str")));
    }
  }
 else {
    List<HashMap<String,Object>> fieldsSet=(List<HashMap<String,Object>>)request.getContext().get("String_Node_Str");
    for (    HashMap<String,Object> field : fieldsSet) {
      if (field.get("String_Node_Str") != null && (Boolean)field.get("String_Node_Str")) {
        MetaField metaField=metaFieldRepo.find(Long.parseLong(field.get("String_Node_Str").toString()));
        fields.add(metaField.getName());
      }
    }
  }
  LOG.debug("String_Node_Str",model);
  if (fields.size() > 0) {
    LOG.debug("String_Node_Str",fields);
    String selectedRecored=request.getContext().get("String_Node_Str").toString();
    selectedRecored=selectedRecored.substring(1,selectedRecored.length() - 1);
    String ids=findDuplicateRecords(fields,model,selectedRecored);
    if (ids.isEmpty())     response.setFlash(I18n.get(IExceptionMessage.GENERAL_1));
 else {
      response.setView(ActionView.define(I18n.get(IExceptionMessage.GENERAL_2)).model(model).add("String_Node_Str","String_Node_Str").add("String_Node_Str","String_Node_Str").domain("String_Node_Str" + ids + "String_Node_Str").map());
      response.setCanClose(true);
    }
  }
 else   response.setFlash(I18n.get(IExceptionMessage.GENERAL_3));
}
Program: 58529
Project: 58529
Buggy source:
public void runImport(BankStatement bankStatement) throws IOException, AxelorException {
  if (bankStatement.getBankStatementFile() == null) {
    throw new AxelorException(I18n.get(IExceptionMessage.BANK_STATEMENT_MISSING_FILE),IException.MISSING_FIELD);
  }
  if (bankStatement.getBankStatementFileFormat() == null) {
    throw new AxelorException(I18n.get(IExceptionMessage.BANK_STATEMENT_MISSING_FILE_FORMAT),IException.MISSING_FIELD);
  }
  BankStatementFileFormat bankStatementFileFormat=bankStatement.getBankStatementFileFormat();
switch (bankStatementFileFormat.getStatementFileFormatSelect()) {
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_REP:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM_0BY:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM_EUR:
    Beans.get(BankStatementFileAFB120Service.class).process(bankStatement);
  updateStatus(bankStatement);
break;
default :
throw new AxelorException(I18n.get(IExceptionMessage.BANK_STATEMENT_FILE_UNKNOWN_FORMAT),IException.INCONSISTENCY);
}
}

Fixed version (ground truth):
public void runImport(BankStatement bankStatement,boolean alertIfFormatNotSupported) throws IOException, AxelorException {
  if (bankStatement.getBankStatementFile() == null) {
    throw new AxelorException(I18n.get(IExceptionMessage.BANK_STATEMENT_MISSING_FILE),IException.MISSING_FIELD);
  }
  if (bankStatement.getBankStatementFileFormat() == null) {
    throw new AxelorException(I18n.get(IExceptionMessage.BANK_STATEMENT_MISSING_FILE_FORMAT),IException.MISSING_FIELD);
  }
  BankStatementFileFormat bankStatementFileFormat=bankStatement.getBankStatementFileFormat();
switch (bankStatementFileFormat.getStatementFileFormatSelect()) {
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_REP:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM_0BY:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM_EUR:
    Beans.get(BankStatementFileAFB120Service.class).process(bankStatement);
  updateStatus(bankStatement);
break;
default :
if (alertIfFormatNotSupported) {
throw new AxelorException(I18n.get(IExceptionMessage.BANK_STATEMENT_FILE_UNKNOWN_FORMAT),IException.INCONSISTENCY);
}
}
}
Program: 58530
Project: 58530
Buggy source:
@Override protected void process(){
  AccountingBatch accountingBatch=batch.getAccountingBatch();
  Collection<EbicsPartner> ebicsPartners=accountingBatch.getEbicsPartnerSet();
  if (ebicsPartners == null || ebicsPartners.isEmpty()) {
    ebicsPartners=getAllActiveEbicsPartners();
  }
  for (  EbicsPartner ebicsPartner : ebicsPartners) {
    try {
      List<BankStatement> bankStatementList=ebicsPartnerService.getBankStatements(EbicsPartnerRepository.find(ebicsPartner.getId()));
      bankStatementCount+=bankStatementList.size();
      for (      BankStatement bankStatement : bankStatementList) {
        bankStatementService.runImport(bankStatementRepository.find(bankStatement.getId()));
      }
      incrementDone();
    }
 catch (    AxelorException|IOException e) {
      incrementAnomaly();
      log.error(e.getMessage());
      TraceBackService.trace(e);
    }
  }
}

Fixed version (ground truth):
@Override protected void process(){
  AccountingBatch accountingBatch=batch.getAccountingBatch();
  Collection<EbicsPartner> ebicsPartners=accountingBatch.getEbicsPartnerSet();
  if (ebicsPartners == null || ebicsPartners.isEmpty()) {
    ebicsPartners=getAllActiveEbicsPartners();
  }
  for (  EbicsPartner ebicsPartner : ebicsPartners) {
    try {
      List<BankStatement> bankStatementList=ebicsPartnerService.getBankStatements(EbicsPartnerRepository.find(ebicsPartner.getId()));
      bankStatementCount+=bankStatementList.size();
      for (      BankStatement bankStatement : bankStatementList) {
        try {
          bankStatementService.runImport(bankStatementRepository.find(bankStatement.getId()),false);
        }
 catch (        AxelorException e) {
          incrementAnomaly();
          log.error(e.getMessage());
          TraceBackService.trace(e);
        }
      }
      incrementDone();
    }
 catch (    AxelorException|IOException e) {
      incrementAnomaly();
      log.error(e.getMessage());
      TraceBackService.trace(e);
    }
  }
}
Program: 58531
Project: 58531
Buggy source:
public void runImport(ActionRequest request,ActionResponse response){
  try {
    BankStatement bankStatement=request.getContext().asType(BankStatement.class);
    bankStatement=bankStatementRepository.find(bankStatement.getId());
    bankStatementService.runImport(bankStatement);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
  response.setReload(true);
}

Fixed version (ground truth):
public void runImport(ActionRequest request,ActionResponse response){
  try {
    BankStatement bankStatement=request.getContext().asType(BankStatement.class);
    bankStatement=bankStatementRepository.find(bankStatement.getId());
    bankStatementService.runImport(bankStatement,true);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
  response.setReload(true);
}
Program: 58532
Project: 58532
Buggy source:
private String getLanguage(App app){
  String lang=AppSettings.get().get("String_Node_Str");
  if (app.getLanguageSelect() != null) {
    lang=app.getLanguageSelect();
  }
  return lang;
}

Fixed version (ground truth):
private String getLanguage(App app){
  String lang=app.getLanguageSelect();
  if (app.getLanguageSelect() == null) {
    lang=AppSettings.get().get("String_Node_Str");
  }
  return lang;
}
Program: 58533
Project: 58533
Buggy source:
private void importParentData(App app){
  List<App> depends=getDepends(app,true);
  for (  App parent : depends) {
    parent=appRepo.find(parent.getId());
    if (!parent.getDemoDataLoaded()) {
      log.debug("String_Node_Str",parent.getName());
      importDataDemo(parent);
    }
  }
}

Fixed version (ground truth):
private void importParentData(App app){
  List<App> depends=getDepends(app,true);
  for (  App parent : depends) {
    parent=appRepo.find(parent.getId());
    if (!parent.getDemoDataLoaded()) {
      importDataDemo(parent);
    }
  }
}
Program: 58534
Project: 58534
Buggy source:
@Override public String importDataDemo(App app){
  app=appRepo.find(app.getId());
  importParentData(app);
  String lang=getLanguage(app);
  if (lang == null) {
    return I18n.get("String_Node_Str");
  }
  importData(app,DIR_DEMO);
  app=appRepo.find(app.getId());
  app.setDemoDataLoaded(true);
  saveApp(app);
  return I18n.get("String_Node_Str");
}

Fixed version (ground truth):
@Override public String importDataDemo(App app){
  app=appRepo.find(app.getId());
  log.debug("String_Node_Str",app.getCode(),app.getLanguageSelect());
  importParentData(app);
  String lang=getLanguage(app);
  if (lang == null) {
    return I18n.get(IAppExceptionMessages.NO_LANGAUAGE_SELECTED);
  }
  importData(app,DIR_DEMO);
  app=appRepo.find(app.getId());
  app.setDemoDataLoaded(true);
  saveApp(app);
  return I18n.get(IAppExceptionMessages.DEMO_DATA_SUCCESS);
}
Program: 58535
Project: 58535
Buggy source:
@Override public List<App> getDepends(App app,Boolean active){
  List<App> apps=new ArrayList<App>();
  for (  App depend : app.getDependsOnSet()) {
    if (depend.getActive() == active) {
      apps.add(depend);
    }
  }
  return sortApps(apps);
}

Fixed version (ground truth):
@Override public List<App> getDepends(App app,Boolean active){
  List<App> apps=new ArrayList<App>();
  for (  App depend : app.getDependsOnSet()) {
    if (depend.getActive().equals(active)) {
      apps.add(depend);
    }
  }
  return sortApps(apps);
}
Program: 58536
Project: 58536
Buggy source:
public void refreshApp(ActionRequest request,ActionResponse response){
  try {
    appService.refreshApp();
    response.setNotify(I18n.get("String_Node_Str"));
  }
 catch (  IOException|ClassNotFoundException e) {
    e.printStackTrace();
    response.setNotify(I18n.get("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void refreshApp(ActionRequest request,ActionResponse response){
  try {
    appService.refreshApp();
    response.setNotify(I18n.get(IAppExceptionMessages.REFRESH_APP_SUCCESS));
  }
 catch (  IOException|ClassNotFoundException e) {
    e.printStackTrace();
    response.setNotify(I18n.get(IAppExceptionMessages.REFRESH_APP_ERROR));
  }
}
Program: 58537
Project: 58537
Buggy source:
public void checkParent(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  List<App> depends=appService.getDepends(app,false);
  if (!depends.isEmpty()) {
    List<String> parents=appService.getNames(depends);
    response.setAlert(String.format(I18n.get("String_Node_Str"),parents));
  }
}

Fixed version (ground truth):
public void checkParent(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  app=appRepo.find(app.getId());
  List<App> depends=appService.getDepends(app,false);
  if (!depends.isEmpty()) {
    List<String> parents=appService.getNames(depends);
    response.setAlert(String.format(I18n.get(IAppExceptionMessages.CONFIRM_APPS),parents));
  }
}
Program: 58538
Project: 58538
Buggy source:
public void bulkInstall(ActionRequest request,ActionResponse response){
  Context context=request.getContext();
  Set<Map<String,Object>> apps=new HashSet<Map<String,Object>>();
  Collection<Map<String,Object>> appsSet=(Collection<Map<String,Object>>)context.get("String_Node_Str");
  if (appsSet != null) {
    apps.addAll(appsSet);
  }
  Boolean importDemo=(Boolean)context.get("String_Node_Str");
  String language=(String)context.get("String_Node_Str");
  List<App> appList=new ArrayList<App>();
  for (  Map<String,Object> appData : apps) {
    App app=appRepo.find(Long.parseLong(appData.get("String_Node_Str").toString()));
    app=appService.updateLanguage(app,language);
    appList.add(app);
  }
  appList=appService.sortApps(appList);
  for (  App app : appList) {
    app=appRepo.find(app.getId());
    app=appService.installApp(app,importDemo);
  }
  response.setFlash(I18n.get("String_Node_Str"));
  response.setSignal("String_Node_Str",true);
}

Fixed version (ground truth):
public void bulkInstall(ActionRequest request,ActionResponse response){
  Context context=request.getContext();
  Set<Map<String,Object>> apps=new HashSet<Map<String,Object>>();
  Collection<Map<String,Object>> appsSet=(Collection<Map<String,Object>>)context.get("String_Node_Str");
  if (appsSet != null) {
    apps.addAll(appsSet);
  }
  Boolean importDemo=(Boolean)context.get("String_Node_Str");
  String language=(String)context.get("String_Node_Str");
  List<App> appList=new ArrayList<App>();
  for (  Map<String,Object> appData : apps) {
    App app=appRepo.find(Long.parseLong(appData.get("String_Node_Str").toString()));
    app=appService.updateLanguage(app,language);
    appList.add(app);
  }
  appList=appService.sortApps(appList);
  for (  App app : appList) {
    app=appRepo.find(app.getId());
    app=appService.installApp(app,importDemo);
  }
  response.setFlash(I18n.get(IAppExceptionMessages.BULK_INSTALL_SUCCESS));
  response.setSignal("String_Node_Str",true);
}
Program: 58539
Project: 58539
Buggy source:
public void configure(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  String code=app.getCode();
  String appName=Inflector.getInstance().camelize(code);
  String viewName="String_Node_Str" + code + "String_Node_Str";
  if (metaViewRepo.findByName(viewName) == null) {
    response.setFlash(I18n.get("String_Node_Str"));
  }
 else {
    response.setView(ActionView.define(I18n.get("String_Node_Str") + app.getName()).add("String_Node_Str",viewName).model("String_Node_Str" + appName).context("String_Node_Str",app.getId()).map());
  }
}

Fixed version (ground truth):
public void configure(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  String code=app.getCode();
  String appName=Inflector.getInstance().camelize(code);
  String viewName="String_Node_Str" + code + "String_Node_Str";
  if (metaViewRepo.findByName(viewName) == null) {
    response.setFlash(I18n.get(IAppExceptionMessages.NO_CONFIG_REQUIRED));
  }
 else {
    response.setView(ActionView.define(I18n.get("String_Node_Str") + "String_Node_Str" + app.getName()).add("String_Node_Str",viewName).model("String_Node_Str" + appName).context("String_Node_Str",app.getId()).map());
  }
}
Program: 58540
Project: 58540
Buggy source:
public void importDataDemo(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  response.setFlash(appService.importDataDemo(app));
  response.setReload(true);
}

Fixed version (ground truth):
public void importDataDemo(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  app=appRepo.find(app.getId());
  response.setFlash(appService.importDataDemo(app));
  response.setReload(true);
}
Program: 58541
Project: 58541
Buggy source:
public Sequence getNatTreasuryTransSequence(AccountConfig accountConfig) throws AxelorException {
  if (accountConfig.getNatTreasuryTransSequence() == null) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.ACCOUNT_CONFIG_SEQUENCE_9),GeneralServiceImpl.EXCEPTION,accountConfig.getCompany().getName()),IException.CONFIGURATION_ERROR);
  }
  return accountConfig.getNatTreasuryTransSequence();
}

Fixed version (ground truth):
public Sequence getNatTreasuryTransSequence(AccountConfig accountConfig) throws AxelorException {
  if (accountConfig.getNatTreasuryTransSequence() == null) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.ACCOUNT_CONFIG_SEQUENCE_10),GeneralServiceImpl.EXCEPTION,accountConfig.getCompany().getName()),IException.CONFIGURATION_ERROR);
  }
  return accountConfig.getNatTreasuryTransSequence();
}
Program: 58542
Project: 58542
Buggy source:
public Sequence getIntTreasuryTransSequence(AccountConfig accountConfig) throws AxelorException {
  if (accountConfig.getIntTreasuryTransSequence() == null) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.ACCOUNT_CONFIG_SEQUENCE_10),GeneralServiceImpl.EXCEPTION,accountConfig.getCompany().getName()),IException.CONFIGURATION_ERROR);
  }
  return accountConfig.getIntTreasuryTransSequence();
}

Fixed version (ground truth):
public Sequence getIntTreasuryTransSequence(AccountConfig accountConfig) throws AxelorException {
  if (accountConfig.getIntTreasuryTransSequence() == null) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.ACCOUNT_CONFIG_SEQUENCE_9),GeneralServiceImpl.EXCEPTION,accountConfig.getCompany().getName()),IException.CONFIGURATION_ERROR);
  }
  return accountConfig.getIntTreasuryTransSequence();
}
Program: 58544
Project: 58544
Buggy source:
@Override @Transactional(rollbackOn={AxelorException.class,Exception.class}) public void confirm(BankOrder bankOrder) throws AxelorException, JAXBException, IOException, DatatypeConfigurationException {
  checkBankDetails(bankOrder.getSenderBankDetails(),bankOrder);
  if (bankOrder.getGeneratedMetaFile() == null) {
    checkLines(bankOrder);
  }
  setNbOfLines(bankOrder);
  generateFile(bankOrder);
  setSequenceOnBankOrderLines(bankOrder);
  bankOrder.setStatusSelect(BankOrderRepository.STATUS_AWAITING_SIGNATURE);
  makeEbicsUserFollow(bankOrder);
  bankOrderRepo.save(bankOrder);
}

Fixed version (ground truth):
@Override @Transactional(rollbackOn={AxelorException.class,Exception.class}) public void confirm(BankOrder bankOrder) throws AxelorException, JAXBException, IOException, DatatypeConfigurationException {
  checkBankDetails(bankOrder.getSenderBankDetails(),bankOrder);
  if (bankOrder.getGeneratedMetaFile() == null) {
    checkLines(bankOrder);
  }
  setNbOfLines(bankOrder);
  setSequenceOnBankOrderLines(bankOrder);
  generateFile(bankOrder);
  bankOrder.setStatusSelect(BankOrderRepository.STATUS_AWAITING_SIGNATURE);
  makeEbicsUserFollow(bankOrder);
  bankOrderRepo.save(bankOrder);
}
Program: 58545
Project: 58545
Buggy source:
/** 
 * C1-3. Date Facultative mais recommandée pour les Virements ordinaires, particuliers et de trésorerie : date demandée pour le règlement interbancaire. Obligatoire pour les Virements à échéance : date d'échéance demandée. 
 * @return
 */
protected String getSenderC13Area(){
  return this.bankOrderDate.toString("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * C1-3. Date Facultative mais recommandée pour les Virements ordinaires, particuliers et de trésorerie : date demandée pour le règlement interbancaire. Obligatoire pour les Virements à échéance : date d'échéance demandée. 
 * @return
 */
protected String getSenderC13Area(){
  int year=this.bankOrderDate.getYear();
  return this.bankOrderDate.toString("String_Node_Str") + (String.valueOf(year).substring(3));
}
Program: 58546
Project: 58546
Buggy source:
/** 
 * 3.1.2 Identification des comptes Les zones "compte à débiter" et "compte du bénéficiaire" doivent respecter les règles suivantes : lorsque la zone "type identifiant de compte" est renseignée, elle prend les valeurs : "1" si le compte est identifié par un IBAN lequel doit être cadré à gauche, "2" si le compte est identifié par un identifiant national, lequel doit alors être précédé de quatre blancs, "0" dans les autres cas ; l'identifiant doit alors également être précédé de quatre blancs.
 * @param bankDetails
 * @return
 * @throws AxelorException 
 */
public String getIban(BankDetails bankDetails) throws AxelorException {
  String iban=bankDetails.getIban();
  if (Strings.isNullOrEmpty(iban)) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.BANK_ORDER_BANK_DETAILS_EMPTY_IBAN),bankDetails.getOwnerName(),bankOrderSeq),IException.MISSING_FIELD);
  }
switch (bankDetails.getBank().getBankDetailsTypeSelect()) {
case BankRepository.BANK_IDENTIFIER_TYPE_IBAN:
    return StringTool.fillStringLeft(bankDetails.getIban(),' ',34);
case BankRepository.BANK_IDENTIFIER_TYPE_NATIONAL:
  return StringTool.fillStringLeft(StringTool.fillString(' ',4) + bankDetails.getIban(),' ',34);
case BankRepository.BANK_IDENTIFIER_TYPE_OTHER:
return StringTool.fillStringLeft(StringTool.fillString(' ',4) + bankDetails.getIban(),' ',34);
default :
return StringTool.fillStringLeft(bankDetails.getIban(),' ',34);
}
}

Fixed version (ground truth):
/** 
 * 3.1.2 Identification des comptes Les zones "compte à débiter" et "compte du bénéficiaire" doivent respecter les règles suivantes : lorsque la zone "type identifiant de compte" est renseignée, elle prend les valeurs : "1" si le compte est identifié par un IBAN lequel doit être cadré à gauche, "2" si le compte est identifié par un identifiant national, lequel doit alors être précédé de quatre blancs, "0" dans les autres cas ; l'identifiant doit alors également être précédé de quatre blancs.
 * @param bankDetails
 * @return
 * @throws AxelorException 
 */
public String getIban(BankDetails bankDetails) throws AxelorException {
  String iban=bankDetails.getIban();
  if (Strings.isNullOrEmpty(iban)) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.BANK_ORDER_BANK_DETAILS_EMPTY_IBAN),bankDetails.getOwnerName(),bankOrderSeq),IException.MISSING_FIELD);
  }
switch (bankDetails.getBank().getBankDetailsTypeSelect()) {
case BankRepository.BANK_IDENTIFIER_TYPE_IBAN:
    return StringTool.fillStringRight(bankDetails.getIban(),' ',34);
case BankRepository.BANK_IDENTIFIER_TYPE_NATIONAL:
  return StringTool.fillStringRight(StringTool.fillString(' ',4) + bankDetails.getIban(),' ',34);
case BankRepository.BANK_IDENTIFIER_TYPE_OTHER:
return StringTool.fillStringRight(StringTool.fillString(' ',4) + bankDetails.getIban(),' ',34);
default :
return StringTool.fillStringRight(bankDetails.getIban(),' ',34);
}
}
Program: 58547
Project: 58547
Buggy source:
private EbicsCertificate updateCertificate(X509Certificate certificate,EbicsCertificate cert,byte[] privateKey,String type) throws CertificateEncodingException, IOException {
  if (cert == null) {
    cert=new EbicsCertificate();
    cert.setTypeSelect(type);
  }
  EbicsCertificateService certificateService=Beans.get(EbicsCertificateService.class);
  cert=certificateService.updateCertificate(certificate,cert);
  cert.setPrivateKey(privateKey);
  return cert;
}

Fixed version (ground truth):
private EbicsCertificate updateCertificate(X509Certificate certificate,EbicsCertificate cert,byte[] privateKey,String type) throws CertificateEncodingException, IOException {
  if (cert == null) {
    cert=new EbicsCertificate();
    cert.setTypeSelect(type);
  }
  EbicsCertificateService certificateService=Beans.get(EbicsCertificateService.class);
  cert=certificateService.updateCertificate(certificate,cert,true);
  cert.setPrivateKey(privateKey);
  return cert;
}
Program: 58548
Project: 58548
Buggy source:
private void updateCertificate(EbicsCertificate cert){
  if (cert == null) {
    return;
  }
  String pem=cert.getPemString();
  if (pem == null) {
    return;
  }
  try {
    X509Certificate certificate=certificateService.convertToCertificate(pem);
    certificateService.updateCertificate(certificate,cert);
  }
 catch (  IOException|CertificateEncodingException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void updateCertificate(EbicsCertificate cert){
  if (cert == null) {
    return;
  }
  String pem=cert.getPemString();
  if (pem == null) {
    return;
  }
  try {
    X509Certificate certificate=certificateService.convertToCertificate(pem);
    certificateService.updateCertificate(certificate,cert,false);
  }
 catch (  IOException|CertificateEncodingException e) {
    e.printStackTrace();
  }
}
Program: 58549
Project: 58549
Buggy source:
@Transactional public EbicsCertificate createCertificate(X509Certificate certificate,EbicsBank bank,String type) throws CertificateEncodingException, IOException {
  EbicsCertificate cert=getEbicsCertificate(bank,type);
  if (cert == null) {
    log.debug("String_Node_Str",bank.getName(),type);
    cert=new EbicsCertificate();
    cert.setEbicsBank(bank);
    cert.setTypeSelect(type);
  }
  cert=updateCertificate(certificate,cert);
  return certRepo.save(cert);
}

Fixed version (ground truth):
@Transactional public EbicsCertificate createCertificate(X509Certificate certificate,EbicsBank bank,String type) throws CertificateEncodingException, IOException {
  EbicsCertificate cert=getEbicsCertificate(bank,type);
  if (cert == null) {
    log.debug("String_Node_Str",bank.getName(),type);
    cert=new EbicsCertificate();
    cert.setEbicsBank(bank);
    cert.setTypeSelect(type);
  }
  cert=updateCertificate(certificate,cert,true);
  return certRepo.save(cert);
}
Program: 58550
Project: 58550
Buggy source:
public EbicsCertificate updateCertificate(X509Certificate certificate,EbicsCertificate cert) throws CertificateEncodingException, IOException {
  String sha=DigestUtils.sha256Hex(certificate.getEncoded());
  log.debug("String_Node_Str",sha);
  log.debug("String_Node_Str",new String(certificate.getEncoded()));
  log.debug("String_Node_Str",certificate.getEncoded().length);
  cert.setValidFrom(new LocalDate(certificate.getNotBefore()));
  cert.setValidTo(new LocalDate(certificate.getNotAfter()));
  cert.setIssuer(certificate.getIssuerDN().getName());
  cert.setSubject(certificate.getSubjectDN().getName());
  cert.setCertificate(certificate.getEncoded());
  RSAPublicKey publicKey=(RSAPublicKey)certificate.getPublicKey();
  cert.setPublicKeyExponent(publicKey.getPublicExponent().toString(16));
  cert.setPublicKeyModulus(publicKey.getModulus().toString(16));
  cert.setSerial(certificate.getSerialNumber().toString(16));
  cert.setPemString(convertToPEMString(certificate));
  cert.setPrivateKey(null);
  sha=sha.toUpperCase();
  cert.setSha2has(sha);
  computeFullName(cert);
  return cert;
}

Fixed version (ground truth):
public EbicsCertificate updateCertificate(X509Certificate certificate,EbicsCertificate cert,boolean cleanPrivateKey) throws CertificateEncodingException, IOException {
  String sha=DigestUtils.sha256Hex(certificate.getEncoded());
  log.debug("String_Node_Str",sha);
  log.debug("String_Node_Str",new String(certificate.getEncoded()));
  log.debug("String_Node_Str",certificate.getEncoded().length);
  cert.setValidFrom(new LocalDate(certificate.getNotBefore()));
  cert.setValidTo(new LocalDate(certificate.getNotAfter()));
  cert.setIssuer(certificate.getIssuerDN().getName());
  cert.setSubject(certificate.getSubjectDN().getName());
  cert.setCertificate(certificate.getEncoded());
  RSAPublicKey publicKey=(RSAPublicKey)certificate.getPublicKey();
  cert.setPublicKeyExponent(publicKey.getPublicExponent().toString(16));
  cert.setPublicKeyModulus(publicKey.getModulus().toString(16));
  cert.setSerial(certificate.getSerialNumber().toString(16));
  cert.setPemString(convertToPEMString(certificate));
  if (cleanPrivateKey) {
    cert.setPrivateKey(null);
  }
  sha=sha.toUpperCase();
  cert.setSha2has(sha);
  computeFullName(cert);
  return cert;
}
Program: 58551
Project: 58551
Buggy source:
public void loadCertificate(ActionRequest request,ActionResponse response) throws AxelorException, CertificateEncodingException, IOException {
  EbicsCertificate cert=request.getContext().asType(EbicsCertificate.class);
  cert=certificateRepo.find(cert.getId());
  byte[] certs=cert.getCertificate();
  if (certs != null && certs.length > 0) {
    X509Certificate certificate=EbicsCertificateService.getCertificate(certs,cert.getTypeSelect());
    cert=certificateService.updateCertificate(certificate,cert);
    response.setValue("String_Node_Str",cert.getValidFrom());
    response.setValue("String_Node_Str",cert.getValidTo());
    response.setValue("String_Node_Str",cert.getIssuer());
    response.setValue("String_Node_Str",cert.getSubject());
    response.setValue("String_Node_Str",cert.getPublicKeyModulus());
    response.setValue("String_Node_Str",cert.getPublicKeyExponent());
    response.setValue("String_Node_Str",cert.getFullName());
    response.setValue("String_Node_Str",cert.getPemString());
    response.setValue("String_Node_Str",cert.getSha2has());
  }
}

Fixed version (ground truth):
public void loadCertificate(ActionRequest request,ActionResponse response) throws AxelorException, CertificateEncodingException, IOException {
  EbicsCertificate cert=request.getContext().asType(EbicsCertificate.class);
  cert=certificateRepo.find(cert.getId());
  byte[] certs=cert.getCertificate();
  if (certs != null && certs.length > 0) {
    X509Certificate certificate=EbicsCertificateService.getCertificate(certs,cert.getTypeSelect());
    cert=certificateService.updateCertificate(certificate,cert,true);
    response.setValue("String_Node_Str",cert.getValidFrom());
    response.setValue("String_Node_Str",cert.getValidTo());
    response.setValue("String_Node_Str",cert.getIssuer());
    response.setValue("String_Node_Str",cert.getSubject());
    response.setValue("String_Node_Str",cert.getPublicKeyModulus());
    response.setValue("String_Node_Str",cert.getPublicKeyExponent());
    response.setValue("String_Node_Str",cert.getFullName());
    response.setValue("String_Node_Str",cert.getPemString());
    response.setValue("String_Node_Str",cert.getSha2has());
  }
}
Program: 58552
Project: 58552
Buggy source:
public String getHexSignature(){
  return new String(DatatypeConverter.parseHexBinary(new String(signature)));
}

Fixed version (ground truth):
public String getHexSignature(){
  return Hex.encodeHexString(signature);
}
Program: 58553
Project: 58553
Buggy source:
public String computeSha256Digest(){
  bankOrderContent=EbicsUserService.removeOSSpecificChars(bankOrderContent);
  String sha=DigestUtils.sha256Hex(bankOrderContent);
  return sha;
}

Fixed version (ground truth):
public String computeSha256Digest(){
  bankOrderContent=EbicsUserService.removeOSSpecificChars(bankOrderContent);
  String sha=DigestUtils.sha256Hex(bankOrderContent);
  log.debug("String_Node_Str",sha);
  return sha;
}
Program: 58554
Project: 58554
Buggy source:
public void closeCashRegister(ActionRequest request,ActionResponse response){
  CashRegisterLine cashRegisterLine=request.getContext().asType(CashRegisterLine.class);
  cashRegisterLine=cashRegisterLineRepo.find(cashRegisterLine.getId());
  try {
    Message message=cashRegisterLineService.closeCashRegister(cashRegisterLine);
    response.setReload(true);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
}

Fixed version (ground truth):
public void closeCashRegister(ActionRequest request,ActionResponse response){
  CashRegisterLine cashRegisterLine=request.getContext().asType(CashRegisterLine.class);
  cashRegisterLine=cashRegisterLineRepo.find(cashRegisterLine.getId());
  try {
    cashRegisterLineService.closeCashRegister(cashRegisterLine);
    response.setReload(true);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
}
Program: 58555
Project: 58555
Buggy source:
@Override public ChartBuilder save(ChartBuilder chartBuilder) throws ValidationException {
  if (chartBuilder.getName().contains("String_Node_Str")) {
    throw new ValidationException(I18n.get("String_Node_Str"));
  }
  chartBuilder=super.save(chartBuilder);
  try {
    MetaView metaView=chartBuilderService.build(chartBuilder);
    if (metaView != null) {
      chartBuilder.setMetaViewGenerated(metaView);
    }
  }
 catch (  AxelorException|JAXBException e) {
    throw new ValidationException(e.getMessage());
  }
  return super.save(chartBuilder);
}

Fixed version (ground truth):
@Override public ChartBuilder save(ChartBuilder chartBuilder) throws ValidationException {
  try {
    chartBuilderService.build(chartBuilder);
  }
 catch (  AxelorException|JAXBException e) {
    refresh(chartBuilder);
    throw new ValidationException(e.getMessage());
  }
  return super.save(chartBuilder);
}
Program: 58556
Project: 58556
Buggy source:
@Transactional public MetaAction build(ActionBuilder builder){
  if (builder.getTypeSelect() < 2 && builder.getLines() != null && builder.getLines().isEmpty()) {
    return null;
  }
  inflector=Inflector.getInstance();
  MetaAction metaAction=null;
  String xml=null;
  if (builder.getTypeSelect() == 3) {
    String[] val=buildActionView(builder);
    xml=val[1];
    metaAction=metaService.updateMetaAction(builder.getName(),"String_Node_Str",xml,val[0]);
  }
 else {
    xml=buildActionScript(builder);
    metaAction=metaService.updateMetaAction(builder.getName(),"String_Node_Str",xml,null);
  }
  log.debug("String_Node_Str",builder.getName(),builder.getTypeSelect());
  MetaStore.clear();
  return metaAction;
}

Fixed version (ground truth):
@Transactional public MetaAction build(ActionBuilder builder){
  if (builder.getTypeSelect() < 2 && (builder.getLines() == null || builder.getLines().isEmpty())) {
    return null;
  }
  inflector=Inflector.getInstance();
  MetaAction metaAction=null;
  String xml=null;
  if (builder.getTypeSelect() == 3) {
    String[] val=buildActionView(builder);
    xml=val[1];
    metaAction=metaService.updateMetaAction(builder.getName(),"String_Node_Str",xml,val[0]);
  }
 else {
    xml=buildActionScript(builder);
    metaAction=metaService.updateMetaAction(builder.getName(),"String_Node_Str",xml,null);
  }
  log.debug("String_Node_Str",builder.getName(),builder.getTypeSelect());
  MetaStore.clear();
  return metaAction;
}
Program: 58557
Project: 58557
Buggy source:
/** 
 * Root Method to access the service it generate AbstractView from ViewBuilder.
 * @param viewBuilder ViewBuilder object of type chart.
 * @return AbstractView from meta schema.
 * @throws JAXBException
 * @throws AxelorException 
 */
public MetaView build(ChartBuilder chartBuilder) throws JAXBException, AxelorException {
  searchFields=new ArrayList<String>();
  onNewFields=new ArrayList<RecordField>();
  joins=new ArrayList<String>();
  String[] queryString=prepareQuery(chartBuilder);
  String xml=createXml(chartBuilder,queryString);
  log.debug("String_Node_Str",xml);
  ObjectViews chartView=XMLViews.fromXML(xml);
  return metaService.generateMetaView(chartView.getViews().get(0));
}

Fixed version (ground truth):
/** 
 * Root Method to access the service it generate AbstractView from ViewBuilder.
 * @param viewBuilder ViewBuilder object of type chart.
 * @return AbstractView from meta schema.
 * @throws JAXBException
 * @throws AxelorException 
 */
public void build(ChartBuilder chartBuilder) throws JAXBException, AxelorException {
  if (chartBuilder.getName().contains("String_Node_Str")) {
    throw new AxelorException(I18n.get("String_Node_Str"),1);
  }
  searchFields=new ArrayList<String>();
  onNewFields=new ArrayList<RecordField>();
  joins=new ArrayList<String>();
  String[] queryString=prepareQuery(chartBuilder);
  String xml=createXml(chartBuilder,queryString);
  log.debug("String_Node_Str",xml);
  ObjectViews chartView=XMLViews.fromXML(xml);
  MetaView metaView=metaService.generateMetaView(chartView.getViews().get(0));
  if (metaView != null) {
    chartBuilder.setMetaViewGenerated(metaView);
  }
}