Program: 144382
Project: 144382
Buggy source:
private OrderBean transformToOrderFormBean(Orders order){
  OrderBean orderBean=new OrderBean();
  orderBean.setOrderId(order.getOrderId());
  orderBean.setOrderNumber(order.getOrderNumber());
  orderBean.setFreightType(order.getServiceType());
  orderBean.setModeOfService(order.getServiceMode());
  orderBean.setNotifyBy(order.getNotificationType());
  orderBean.setOrderDate(order.getOrderDate());
  orderBean.setModeOfPayment(order.getPaymentMode());
  orderBean.setComments(order.getComments());
  orderBean.setOrderStatus(order.getOrderStatus());
  orderBean.setShipperCode(order.getVendorCode());
  orderBean.setTruckCode(order.getTruckCode());
  orderBean.setTrailerCode(order.getTrailerCode());
  orderBean.setDriverCode(order.getDriverCode());
  orderBean.setVesselNumber(order.getVesselNumber());
  orderBean.setShipperAddressId(order.getShipperAddressId());
  orderBean.setShipperContactId(order.getShipperContactId());
  Contacts shipperContactName=customerService.findContactById(order.getShipperContactId());
  orderBean.setShipperContactName(getFullName(shipperContactName));
  orderBean.setConsigneeAddressId(order.getConsigneeAddressId());
  orderBean.setConsigneeContactId(order.getConsigneeContactId());
  Contacts consigneeContactName=customerService.findContactById(order.getConsigneeContactId());
  orderBean.setConsigneeName(getFullName(consigneeContactName));
  orderBean.setAccountRep(order.getAccountRep());
  orderBean.setCreatedTimestamp(order.getCreatedTimestamp());
  orderBean.setCreatedBy(order.getCreatedBy());
  orderBean.setModifiedTimestamp(order.getModifiedTimestamp());
  orderBean.setModifiedBy(order.getModifiedBy());
  orderBean.setPickupDate(order.getPickupDate());
  orderBean.setOriginationPort(order.getOriginationPort());
  orderBean.setDeliveryDate(order.getDeliveryDate());
  orderBean.setDestinationPort(order.getDestinationPort());
  orderBean.setRates(order.getRates());
  orderBean.setServiceRequirement(order.getServiceRequirement());
  Contacts contactShipperName=customerService.findContactById(order.getShipperContactId());
  Customer shipperName=customerService.findCustomerById(contactShipperName.getReferenceId());
  if (shipperName != null) {
    orderBean.setCustomerId(shipperName.getCustomerId());
    orderBean.setCustomerName(shipperName.getCustomerName());
  }
  orderBean.setPickupDate(order.getPickupDate());
  orderBean.setDeliveryDate(order.getDeliveryDate());
  Contacts contacts=customerService.findContactById(order.getShipperContactId());
  contact=new ContactBean();
  contact.setName(getFullName(contacts));
  contact.setPhone(contacts.getPhone());
  contact.setEmail(contacts.getEmail());
  contact.setFax(contacts.getFax());
  contact.setMobile(contacts.getMobile());
  orderBean.setShipperInfoContact(contact);
  if (order.getShipperAddressId() != null) {
    Address addresses=customerService.findAddressById(order.getShipperAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(addresses));
    orderBean.setShipperInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    orderBean.setShipperInfoAddress(address);
  }
  Contacts consigneeContact=customerService.findContactById(order.getConsigneeContactId());
  contact=new ContactBean();
  contact.setName(getFullName(consigneeContact));
  contact.setPhone(consigneeContact.getPhone());
  contact.setEmail(consigneeContact.getEmail());
  contact.setFax(consigneeContact.getFax());
  contact.setMobile(consigneeContact.getMobile());
  orderBean.setConsigneeInfoContact(contact);
  if (order.getConsigneeAddressId() != null) {
    Address consigneeAddress=customerService.findAddressById(order.getConsigneeAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(consigneeAddress));
    orderBean.setConsigneeInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    orderBean.setConsigneeInfoAddress(address);
  }
  orderBean.setConsigneeContactPersonId(order.getConsigneeContactPersonId());
  if (order.getConsigneeContactPersonId() != null) {
    Contacts contactElem=customerService.findContactById(order.getConsigneeContactPersonId());
    orderBean.setConsigneeContactName(contactElem.getFirstName() + "String_Node_Str" + contactElem.getMiddleName()+ "String_Node_Str"+ contactElem.getLastName());
  }
  outboundEntityList=documentsService.findDocumentsByOrderId(order.getOrderId());
  for (  Documents documentElem : outboundEntityList) {
    if (documentElem.getDocumentName().equals("String_Node_Str")) {
      orderBean.setDocumentCheck("String_Node_Str");
      orderBean.setDocumentId(documentElem.getDocumentId());
    }
  }
  return orderBean;
}

