Program: 144375
Project: 144375
Buggy source:
public OrderBean transformToOrderFormBean(Orders entity){
  OrderBean formBean=new OrderBean();
  formBean.setOrderNumber(entity.getOrderNumber());
  Contacts shipperContactName=customerService.findContactById(entity.getShipperContactId());
  Customer customerName=customerService.findCustomerById(shipperContactName.getReferenceId());
  formBean.setCustomerName((customerName.getCustomerName()));
  formBean.setServiceRequirement(entity.getServiceRequirement());
  formBean.setModeOfService(entity.getServiceMode());
  Contacts consigneeName=customerService.findContactById(entity.getConsigneeContactId());
  formBean.setConsigneeCode(getFullName(consigneeName.getLastName(),consigneeName.getFirstName(),consigneeName.getMiddleName()));
  formBean.setOrderId(entity.getOrderId());
  List<OrderItems> orderItemsVolume=orderService.findAllItemByOrderId(entity.getOrderId());
  Float orderVolume=0.F;
  for (  OrderItems orderItemElem : orderItemsVolume) {
    if (orderItemElem.getVolume() != null) {
      orderVolume=orderVolume + orderItemElem.getVolume();
    }
  }
  formBean.setOrderVolume(orderVolume);
  Double orderWeight=0.0;
  for (  OrderItems orderItemElem : orderItemsVolume) {
    if (orderItemElem.getWeight() != null) {
      orderWeight=orderWeight + orderItemElem.getWeight();
    }
  }
  formBean.setOrderWeight(orderWeight);
  formBean.setOrderStatus(entity.getOrderStatus());
  formBean.setFreightType(entity.getServiceType());
  if (entity.getOriginationPort() != null) {
    formBean.setOriginationPort(entity.getOriginationPort());
  }
 else {
    formBean.setOriginationPort("String_Node_Str");
  }
  formBean.setModeOfPayment(entity.getPaymentMode());
  formBean.setNotifyBy(entity.getNotificationType());
  formBean.setOrderDate(entity.getOrderDate());
  if (entity.getDestinationPort() != null) {
    formBean.setDestinationPort(entity.getDestinationPort());
  }
 else {
    formBean.setDestinationPort("String_Node_Str");
  }
  formBean.setRates(entity.getRates());
  formBean.setComments(entity.getComments());
  formBean.setPickupDate(entity.getPickupDate());
  formBean.setDeliveryDate(entity.getDeliveryDate());
  Contacts contactShipperName=customerService.findContactById(entity.getShipperContactId());
  Customer shipperName=customerService.findCustomerById(contactShipperName.getReferenceId());
  if (shipperName != null) {
    formBean.setCustomerId(shipperName.getCustomerId());
    formBean.setCustomerName(shipperName.getCustomerName());
  }
  Contacts contacts=customerService.findContactById(entity.getShipperContactId());
  contact=new ContactBean();
  contact.setName(getFullName(contacts.getLastName(),contacts.getFirstName(),contacts.getMiddleName()));
  contact.setPhone(contacts.getPhone());
  contact.setEmail(contacts.getEmail());
  contact.setFax(contacts.getFax());
  contact.setMobile(contacts.getMobile());
  formBean.setShipperInfoContact(contact);
  if (entity.getShipperAddressId() != null) {
    Address addresses=customerService.findAddressById(entity.getShipperAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(addresses));
    formBean.setShipperInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    formBean.setShipperInfoAddress(address);
  }
  Contacts consigneeContact=customerService.findContactById(entity.getConsigneeContactId());
  contact=new ContactBean();
  contact.setName(getFullName(consigneeContact.getLastName(),consigneeContact.getFirstName(),consigneeContact.getMiddleName()));
  contact.setPhone(consigneeContact.getPhone());
  contact.setEmail(consigneeContact.getEmail());
  contact.setFax(consigneeContact.getFax());
  contact.setMobile(consigneeContact.getMobile());
  formBean.setConsigneeInfoContact(contact);
  if (entity.getConsigneeAddressId() != null) {
    Address consigneeAddress=customerService.findAddressById(entity.getConsigneeAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(consigneeAddress));
    formBean.setConsigneeInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    formBean.setConsigneeInfoAddress(address);
  }
  formBean.setConsigneeContactPersonId(order.getConsigneeContactPersonId());
  if (order.getConsigneeContactPersonId() != null) {
    Contacts contactElem=customerService.findContactById(order.getConsigneeContactPersonId());
    formBean.setConsigneeContactName(contactElem.getFirstName() + "String_Node_Str" + contactElem.getMiddleName()+ "String_Node_Str"+ contactElem.getLastName());
  }
  List<OrderItems> orderItemEntity=operationsService.findAllOrderItemsByOrderId(entity.getOrderId());
  if (orderItemEntity.size() >= 1) {
    if (orderItemEntity.get(0).getTruckOrigin() == null || "String_Node_Str".equals(orderItemEntity.get(0).getTruckOrigin())) {
      formBean.setPlateNumberOri("String_Node_Str");
    }
 else {
      Trucks truckEntityOri=vendorService.findTrucksByTruckCode(orderItemEntity.get(0).getTruckOrigin());
      formBean.setPlateNumberOri(truckEntityOri.getPlateNumber());
    }
    if (orderItemEntity.get(0).getTruckDestination() == null || "String_Node_Str".equals(orderItemEntity.get(0).getTruckDestination())) {
      formBean.setPlateNumberDes("String_Node_Str");
    }
 else {
      Trucks truckEntityDes=vendorService.findTrucksByTruckCode(orderItemEntity.get(0).getTruckDestination());
      formBean.setPlateNumberDes(truckEntityDes.getPlateNumber());
    }
  }
  return formBean;
}

