Program: 58602
Project: 58602
Buggy source:
@Override public void buildInitialization() throws AxelorException {
  EbicsRequest request;
  Header header;
  Body body;
  MutableHeaderType mutable;
  StaticHeaderType xstatic;
  Product product;
  BankPubKeyDigests bankPubKeyDigests;
  Authentication authentication;
  Encryption encryption;
  DataTransferRequestType dataTransfer;
  DataEncryptionInfo dataEncryptionInfo;
  SignatureData signatureData;
  EncryptionPubKeyDigest encryptionPubKeyDigest;
  StaticHeaderOrderDetailsType orderDetails;
  FULOrderParamsType fULOrderParams;
  OrderType orderType;
  FileFormatType fileFormat;
  List<Parameter> parameters;
  EbicsUser ebicsUser=session.getUser();
  if (ebicsUser.getEbicsTypeSelect() == EbicsUserRepository.EBICS_TYPE_TS) {
    userSignature=new UserSignature(ebicsUser,generateName("String_Node_Str"),"String_Node_Str",userSignatureData);
  }
 else {
    userSignature=new UserSignature(ebicsUser,generateName("String_Node_Str"),"String_Node_Str",userData);
  }
  userSignature.build();
  userSignature.validate();
  splitter.readInput(true,keySpec);
  mutable=EbicsXmlFactory.createMutableHeaderType("String_Node_Str",null);
  product=EbicsXmlFactory.createProduct(session.getProduct().getLanguage(),session.getProduct().getName());
  authentication=EbicsXmlFactory.createAuthentication("String_Node_Str","String_Node_Str",decodeHex(KeyUtil.getKeyDigest(session.getBankX002Key())));
  encryption=EbicsXmlFactory.createEncryption("String_Node_Str","String_Node_Str",decodeHex(KeyUtil.getKeyDigest(session.getBankE002Key())));
  bankPubKeyDigests=EbicsXmlFactory.createBankPubKeyDigests(authentication,encryption);
  orderType=EbicsXmlFactory.createOrderType(type.getOrderType());
  fileFormat=EbicsXmlFactory.createFileFormatType(Locale.FRANCE.getCountry(),session.getSessionParam("String_Node_Str"));
  fULOrderParams=EbicsXmlFactory.createFULOrderParamsType(fileFormat);
  parameters=new ArrayList<Parameter>();
  if (Boolean.valueOf(session.getSessionParam("String_Node_Str")).booleanValue()) {
    Parameter parameter;
    Value value;
    value=EbicsXmlFactory.createValue("String_Node_Str","String_Node_Str");
    parameter=EbicsXmlFactory.createParameter("String_Node_Str",value);
    parameters.add(parameter);
  }
  if (Boolean.valueOf(session.getSessionParam("String_Node_Str")).booleanValue()) {
    Parameter parameter;
    Value value;
    value=EbicsXmlFactory.createValue("String_Node_Str","String_Node_Str");
    parameter=EbicsXmlFactory.createParameter("String_Node_Str",value);
    parameters.add(parameter);
  }
  if (parameters.size() > 0) {
    fULOrderParams.setParameterArray(parameters.toArray(new Parameter[parameters.size()]));
  }
  OrderAttribute orderAttribute=new OrderAttribute(type,ebicsUser.getEbicsTypeSelect());
  orderAttribute.build();
  orderDetails=EbicsXmlFactory.createStaticHeaderOrderDetailsType(ebicsUser.getNextOrderId(),orderAttribute.getOrderAttributes(),orderType,fULOrderParams);
  xstatic=EbicsXmlFactory.createStaticHeaderType(session.getBankID(),nonce,splitter.getSegmentNumber(),ebicsUser.getEbicsPartner().getPartnerId(),product,ebicsUser.getSecurityMedium(),ebicsUser.getUserId(),Calendar.getInstance(),orderDetails,bankPubKeyDigests);
  header=EbicsXmlFactory.createEbicsRequestHeader(true,mutable,xstatic);
  encryptionPubKeyDigest=EbicsXmlFactory.createEncryptionPubKeyDigest("String_Node_Str","String_Node_Str",decodeHex(KeyUtil.getKeyDigest(session.getBankE002Key())));
  signatureData=EbicsXmlFactory.createSignatureData(true,EbicsUtils.encrypt(EbicsUtils.zip(userSignature.prettyPrint()),keySpec));
  dataEncryptionInfo=EbicsXmlFactory.createDataEncryptionInfo(true,encryptionPubKeyDigest,generateTransactionKey());
  dataTransfer=EbicsXmlFactory.createDataTransferRequestType(dataEncryptionInfo,signatureData);
  body=EbicsXmlFactory.createEbicsRequestBody(dataTransfer);
  request=EbicsXmlFactory.createEbicsRequest(1,"String_Node_Str",header,body);
  document=EbicsXmlFactory.createEbicsRequestDocument(request);
}