Fixed version (ground truth):
private OrderBean transformToOrderFormBean(Orders order){
  OrderBean orderBean=new OrderBean();
  orderBean.setOrderId(order.getOrderId());
  orderBean.setOrderNumber(order.getOrderNumber());
  orderBean.setFreightType(order.getServiceType());
  orderBean.setModeOfService(order.getServiceMode());
  orderBean.setNotifyBy(order.getNotificationType());
  orderBean.setOrderDate(order.getOrderDate());
  orderBean.setModeOfPayment(order.getPaymentMode());
  orderBean.setComments(order.getComments());
  orderBean.setOrderStatus(order.getOrderStatus());
  orderBean.setShipperCode(order.getVendorCode());
  orderBean.setTruckCode(order.getTruckCode());
  orderBean.setTrailerCode(order.getTrailerCode());
  orderBean.setDriverCode(order.getDriverCode());
  orderBean.setVesselNumber(order.getVesselNumber());
  orderBean.setShipperAddressId(order.getShipperAddressId());
  orderBean.setShipperContactId(order.getShipperContactId());
  Contacts shipperContactName=customerService.findContactById(order.getShipperContactId());
  orderBean.setShipperContactName(getFullName(shipperContactName));
  orderBean.setConsigneeAddressId(order.getConsigneeAddressId());
  orderBean.setConsigneeContactId(order.getConsigneeContactId());
  Contacts consigneeContactName=customerService.findContactById(order.getConsigneeContactId());
  orderBean.setConsigneeName(getFullName(consigneeContactName));
  orderBean.setAccountRep(order.getAccountRep());
  orderBean.setCreatedTimestamp(order.getCreatedTimestamp());
  orderBean.setCreatedBy(order.getCreatedBy());
  orderBean.setModifiedTimestamp(order.getModifiedTimestamp());
  orderBean.setModifiedBy(order.getModifiedBy());
  orderBean.setPickupDate(order.getPickupDate());
  if (order.getOriginationPort() != null) {
    orderBean.setOriginationPort(order.getOriginationPort());
  }
 else   if (order.getServiceMode().equals("String_Node_Str")) {
    orderBean.setOriginationPort("String_Node_Str");
  }
 else {
    orderBean.setOriginationPort("String_Node_Str");
  }
  orderBean.setDeliveryDate(order.getDeliveryDate());
  if (order.getDestinationPort() != null) {
    orderBean.setDestinationPort(order.getDestinationPort());
  }
 else   if (order.getServiceMode().equals("String_Node_Str")) {
    orderBean.setDestinationPort("String_Node_Str");
  }
 else {
    orderBean.setDestinationPort("String_Node_Str");
  }
  orderBean.setRates(order.getRates());
  orderBean.setServiceRequirement(order.getServiceRequirement());
  Contacts contactShipperName=customerService.findContactById(order.getShipperContactId());
  Customer shipperName=customerService.findCustomerById(contactShipperName.getReferenceId());
  if (shipperName != null) {
    orderBean.setCustomerId(shipperName.getCustomerId());
    orderBean.setCustomerName(shipperName.getCustomerName());
  }
  SimpleDateFormat formatter=new SimpleDateFormat("String_Node_Str");
  if (order.getPickupDate() != null) {
    orderBean.setStrPickupDate(formatter.format(order.getPickupDate()));
  }
 else   if (order.getServiceMode().equals("String_Node_Str")) {
    orderBean.setStrPickupDate("String_Node_Str");
  }
 else {
    orderBean.setStrPickupDate("String_Node_Str");
  }
  if (order.getDeliveryDate() != null) {
    orderBean.setStrDeliveryDate(formatter.format(order.getDeliveryDate()));
  }
 else   if (order.getServiceMode().equals("String_Node_Str")) {
    orderBean.setStrDeliveryDate("String_Node_Str");
  }
 else {
    orderBean.setStrDeliveryDate("String_Node_Str");
  }
  Contacts contacts=customerService.findContactById(order.getShipperContactId());
  contact=new ContactBean();
  contact.setName(getFullName(contacts));
  contact.setPhone(contacts.getPhone());
  contact.setEmail(contacts.getEmail());
  contact.setFax(contacts.getFax());
  contact.setMobile(contacts.getMobile());
  orderBean.setShipperInfoContact(contact);
  if (order.getShipperAddressId() != null) {
    Address addresses=customerService.findAddressById(order.getShipperAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(addresses));
    orderBean.setShipperInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    orderBean.setShipperInfoAddress(address);
  }
  Contacts consigneeContact=customerService.findContactById(order.getConsigneeContactId());
  contact=new ContactBean();
  contact.setName(getFullName(consigneeContact));
  contact.setPhone(consigneeContact.getPhone());
  contact.setEmail(consigneeContact.getEmail());
  contact.setFax(consigneeContact.getFax());
  contact.setMobile(consigneeContact.getMobile());
  orderBean.setConsigneeInfoContact(contact);
  if (order.getConsigneeAddressId() != null) {
    Address consigneeAddress=customerService.findAddressById(order.getConsigneeAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(consigneeAddress));
    orderBean.setConsigneeInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    orderBean.setConsigneeInfoAddress(address);
  }
  orderBean.setConsigneeContactPersonId(order.getConsigneeContactPersonId());
  if (order.getConsigneeContactPersonId() != null) {
    Contacts contactElem=customerService.findContactById(order.getConsigneeContactPersonId());
    orderBean.setConsigneeContactName(contactElem.getFirstName() + "String_Node_Str" + contactElem.getMiddleName()+ "String_Node_Str"+ contactElem.getLastName());
  }
  outboundEntityList=documentsService.findDocumentsByOrderId(order.getOrderId());
  for (  Documents documentElem : outboundEntityList) {
    if (documentElem.getDocumentName().equals("String_Node_Str")) {
      orderBean.setDocumentCheck("String_Node_Str");
      orderBean.setDocumentId(documentElem.getDocumentId());
    }
  }
  return orderBean;
}