Program: 144397
Project: 144397
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());
  Orders orderEntity=orderService.findOrdersById(entity.getOrderId());
  if (orderItemEntity.size() >= 1) {
    if (orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str")|| orderEntity.getServiceMode().equals("String_Node_Str")) {
      if (orderItemEntity.get(0).getTruckOrigin() != null || "String_Node_Str".equals(orderItemEntity.get(0).getTruckOrigin())) {
        Trucks truckEntityOri=vendorService.findTrucksByTruckCode(orderItemEntity.get(0).getTruckOrigin());
        formBean.setPlateNumberOri(truckEntityOri.getPlateNumber());
      }
 else {
        formBean.setPlateNumberOri("String_Node_Str");
      }
    }
 else     if (orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str")|| orderEntity.getServiceMode().equals("String_Node_Str")) {
      if (orderItemEntity.get(0).getTruckDestination() != null || "String_Node_Str".equals(orderItemEntity.get(0).getTruckDestination())) {
        Trucks truckEntityDes=vendorService.findTrucksByTruckCode(orderItemEntity.get(0).getTruckDestination());
        formBean.setPlateNumberDes(truckEntityDes.getPlateNumber());
      }
 else {
        formBean.setPlateNumberDes("String_Node_Str");
      }
    }
  }
  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 {
    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());
  Orders orderEntity=orderService.findOrdersById(entity.getOrderId());
  if (orderItemEntity.size() >= 1) {
    if (orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str")|| orderEntity.getServiceMode().equals("String_Node_Str")) {
      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());
      }
    }
 else     if (orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str") || orderEntity.getServiceMode().equals("String_Node_Str")|| orderEntity.getServiceMode().equals("String_Node_Str")) {
      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;
}