Program: 144322
Project: 144322
Buggy source:
public String editOrderItemsSea(){
  Map sessionAttributes=ActionContext.getContext().getSession();
  if (orderItemIdParam != null) {
    OrderItems entity=transformOrderItemToEntityBeanSea(operationsBean);
    entity.setVendorSea(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVendorCode());
    entity.setVesselScheduleId(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVoyageNumber());
    operationsService.updateOrderItem(entity);
    List<OrderItems> OrderItemsPlanning=operationsService.findAllOrderItemsByOrderId(entity.getOrderId());
    for (    OrderItems orderItemElem : OrderItemsPlanning) {
      OrderItems orderItemEntity=operationsService.findOrderItemById(orderItemElem.getOrderItemId());
      OrderItems newEntity=new OrderItems();
      Client client=clientService.findClientById(getClientId().toString());
      newEntity.setOrderItemId(orderItemEntity.getOrderItemId());
      newEntity.setClientId(client.getClientId());
      newEntity.setNameSize(orderItemEntity.getNameSize());
      newEntity.setOrderId(orderItemEntity.getOrderId());
      newEntity.setQuantity(orderItemEntity.getQuantity());
      newEntity.setClassification(orderItemEntity.getClassification());
      newEntity.setDeclaredValue(orderItemEntity.getDeclaredValue());
      newEntity.setRate(orderItemEntity.getRate());
      newEntity.setCreatedBy(orderItemEntity.getCreatedBy());
      newEntity.setModifiedBy(orderItemEntity.getModifiedBy());
      newEntity.setComments(orderItemEntity.getComments());
      newEntity.setCommodity(orderItemEntity.getCommodity());
      newEntity.setCreatedTimestamp(orderItemEntity.getCreatedTimestamp());
      newEntity.setModifiedTimestamp(orderItemEntity.getModifiedTimestamp());
      newEntity.setWeight(orderItemEntity.getWeight());
      newEntity.setVolume(orderItemEntity.getVolume());
      newEntity.setServiceRequirement(orderItemEntity.getServiceRequirement());
      newEntity.setVendorSea(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVendorCode());
      newEntity.setVesselScheduleId(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVoyageNumber());
      if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceType())) {
        if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else         if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else {
          newEntity.setStatus("String_Node_Str");
        }
      }
 else {
        newEntity.setStatus("String_Node_Str");
      }
      operationsService.updateOrderItem(newEntity);
    }
  }
 else {
    check=(String[])sessionAttributes.get("String_Node_Str");
    for (int i=0; i < check.length; i++) {
      Integer orderItemId=Integer.parseInt(check[i]);
      OrderItems orderItemEntity=operationsService.findOrderItemById(orderItemId);
      OrderItems newEntity=new OrderItems();
      Client client=clientService.findClientById(getClientId().toString());
      newEntity.setOrderItemId(orderItemEntity.getOrderItemId());
      newEntity.setClientId(client.getClientId());
      newEntity.setNameSize(orderItemEntity.getNameSize());
      newEntity.setOrderId(orderItemEntity.getOrderId());
      newEntity.setQuantity(orderItemEntity.getQuantity());
      newEntity.setClassification(orderItemEntity.getClassification());
      newEntity.setDeclaredValue(orderItemEntity.getDeclaredValue());
      newEntity.setRate(orderItemEntity.getRate());
      newEntity.setCreatedBy(orderItemEntity.getCreatedBy());
      newEntity.setModifiedBy(orderItemEntity.getModifiedBy());
      newEntity.setComments(orderItemEntity.getComments());
      newEntity.setCommodity(orderItemEntity.getCommodity());
      newEntity.setCreatedTimestamp(orderItemEntity.getCreatedTimestamp());
      newEntity.setModifiedTimestamp(orderItemEntity.getModifiedTimestamp());
      newEntity.setWeight(orderItemEntity.getWeight());
      newEntity.setVolume(orderItemEntity.getVolume());
      newEntity.setServiceRequirement(orderItemEntity.getServiceRequirement());
      newEntity.setVendorSea(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVendorCode());
      newEntity.setVesselScheduleId(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVoyageNumber());
      if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceType())) {
        if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else         if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else {
          newEntity.setStatus("String_Node_Str");
        }
      }
 else {
        newEntity.setStatus("String_Node_Str");
      }
      operationsService.updateOrderItem(newEntity);
    }
  }
  sessionAttributes.put("String_Node_Str",vendorIdParam);
  return SUCCESS;
}

