Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-4720

getAdjustmentPromoIndex(String productPromoId) in ShoppingCart.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • Release Branch 11.04, Trunk
    • None
    • 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;
      }

      Attachments

        1. adjustmentPromoIndex.patch
          0.7 kB
          Shi Jinghai

        Activity

          People

            jleroux Jacques Le Roux
            shi.jinghai Shi Jinghai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: