Program: 59126
Project: 59126
Buggy source:
public void getProductInformation(ActionRequest request,ActionResponse response){
  SalesOrderSubLine salesOrderSubLine=request.getContext().asType(SalesOrderSubLine.class);
  SalesOrder salesOrder=null;
  if (salesOrderSubLine.getSalesOrderLine() != null && salesOrderSubLine.getSalesOrderLine().getSalesOrder() != null) {
    salesOrder=salesOrderSubLine.getSalesOrderLine().getSalesOrder();
  }
  if (salesOrder == null) {
    salesOrder=request.getContext().getParentContext().getParentContext().asType(SalesOrder.class);
  }
  if (salesOrder != null && salesOrderSubLine.getProduct() != null) {
    try {
      BigDecimal price=salesOrderSubLineService.getUnitPrice(salesOrder,salesOrderSubLine);
      response.setValue("String_Node_Str",salesOrderSubLineService.getTaxLine(salesOrder,salesOrderSubLine));
      response.setValue("String_Node_Str",salesOrderSubLineService.getUnitPrice(salesOrder,salesOrderSubLine));
      response.setValue("String_Node_Str",salesOrderSubLine.getProduct().getName());
      response.setValue("String_Node_Str",salesOrderSubLine.getProduct().getUnit());
      response.setValue("String_Node_Str",salesOrderSubLineService.getCompanyCostPrice(salesOrder,salesOrderSubLine));
      PriceList priceList=salesOrder.getPriceList();
      if (priceList != null) {
        PriceListLine priceListLine=salesOrderSubLineService.getPriceListLine(salesOrderSubLine,priceList);
        Map<String,Object> discounts=priceListService.getDiscounts(priceList,priceListLine,price);
        response.setValue("String_Node_Str",discounts.get("String_Node_Str"));
        response.setValue("String_Node_Str",discounts.get("String_Node_Str"));
        if (discounts.get("String_Node_Str") != null) {
          price=(BigDecimal)discounts.get("String_Node_Str");
        }
      }
      response.setValue("String_Node_Str",price);
    }
 catch (    Exception e) {
      response.setFlash(e.getMessage());
      this.resetProductInformation(response);
    }
  }
 else {
    this.resetProductInformation(response);
  }
}

Fixed version (ground truth):
public void getProductInformation(ActionRequest request,ActionResponse response){
  SalesOrderSubLine salesOrderSubLine=request.getContext().asType(SalesOrderSubLine.class);
  SalesOrder salesOrder=null;
  if (salesOrderSubLine.getSalesOrderLine() != null && salesOrderSubLine.getSalesOrderLine().getSalesOrder() != null) {
    salesOrder=salesOrderSubLine.getSalesOrderLine().getSalesOrder();
  }
  if (salesOrder == null) {
    salesOrder=request.getContext().getParentContext().getParentContext().asType(SalesOrder.class);
  }
  if (salesOrder != null && salesOrderSubLine.getProduct() != null) {
    try {
      BigDecimal price=salesOrderSubLineService.getUnitPrice(salesOrder,salesOrderSubLine);
      response.setValue("String_Node_Str",salesOrderSubLineService.getTaxLine(salesOrder,salesOrderSubLine));
      response.setValue("String_Node_Str",salesOrderSubLineService.getUnitPrice(salesOrder,salesOrderSubLine));
      response.setValue("String_Node_Str",salesOrderSubLine.getProduct().getName());
      response.setValue("String_Node_Str",salesOrderSubLine.getProduct().getDefaultSupplierPartner());
      response.setValue("String_Node_Str",salesOrderSubLine.getProduct().getUnit());
      response.setValue("String_Node_Str",salesOrderSubLineService.getCompanyCostPrice(salesOrder,salesOrderSubLine));
      PriceList priceList=salesOrder.getPriceList();
      if (priceList != null) {
        PriceListLine priceListLine=salesOrderSubLineService.getPriceListLine(salesOrderSubLine,priceList);
        Map<String,Object> discounts=priceListService.getDiscounts(priceList,priceListLine,price);
        response.setValue("String_Node_Str",discounts.get("String_Node_Str"));
        response.setValue("String_Node_Str",discounts.get("String_Node_Str"));
        if (discounts.get("String_Node_Str") != null) {
          price=(BigDecimal)discounts.get("String_Node_Str");
        }
      }
      response.setValue("String_Node_Str",price);
    }
 catch (    Exception e) {
      response.setFlash(e.getMessage());
      this.resetProductInformation(response);
    }
  }
 else {
    this.resetProductInformation(response);
  }
}