OFBiz
  1. OFBiz
  2. OFBIZ-4720

getAdjustmentPromoIndex(String productPromoId) in ShoppingCart.java

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release Branch 11.04, Trunk
    • Component/s: None
    • Labels:
      None

      Description

      Currently this method throws an out of range index exception.

      Original:
      public int getAdjustmentPromoIndex(String productPromoId) {
      int index = adjustments.size();
      while (index > 0) {
      if (adjustments.get(index).getString("productPromoId").equals(productPromoId))

      { return(index); }
      index++;
      }
      return -1;
      }

      Change to:
      public int getAdjustmentPromoIndex(String productPromoId) {
      int index = adjustments.size();
      while (index > 0) {
      index--;
      if (adjustments.get(index).getString("productPromoId").equals(productPromoId)) { return(index); }

      }
      return -1;
      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Shi Jinghai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development