You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Dimitri Unruh (JIRA)" <ji...@apache.org> on 2008/11/07 10:24:44 UTC

[jira] Commented: (OFBIZ-1953) Cleanup ship groups doesn't work

    [ https://issues.apache.org/jira/browse/OFBIZ-1953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645720#action_12645720 ] 

Dimitri Unruh commented on OFBIZ-1953:
--------------------------------------

Bilgin,

sorry for my late answer...

The problem is the for-loop in ShoppingCart.cleanUpShipGroups()


{code}
 for (int i = 0; i < this.shipInfo.size(); i++) {
    CartShipInfo csi = this.getShipInfo(i);
     ....      
     if (csi.shipItemInfo.size() == 0) {
         this.shipInfo.remove(csi);
      }
}
{code}

Example: If you have two shipGroups and the both are empty, the first one will be removed from the list. The second one id still in the list.
The loop-condition is wrong, so the second ahipGroup will not be removed from the list....

I hope you could follow me :)

Dimitri

> Cleanup ship groups doesn't work
> --------------------------------
>
>                 Key: OFBIZ-1953
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1953
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: SVN trunk
>            Reporter: Dimitri Unruh
>         Attachments: ShoppingCart.java.patch
>
>
> Hi everyone,
> I guess the method cleanUpShipGroups in the ShoppingCart.java is buggy.
> If you have many CartShipInfo objects in your cart and some of them are empty (shipItemInfo.size() == 0) the method don't remove all of them.
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.