Program: 144526
Project: 144526
Buggy source:
private Orders transformToOrderEntityBean(OrderBean formBean){
  Orders entity=new Orders();
  Client client=clientService.findClientById(getClientId().toString());
  entity.setClient(client);
  entity.setOrderDate(new Date());
  entity.setServiceRequirement(formBean.getServiceRequirement());
  Customer customerEntity=customerService.findCustomerById(formBean.getCustomerId());
  custName=customerEntity.getCustomerName();
  custCode=customerEntity.getCustomerCode();
  orderNum=orderService.findNextBookingNo(getClientId(),custCode);
  if (formBean.getOrderNumber() != null) {
    entity.setOrderNumber(new String(formBean.getOrderNumber()));
  }
 else {
    entity.setOrderNumber(orderNum);
  }
  if (formBean.getOrderId() != null)   entity.setOrderId(new Integer(formBean.getOrderId()));
  entity.setServiceType(formBean.getFreightType());
  entity.setServiceMode(formBean.getModeOfService());
  entity.setNotificationType(formBean.getNotifyBy());
  entity.setPaymentMode(formBean.getModeOfPayment());
  entity.setOriginationPort(formBean.getOriginationPort());
  entity.setDestinationPort(formBean.getDestinationPort());
  entity.setComments(formBean.getComments());
  entity.setOrderStatus("String_Node_Str");
  entity.setRates(99.99);
  entity.setCreatedBy(commonUtils.getUserNameFromSession());
  entity.setAccountRep(commonUtils.getUserNameFromSession());
  entity.setModifiedBy(commonUtils.getUserNameFromSession());
  entity.setCreatedTimestamp(new Date());
  entity.setModifiedTimestamp(new Date());
  entity.setShipperAddressId(formBean.getShipperAddressId());
  entity.setShipperContactId(formBean.getShipperContactId());
  entity.setConsigneeAddressId(formBean.getConsigneeAddressId());
  entity.setConsigneeContactId(formBean.getConsigneeContactId());
  entity.setDeliveryDate(new Timestamp((formBean.getDeliveryDate()).getTime()));
  entity.setPickupDate(new Timestamp((formBean.getPickupDate()).getTime()));
  return entity;
}

Fixed version (ground truth):
private Orders transformToOrderEntityBean(OrderBean formBean){
  Orders entity=new Orders();
  Client client=clientService.findClientById(getClientId().toString());
  entity.setClient(client);
  entity.setOrderDate(new Date());
  entity.setServiceRequirement(formBean.getServiceRequirement());
  System.out.println("String_Node_Str" + formBean.getCustomerId());
  Customer customerEntity=customerService.findCustomerById(formBean.getCustomerId());
  custName=customerEntity.getCustomerName();
  custCode=customerEntity.getCustomerCode();
  orderNum=orderService.findNextBookingNo(getClientId(),custCode);
  if (formBean.getOrderNumber() != null) {
    entity.setOrderNumber(new String(formBean.getOrderNumber()));
  }
 else {
    entity.setOrderNumber(orderNum);
  }
  if (formBean.getOrderId() != null)   entity.setOrderId(new Integer(formBean.getOrderId()));
  entity.setServiceType(formBean.getFreightType());
  entity.setServiceMode(formBean.getModeOfService());
  entity.setNotificationType(formBean.getNotifyBy());
  entity.setPaymentMode(formBean.getModeOfPayment());
  entity.setOriginationPort(formBean.getOriginationPort());
  entity.setDestinationPort(formBean.getDestinationPort());
  entity.setComments(formBean.getComments());
  entity.setOrderStatus("String_Node_Str");
  entity.setRates(99.99);
  entity.setCreatedBy(commonUtils.getUserNameFromSession());
  entity.setAccountRep(commonUtils.getUserNameFromSession());
  entity.setModifiedBy(commonUtils.getUserNameFromSession());
  entity.setCreatedTimestamp(new Date());
  entity.setModifiedTimestamp(new Date());
  entity.setShipperAddressId(formBean.getShipperAddressId());
  entity.setShipperContactId(formBean.getShipperContactId());
  entity.setConsigneeAddressId(formBean.getConsigneeAddressId());
  entity.setConsigneeContactId(formBean.getConsigneeContactId());
  entity.setDeliveryDate(new Timestamp((formBean.getDeliveryDate()).getTime()));
  entity.setPickupDate(new Timestamp((formBean.getPickupDate()).getTime()));
  return entity;
}