Fixed version (ground truth):
@Override public void buildInitialization() throws AxelorException {
  EbicsRequest request;
  Header header;
  Body body;
  MutableHeaderType mutable;
  StaticHeaderType xstatic;
  Product product;
  BankPubKeyDigests bankPubKeyDigests;
  Authentication authentication;
  Encryption encryption;
  DataTransferRequestType dataTransfer;
  DataEncryptionInfo dataEncryptionInfo;
  SignatureData signatureData;
  EncryptionPubKeyDigest encryptionPubKeyDigest;
  StaticHeaderOrderDetailsType orderDetails;
  FULOrderParamsType fULOrderParams;
  OrderType orderType;
  FileFormatType fileFormat;
  List<Parameter> parameters;
  EbicsUser ebicsUser=session.getUser();
  EbicsUser signataire=ebicsUser.getEbicsPartner().getDefaultSignatoryEbicsUser();
  if (signataire.getEbicsTypeSelect() == EbicsUserRepository.EBICS_TYPE_TS) {
    userSignature=new UserSignature(signataire,generateName("String_Node_Str"),"String_Node_Str",userSignatureData);
  }
 else {
    userSignature=new UserSignature(ebicsUser,generateName("String_Node_Str"),"String_Node_Str",userData);
  }
  userSignature.build();
  log.debug("String_Node_Str",userSignature.toString());
  userSignature.validate();
  log.debug("String_Node_Str",userSignature.toString());
  splitter.readInput(true,keySpec);
  mutable=EbicsXmlFactory.createMutableHeaderType("String_Node_Str",null);
  product=EbicsXmlFactory.createProduct(session.getProduct().getLanguage(),session.getProduct().getName());
  authentication=EbicsXmlFactory.createAuthentication("String_Node_Str","String_Node_Str",decodeHex(KeyUtil.getKeyDigest(session.getBankX002Key())));
  encryption=EbicsXmlFactory.createEncryption("String_Node_Str","String_Node_Str",decodeHex(KeyUtil.getKeyDigest(session.getBankE002Key())));
  bankPubKeyDigests=EbicsXmlFactory.createBankPubKeyDigests(authentication,encryption);
  orderType=EbicsXmlFactory.createOrderType(type.getOrderType());
  fileFormat=EbicsXmlFactory.createFileFormatType(Locale.FRANCE.getCountry(),session.getSessionParam("String_Node_Str"));
  fULOrderParams=EbicsXmlFactory.createFULOrderParamsType(fileFormat);
  parameters=new ArrayList<Parameter>();
  if (Boolean.valueOf(session.getSessionParam("String_Node_Str")).booleanValue()) {
    Parameter parameter;
    Value value;
    value=EbicsXmlFactory.createValue("String_Node_Str","String_Node_Str");
    parameter=EbicsXmlFactory.createParameter("String_Node_Str",value);
    parameters.add(parameter);
  }
  if (Boolean.valueOf(session.getSessionParam("String_Node_Str")).booleanValue()) {
    Parameter parameter;
    Value value;
    value=EbicsXmlFactory.createValue("String_Node_Str","String_Node_Str");
    parameter=EbicsXmlFactory.createParameter("String_Node_Str",value);
    parameters.add(parameter);
  }
  if (parameters.size() > 0) {
    fULOrderParams.setParameterArray(parameters.toArray(new Parameter[parameters.size()]));
  }
  OrderAttribute orderAttribute=new OrderAttribute(type,ebicsUser.getEbicsTypeSelect());
  orderAttribute.build();
  orderDetails=EbicsXmlFactory.createStaticHeaderOrderDetailsType(ebicsUser.getNextOrderId(),orderAttribute.getOrderAttributes(),orderType,fULOrderParams);
  xstatic=EbicsXmlFactory.createStaticHeaderType(session.getBankID(),nonce,splitter.getSegmentNumber(),ebicsUser.getEbicsPartner().getPartnerId(),product,ebicsUser.getSecurityMedium(),ebicsUser.getUserId(),Calendar.getInstance(),orderDetails,bankPubKeyDigests);
  header=EbicsXmlFactory.createEbicsRequestHeader(true,mutable,xstatic);
  encryptionPubKeyDigest=EbicsXmlFactory.createEncryptionPubKeyDigest("String_Node_Str","String_Node_Str",decodeHex(KeyUtil.getKeyDigest(session.getBankE002Key())));
  System.out.println("String_Node_Str");
  System.out.println(userSignature.toString());
  signatureData=EbicsXmlFactory.createSignatureData(true,EbicsUtils.encrypt(EbicsUtils.zip(userSignature.prettyPrint()),keySpec));
  dataEncryptionInfo=EbicsXmlFactory.createDataEncryptionInfo(true,encryptionPubKeyDigest,generateTransactionKey());
  dataTransfer=EbicsXmlFactory.createDataTransferRequestType(dataEncryptionInfo,signatureData);
  body=EbicsXmlFactory.createEbicsRequestBody(dataTransfer);
  request=EbicsXmlFactory.createEbicsRequest(1,"String_Node_Str",header,body);
  document=EbicsXmlFactory.createEbicsRequestDocument(request);
  ByteArrayOutputStream bout=new ByteArrayOutputStream();
  try {
    this.save(bout);
  }
 catch (  JDOMException e) {
    e.printStackTrace();
  }
  System.out.println("String_Node_Str");
  System.out.println(bout.toString());
}