Fixed version (ground truth):
public String editOrderItemsSea(){
  Map sessionAttributes=ActionContext.getContext().getSession();
  List<OrderItems> orderItemsList=new ArrayList<OrderItems>();
  if (orderItemIdParam != null) {
    OrderItems entity=transformOrderItemToEntityBeanSea(operationsBean);
    Orders orderEntity=orderService.findOrdersById(entity.getOrderId());
    if (orderEntity.getOrderStatus().equals("String_Node_Str")) {
      clearErrorsAndMessages();
      addActionError("String_Node_Str");
      order=transformToOrderFormBean(orderEntity);
      for (      OrderItems orderItemsElem : orderItemsList) {
        orderItems.add(transformToOrderItemFormBean(orderItemsElem));
        return "String_Node_Str";
      }
    }
    entity.setVendorSea(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVendorCode());
    entity.setVesselScheduleId(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVoyageNumber());
    operationsService.updateOrderItem(entity);
    List<OrderItems> OrderItemsPlanning=operationsService.findAllOrderItemsByOrderId(entity.getOrderId());
    for (    OrderItems orderItemElem : OrderItemsPlanning) {
      OrderItems orderItemEntity=operationsService.findOrderItemById(orderItemElem.getOrderItemId());
      OrderItems newEntity=new OrderItems();
      Client client=clientService.findClientById(getClientId().toString());
      newEntity.setOrderItemId(orderItemEntity.getOrderItemId());
      newEntity.setClientId(client.getClientId());
      newEntity.setNameSize(orderItemEntity.getNameSize());
      newEntity.setOrderId(orderItemEntity.getOrderId());
      newEntity.setQuantity(orderItemEntity.getQuantity());
      newEntity.setClassification(orderItemEntity.getClassification());
      newEntity.setDeclaredValue(orderItemEntity.getDeclaredValue());
      newEntity.setRate(orderItemEntity.getRate());
      newEntity.setCreatedBy(orderItemEntity.getCreatedBy());
      newEntity.setModifiedBy(orderItemEntity.getModifiedBy());
      newEntity.setComments(orderItemEntity.getComments());
      newEntity.setCommodity(orderItemEntity.getCommodity());
      newEntity.setCreatedTimestamp(orderItemEntity.getCreatedTimestamp());
      newEntity.setModifiedTimestamp(orderItemEntity.getModifiedTimestamp());
      newEntity.setWeight(orderItemEntity.getWeight());
      newEntity.setVolume(orderItemEntity.getVolume());
      newEntity.setServiceRequirement(orderItemEntity.getServiceRequirement());
      newEntity.setVendorSea(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVendorCode());
      newEntity.setVesselScheduleId(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVoyageNumber());
      if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceType())) {
        if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else         if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else {
          newEntity.setStatus("String_Node_Str");
        }
      }
 else {
        newEntity.setStatus("String_Node_Str");
      }
      operationsService.updateOrderItem(newEntity);
    }
  }
 else {
    check=(String[])sessionAttributes.get("String_Node_Str");
    for (int i=0; i < check.length; i++) {
      Integer orderItemId=Integer.parseInt(check[i]);
      OrderItems orderItemEntity=operationsService.findOrderItemById(orderItemId);
      Orders orderEntity=orderService.findOrdersById(orderItemEntity.getOrderId());
      if (orderEntity.getOrderStatus().equals("String_Node_Str")) {
        order=transformToOrderFormBean(orderEntity);
        for (        OrderItems orderItemsElem : orderItemsList) {
          orderItems.add(transformToOrderItemFormBean(orderItemsElem));
        }
        clearErrorsAndMessages();
        addActionError("String_Node_Str");
        return "String_Node_Str";
      }
      OrderItems newEntity=new OrderItems();
      Client client=clientService.findClientById(getClientId().toString());
      newEntity.setOrderItemId(orderItemEntity.getOrderItemId());
      newEntity.setClientId(client.getClientId());
      newEntity.setNameSize(orderItemEntity.getNameSize());
      newEntity.setOrderId(orderItemEntity.getOrderId());
      newEntity.setQuantity(orderItemEntity.getQuantity());
      newEntity.setClassification(orderItemEntity.getClassification());
      newEntity.setDeclaredValue(orderItemEntity.getDeclaredValue());
      newEntity.setRate(orderItemEntity.getRate());
      newEntity.setCreatedBy(orderItemEntity.getCreatedBy());
      newEntity.setModifiedBy(orderItemEntity.getModifiedBy());
      newEntity.setComments(orderItemEntity.getComments());
      newEntity.setCommodity(orderItemEntity.getCommodity());
      newEntity.setCreatedTimestamp(orderItemEntity.getCreatedTimestamp());
      newEntity.setModifiedTimestamp(orderItemEntity.getModifiedTimestamp());
      newEntity.setWeight(orderItemEntity.getWeight());
      newEntity.setVolume(orderItemEntity.getVolume());
      newEntity.setServiceRequirement(orderItemEntity.getServiceRequirement());
      newEntity.setVendorSea(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVendorCode());
      newEntity.setVesselScheduleId(vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam).getVoyageNumber());
      if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceType())) {
        if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else         if ("String_Node_Str".equals(orderService.findOrdersById(operationsService.findOrderItemById(orderItemEntity.getOrderItemId()).getOrderId()).getServiceMode())) {
          newEntity.setStatus("String_Node_Str");
        }
 else {
          newEntity.setStatus("String_Node_Str");
        }
      }
 else {
        newEntity.setStatus("String_Node_Str");
      }
      operationsService.updateOrderItem(newEntity);
    }
  }
  sessionAttributes.put("String_Node_Str",vendorIdParam);
  return SUCCESS;
}