Program: 20349
Project: 20349
Buggy source:
private Order[] transformTickets(List<TicketInfo> ticketlist){
  Order[] orders=new Order[ticketlist.size()];
  for (int i=0; i < ticketlist.size(); i++) {
    TicketInfo ticket=ticketlist.get(i);
    orders[i]=new Order();
    OrderIdentifier orderid=new OrderIdentifier();
    Calendar datenew=Calendar.getInstance();
    datenew.setTime(ticket.getDate());
    orderid.setDateNew(datenew);
    orderid.setDocumentNo(Integer.toString(ticket.getTicketId()));
    orders[i].setOrderId(orderid);
    orders[i].setState(800175);
    BPartner bp;
    if (ticket.getCustomerId() == null) {
      bp=null;
    }
 else {
      bp=new BPartner();
      bp.setId(ticket.getCustomer().getSearchkey());
      bp.setName(ticket.getCustomer().getName());
    }
    orders[i].setBusinessPartner(bp);
    OrderLine[] orderLine=new OrderLine[ticket.getLines().size()];
    for (int j=0; j < ticket.getLines().size(); j++) {
      TicketLineInfo line=ticket.getLines().get(j);
      orderLine[j]=new OrderLine();
      orderLine[j].setOrderLineId(line.getTicketLine());
      if (line.getProductID() == null) {
        orderLine[j].setProductId(0);
      }
 else {
        orderLine[j].setProductId(parseInt(line.getProductID()));
      }
      orderLine[j].setUnits(line.getMultiply());
      orderLine[j].setPrice(line.getPrice());
      orderLine[j].setTaxId(parseInt(line.getTaxInfo().getId()));
    }
    orders[i].setLines(orderLine);
    Payment[] paymentLine=new Payment[ticket.getPayments().size()];
    for (int j=0; j < ticket.getPayments().size(); j++) {
      PaymentInfo payment=ticket.getPayments().get(j);
      paymentLine[j]=new Payment();
      paymentLine[j].setAmount(payment.getTotal());
      if ("String_Node_Str".equals(payment.getName())) {
        paymentLine[j].setPaymentType("String_Node_Str");
      }
 else       if ("String_Node_Str".equals(payment.getName())) {
        paymentLine[j].setPaymentType("String_Node_Str");
      }
 else       if ("String_Node_Str".equals(payment.getName())) {
        paymentLine[j].setPaymentType("String_Node_Str");
      }
 else {
        paymentLine[j].setPaymentType(null);
      }
    }
    orders[i].setPayment(paymentLine);
  }
  return orders;
}

Fixed version (ground truth):
private Order[] transformTickets(List<TicketInfo> ticketlist){
  Order[] orders=new Order[ticketlist.size()];
  for (int i=0; i < ticketlist.size(); i++) {
    TicketInfo ticket=ticketlist.get(i);
    orders[i]=new Order();
    OrderIdentifier orderid=new OrderIdentifier();
    Calendar datenew=Calendar.getInstance();
    datenew.setTime(ticket.getDate());
    orderid.setDateNew(datenew);
    orderid.setDocumentNo(Integer.toString(ticket.getTicketId()));
    orders[i].setOrderId(orderid);
    orders[i].setState(800175);
    BPartner bp;
    if (ticket.getCustomerId() == null) {
      bp=null;
    }
 else {
      bp=new BPartner();
      bp.setId(ticket.getCustomer().getSearchkey());
      bp.setName(ticket.getCustomer().getName());
    }
    orders[i].setBusinessPartner(bp);
    OrderLine[] orderLine=new OrderLine[ticket.getLines().size()];
    for (int j=0; j < ticket.getLines().size(); j++) {
      TicketLineInfo line=ticket.getLines().get(j);
      orderLine[j]=new OrderLine();
      orderLine[j].setOrderLineId(String.valueOf(line.getTicketLine()));
      if (line.getProductID() == null) {
        orderLine[j].setProductId("String_Node_Str");
      }
 else {
        orderLine[j].setProductId(line.getProductID());
      }
      orderLine[j].setUnits(line.getMultiply());
      orderLine[j].setPrice(line.getPrice());
      orderLine[j].setTaxId(line.getTaxInfo().getId());
    }
    orders[i].setLines(orderLine);
    Payment[] paymentLine=new Payment[ticket.getPayments().size()];
    for (int j=0; j < ticket.getPayments().size(); j++) {
      PaymentInfo payment=ticket.getPayments().get(j);
      paymentLine[j]=new Payment();
      paymentLine[j].setAmount(payment.getTotal());
      if ("String_Node_Str".equals(payment.getName())) {
        paymentLine[j].setPaymentType("String_Node_Str");
      }
 else       if ("String_Node_Str".equals(payment.getName())) {
        paymentLine[j].setPaymentType("String_Node_Str");
      }
 else       if ("String_Node_Str".equals(payment.getName())) {
        paymentLine[j].setPaymentType("String_Node_Str");
      }
 else {
        paymentLine[j].setPaymentType(null);
      }
    }
    orders[i].setPayment(paymentLine);
  }
  return orders;
}