Program: 58646
Project: 58646
Buggy source:
/** 
 * Method to create an optional further information record for national transfer AFB160
 * @param bankOrderLine
 * @return
 * @throws AxelorException
 */
protected String createOptionnalFurtherInformationRecord(BankOrderLine bankOrderLine) throws AxelorException {
  try {
    BankDetails receiverBankDetails=bankOrderLine.getReceiverBankDetails();
    String totalRecord=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,2);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",getB1Area(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,2);
    totalRecord+=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_NOT_USED,cfonbToolService.FORMAT_ALPHA_NUMERIC,8);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",getB3Area(),cfonbToolService.STATUS_DEPENDENT,cfonbToolService.FORMAT_ALPHA_NUMERIC,6);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getSequence(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,12);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getReceiverCompany().getName(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,24);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getBankAddress(),cfonbToolService.STATUS_DEPENDENT,cfonbToolService.FORMAT_ALPHA_NUMERIC,24);
    totalRecord+=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_NOT_USED,cfonbToolService.FORMAT_ALPHA_NUMERIC,8);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getSortCode(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,5);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getAccountNbr(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,11);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getBankOrderAmount(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,16);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getPaymentReasonLine1(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,31);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getBankCode(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,5);
    totalRecord+=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_NOT_USED,cfonbToolService.FORMAT_ALPHA_NUMERIC,6);
    cfonbToolService.toUpperCase(totalRecord);
    cfonbToolService.testLength(totalRecord,NB_CHAR_PER_LINE);
    return totalRecord;
  }
 catch (  AxelorException e) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.BANK_ORDER_WRONG_FURTHER_INFORMATION_DETAIL_RECORD),bankOrderLine.getSequence()),e,IException.MISSING_FIELD);
  }
}

Fixed version (ground truth):
/** 
 * Method to create an optional further information record for national transfer AFB160
 * @param bankOrderLine
 * @return
 * @throws AxelorException
 */
protected String createOptionnalFurtherInformationRecord(BankOrderLine bankOrderLine) throws AxelorException {
  try {
    BankDetails receiverBankDetails=bankOrderLine.getReceiverBankDetails();
    String totalRecord=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,2);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",getB1Area(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,2);
    totalRecord+=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_NOT_USED,cfonbToolService.FORMAT_ALPHA_NUMERIC,8);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",getB3Area(),cfonbToolService.STATUS_DEPENDENT,cfonbToolService.FORMAT_ALPHA_NUMERIC,6);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getSequence(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,12);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getReceiverCompany().getName(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,24);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getBank().getBankAddress(),cfonbToolService.STATUS_DEPENDENT,cfonbToolService.FORMAT_ALPHA_NUMERIC,24);
    totalRecord+=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_NOT_USED,cfonbToolService.FORMAT_ALPHA_NUMERIC,8);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getSortCode(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,5);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getAccountNbr(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,11);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getBankOrderAmount(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,16);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",bankOrderLine.getPaymentReasonLine1(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_ALPHA_NUMERIC,31);
    totalRecord+=cfonbToolService.createZone("String_Node_Str",receiverBankDetails.getBankCode(),cfonbToolService.STATUS_MANDATORY,cfonbToolService.FORMAT_NUMERIC,5);
    totalRecord+=cfonbToolService.createZone("String_Node_Str","String_Node_Str",cfonbToolService.STATUS_NOT_USED,cfonbToolService.FORMAT_ALPHA_NUMERIC,6);
    cfonbToolService.toUpperCase(totalRecord);
    cfonbToolService.testLength(totalRecord,NB_CHAR_PER_LINE);
    return totalRecord;
  }
 catch (  AxelorException e) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.BANK_ORDER_WRONG_FURTHER_INFORMATION_DETAIL_RECORD),bankOrderLine.getSequence()),e,IException.MISSING_FIELD);
  }
}