Fixed version (ground truth):
public OrderBean transformToOrderFormBean(Orders entity){
  OrderBean formBean=new OrderBean();
  formBean.setOrderNumber(entity.getOrderNumber());
  Contacts shipperContactName=customerService.findContactById(entity.getShipperContactId());
  Customer customerName=customerService.findCustomerById(shipperContactName.getReferenceId());
  formBean.setCustomerName((customerName.getCustomerName()));
  formBean.setServiceRequirement(entity.getServiceRequirement());
  formBean.setModeOfService(entity.getServiceMode());
  Contacts consigneeName=customerService.findContactById(entity.getConsigneeContactId());
  formBean.setConsigneeCode(getFullName(consigneeName.getLastName(),consigneeName.getFirstName(),consigneeName.getMiddleName()));
  formBean.setOrderId(entity.getOrderId());
  List<OrderItems> orderItemsVolume=orderService.findAllItemByOrderId(entity.getOrderId());
  Float orderVolume=0.F;
  for (  OrderItems orderItemElem : orderItemsVolume) {
    if (orderItemElem.getVolume() != null) {
      orderVolume=orderVolume + orderItemElem.getVolume();
    }
  }
  formBean.setOrderVolume(orderVolume);
  Double orderWeight=0.0;
  for (  OrderItems orderItemElem : orderItemsVolume) {
    if (orderItemElem.getWeight() != null) {
      orderWeight=orderWeight + orderItemElem.getWeight();
    }
  }
  formBean.setOrderWeight(orderWeight);
  formBean.setOrderStatus(entity.getOrderStatus());
  formBean.setFreightType(entity.getServiceType());
  if (entity.getOriginationPort() != null) {
    formBean.setOriginationPort(entity.getOriginationPort());
  }
 else   if (entity.getServiceMode().equals("String_Node_Str")) {
    formBean.setOriginationPort("String_Node_Str");
  }
 else {
    formBean.setOriginationPort("String_Node_Str");
  }
  formBean.setModeOfPayment(entity.getPaymentMode());
  formBean.setNotifyBy(entity.getNotificationType());
  formBean.setOrderDate(entity.getOrderDate());
  if (entity.getDestinationPort() != null) {
    formBean.setDestinationPort(entity.getDestinationPort());
  }
 else   if (entity.getServiceMode().equals("String_Node_Str")) {
    formBean.setDestinationPort("String_Node_Str");
  }
 else {
    formBean.setDestinationPort("String_Node_Str");
  }
  formBean.setRates(entity.getRates());
  formBean.setComments(entity.getComments());
  SimpleDateFormat formatter=new SimpleDateFormat("String_Node_Str");
  if (entity.getPickupDate() != null) {
    formBean.setStrPickupDate(formatter.format(entity.getPickupDate()));
  }
 else   if (entity.getServiceMode().equals("String_Node_Str")) {
    formBean.setStrPickupDate("String_Node_Str");
  }
 else {
    formBean.setStrPickupDate("String_Node_Str");
  }
  if (entity.getDeliveryDate() != null) {
    formBean.setStrDeliveryDate(formatter.format(entity.getDeliveryDate()));
  }
 else   if (entity.getServiceMode().equals("String_Node_Str")) {
    formBean.setStrDeliveryDate("String_Node_Str");
  }
 else {
    formBean.setStrDeliveryDate("String_Node_Str");
  }
  Contacts contactShipperName=customerService.findContactById(entity.getShipperContactId());
  Customer shipperName=customerService.findCustomerById(contactShipperName.getReferenceId());
  if (shipperName != null) {
    formBean.setCustomerId(shipperName.getCustomerId());
    formBean.setCustomerName(shipperName.getCustomerName());
  }
  Contacts contacts=customerService.findContactById(entity.getShipperContactId());
  contact=new ContactBean();
  contact.setName(getFullName(contacts.getLastName(),contacts.getFirstName(),contacts.getMiddleName()));
  contact.setPhone(contacts.getPhone());
  contact.setEmail(contacts.getEmail());
  contact.setFax(contacts.getFax());
  contact.setMobile(contacts.getMobile());
  formBean.setShipperInfoContact(contact);
  if (entity.getShipperAddressId() != null) {
    Address addresses=customerService.findAddressById(entity.getShipperAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(addresses));
    formBean.setShipperInfoAddress(address);
  }
 else   if (entity.getServiceMode().equals("String_Node_Str")) {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    formBean.setShipperInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    formBean.setShipperInfoAddress(address);
  }
  Contacts consigneeContact=customerService.findContactById(entity.getConsigneeContactId());
  contact=new ContactBean();
  contact.setName(getFullName(consigneeContact.getLastName(),consigneeContact.getFirstName(),consigneeContact.getMiddleName()));
  contact.setPhone(consigneeContact.getPhone());
  contact.setEmail(consigneeContact.getEmail());
  contact.setFax(consigneeContact.getFax());
  contact.setMobile(consigneeContact.getMobile());
  formBean.setConsigneeInfoContact(contact);
  if (entity.getConsigneeAddressId() != null) {
    Address consigneeAddress=customerService.findAddressById(entity.getConsigneeAddressId());
    address=new AddressBean();
    address.setAddress(getAddress(consigneeAddress));
    formBean.setConsigneeInfoAddress(address);
  }
 else   if (entity.getServiceMode().equals("String_Node_Str")) {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    formBean.setConsigneeInfoAddress(address);
  }
 else {
    address=new AddressBean();
    address.setAddress("String_Node_Str");
    formBean.setConsigneeInfoAddress(address);
  }
  formBean.setConsigneeContactPersonId(entity.getConsigneeContactPersonId());
  if (entity.getConsigneeContactPersonId() != null) {
    Contacts contactElem=customerService.findContactById(entity.getConsigneeContactPersonId());
    formBean.setConsigneeContactName(contactElem.getFirstName() + "String_Node_Str" + contactElem.getMiddleName()+ "String_Node_Str"+ contactElem.getLastName());
  }
  List<OrderItems> orderItemEntity=operationsService.findAllOrderItemsByOrderId(entity.getOrderId());
  if (orderItemEntity.size() >= 1) {
    if (orderItemEntity.get(0).getTruckOrigin() == null || "String_Node_Str".equals(orderItemEntity.get(0).getTruckOrigin())) {
      formBean.setPlateNumberOri("String_Node_Str");
    }
 else {
      Trucks truckEntityOri=vendorService.findTrucksByTruckCode(orderItemEntity.get(0).getTruckOrigin());
      formBean.setPlateNumberOri(truckEntityOri.getPlateNumber());
    }
    if (orderItemEntity.get(0).getTruckDestination() == null || "String_Node_Str".equals(orderItemEntity.get(0).getTruckDestination())) {
      formBean.setPlateNumberDes("String_Node_Str");
    }
 else {
      Trucks truckEntityDes=vendorService.findTrucksByTruckCode(orderItemEntity.get(0).getTruckDestination());
      formBean.setPlateNumberDes(truckEntityDes.getPlateNumber());
    }
  }
  return formBean;
}