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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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


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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)

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

Dimitri Unruh updated OFBIZ-1953:
---------------------------------

    Attachment: ShoppingCart.java.patch

This patch resolves the problem

> 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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Bilgin Ibryam commented on OFBIZ-1953:
--------------------------------------

Dimitri,

can you explain, how your patch is going to fix the bug?
W/o any tests, it seems to me that the result will be the same.

Bilgin

> 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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ 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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Dimitri Unruh updated OFBIZ-1953:
---------------------------------

    Attachment: ShoppingCart.patch

My first patch was not from OFBIZ_HOME, so I did a new one

> 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, ShoppingCart.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Dimitri Unruh updated OFBIZ-1953:
---------------------------------

    Attachment:     (was: ShoppingCart.java.patch)

> 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.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Bilgin Ibryam reassigned OFBIZ-1953:
------------------------------------

    Assignee: Bilgin Ibryam

> 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
>            Assignee: Bilgin Ibryam
>         Attachments: ShoppingCart.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux closed OFBIZ-1953.
----------------------------------

       Resolution: Fixed
    Fix Version/s: Release Branch 4.0
                   SVN trunk
         Assignee: Jacques Le Roux  (was: Bilgin Ibryam)

Thanks Dimitri,

I agree with you, this fix the bug. The enhanced for loop avoid the issue coming from getShipInfo when shipInfo is actualised (one csi removed) in the loop like in your example. THis is possible because, with the enhanced for loop, we are sure to always access to the right csi.

Your patch is in trunk revision: 737443 , and R4 r737444


> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk, Release Branch 4.0
>
>         Attachments: ShoppingCart.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Bilgin Ibryam commented on OFBIZ-1953:
--------------------------------------

Jacques,
thanks for taking care of the issue.
Just a note: I think R4 was meant for running with java 1.4 and generics may broke it.

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk, Release Branch 4.0
>
>         Attachments: ShoppingCart.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux commented on OFBIZ-1953:
----------------------------------------

Hi Bilgin,

Yes good catch, you beat me, it was the 1st thing I thought when I got up this morning :) I will use an iterator instead

> 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
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk, Release Branch 4.0
>
>         Attachments: ShoppingCart.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.