You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Shi Jinghai (Updated) (JIRA)" <ji...@apache.org> on 2012/02/27 14:15:48 UTC

[jira] [Updated] (OFBIZ-4720) getAdjustmentPromoIndex(String productPromoId) in ShoppingCart.java

     [ https://issues.apache.org/jira/browse/OFBIZ-4720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shi Jinghai updated OFBIZ-4720:
-------------------------------

    Attachment: adjustmentPromoIndex.patch
    
> getAdjustmentPromoIndex(String productPromoId) in ShoppingCart.java
> -------------------------------------------------------------------
>
>                 Key: OFBIZ-4720
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4720
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Shi Jinghai
>            Priority: Minor
>         Attachments: adjustmentPromoIndex.patch
>
>
> 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;
>     }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira