You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2010/04/14 12:06:01 UTC

svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Author: jleroux
Date: Wed Apr 14 10:06:00 2010
New Revision: 933902

URL: http://svn.apache.org/viewvc?rev=933902&view=rev
Log:
Fix a bug reported by on user ML.
After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed but as they are the same I preferred to revert both

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010
@@ -269,7 +269,12 @@ public class CategoryWorker {
                 // if cur category is in crumb, remove everything after it and return
                 int cindex = trail.lastIndexOf(currentCategoryId);
 
-                trail = trail.subList(0, cindex);
+                if (cindex < (trail.size() - 1)) {
+                    for (int i = trail.size() - 1; i > cindex; i--) {
+                        String deadCat = trail.remove(i);
+                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i + " catname: " + deadCat, module);
+                    }
+                }
                 return trail;
             } else {
                 // current category is not in the list, and no previous category was specified, go back to the beginning
@@ -293,7 +298,12 @@ public class CategoryWorker {
         } else {
             // remove all categories after the previous category, preparing for adding the current category
             int index = trail.indexOf(previousCategoryId);
-            trail = trail.subList(0, index);
+            if (index < (trail.size() - 1)) {
+                for (int i = trail.size() - 1; i > index; i--) {
+                    String deadCat = trail.remove(i);
+                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i + " catname: " + deadCat, module);
+                }
+            }
         }
 
         // add the current category to the end of the list



Re: svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Ha ok, I see thanks (I did not search deeper, my bad. Actually I lazily followed a report on user ML)

Jacques

Scott Gray wrote:
> David was just updating the multi-tenant branch with changes from the trunk (such as my one below).  I just didn't want you
> pointing him out for something that I did.
>
> Regards
> Scott
>
> On 15/04/2010, at 7:04 AM, Jacques Le Roux wrote:
>
>> You bad guy ;o)
>>
>> David did the same, but now we know the real culprit :D
>>
>> Jacques
>>
>> From: "Scott Gray" <sc...@hotwaxmedia.com>
>> No it was me http://svn.apache.org/viewvc?view=revision&revision=926856
>>
>> On 14/04/2010, at 11:44 PM, Jacques Le Roux wrote:
>>
>>> Actually it was David's change at r926987[11/26] and it has been merged in trunk later (but I did not find an entry for the
>>> merge). Like I said I think the 1st change is not needed
>>>
>>> Thanks for your help
>>>
>>> Jacques
>>>
>>> Scott Gray wrote:
>>>> I think maybe you mean Scott's changes.  I'll take a look tomorrow.
>>>>
>>>> Regards
>>>> Scott
>>>>
>>>> On 14/04/2010, at 10:06 PM, jleroux@apache.org wrote:
>>>>
>>>>> Author: jleroux
>>>>> Date: Wed Apr 14 10:06:00 2010
>>>>> New Revision: 933902
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=933902&view=rev
>>>>> Log:
>>>>> Fix a bug reported by on user ML.
>>>>> After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed
>>>>> but as they are the same I preferred to revert both
>>>>>
>>>>> Modified:
>>>>>  ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>>>>
>>>>> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>>>> URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
>>>>> ============================================================================== ---
>>>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) +++
>>>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010 @@ -269,7 +269,12
>>>>>               @@ public class CategoryWorker { // if cur category is in crumb, remove everything after it and return
>>>>>               int cindex = trail.lastIndexOf(currentCategoryId);
>>>>>
>>>>> -                trail = trail.subList(0, cindex);
>>>>> +                if (cindex < (trail.size() - 1)) {
>>>>> +                    for (int i = trail.size() - 1; i > cindex; i--) {
>>>>> +                        String deadCat = trail.remove(i);
>>>>> +                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index:
>>>>> " + i + " catname: " + deadCat, module); +                    }
>>>>> +                }
>>>>>               return trail;
>>>>>           } else {
>>>>>               // current category is not in the list, and no previous category was specified, go back to the beginning
>>>>> @@ -293,7 +298,12 @@ public class CategoryWorker {
>>>>>       } else {
>>>>>           // remove all categories after the previous category, preparing for adding the current category
>>>>>           int index = trail.indexOf(previousCategoryId);
>>>>> -            trail = trail.subList(0, index);
>>>>> +            if (index < (trail.size() - 1)) {
>>>>> +                for (int i = trail.size() - 1; i > index; i--) {
>>>>> +                    String deadCat = trail.remove(i);
>>>>> +                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " +
>>>>> i + " catname: " + deadCat, module); +                }
>>>>> +            }
>>>>>       }
>>>>>
>>>>>       // add the current category to the end of the list 



Re: svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Posted by Scott Gray <sc...@hotwaxmedia.com>.
David was just updating the multi-tenant branch with changes from the trunk (such as my one below).  I just didn't want you pointing him out for something that I did.

Regards
Scott

On 15/04/2010, at 7:04 AM, Jacques Le Roux wrote:

> You bad guy ;o)
> 
> David did the same, but now we know the real culprit :D
> 
> Jacques
> 
> From: "Scott Gray" <sc...@hotwaxmedia.com>
> No it was me http://svn.apache.org/viewvc?view=revision&revision=926856
> 
> On 14/04/2010, at 11:44 PM, Jacques Le Roux wrote:
> 
>> Actually it was David's change at r926987[11/26] and it has been merged in trunk later (but I did not find an entry for the merge).
>> Like I said I think the 1st change is not needed
>> 
>> Thanks for your help
>> 
>> Jacques
>> 
>> Scott Gray wrote:
>>> I think maybe you mean Scott's changes.  I'll take a look tomorrow.
>>> 
>>> Regards
>>> Scott
>>> 
>>> On 14/04/2010, at 10:06 PM, jleroux@apache.org wrote:
>>> 
>>>> Author: jleroux
>>>> Date: Wed Apr 14 10:06:00 2010
>>>> New Revision: 933902
>>>> 
>>>> URL: http://svn.apache.org/viewvc?rev=933902&view=rev
>>>> Log:
>>>> Fix a bug reported by on user ML.
>>>> After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed
>>>> but as they are the same I preferred to revert both
>>>> 
>>>> Modified:
>>>>  ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>>> 
>>>> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
>>>> ============================================================================== ---
>>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) +++
>>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010 @@ -269,7 +269,12
>>>>               @@ public class CategoryWorker { // if cur category is in crumb, remove everything after it and return
>>>>               int cindex = trail.lastIndexOf(currentCategoryId);
>>>> 
>>>> -                trail = trail.subList(0, cindex);
>>>> +                if (cindex < (trail.size() - 1)) {
>>>> +                    for (int i = trail.size() - 1; i > cindex; i--) {
>>>> +                        String deadCat = trail.remove(i);
>>>> +                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: "
>>>> + i + " catname: " + deadCat, module); +                    }
>>>> +                }
>>>>               return trail;
>>>>           } else {
>>>>               // current category is not in the list, and no previous category was specified, go back to the beginning
>>>> @@ -293,7 +298,12 @@ public class CategoryWorker {
>>>>       } else {
>>>>           // remove all categories after the previous category, preparing for adding the current category
>>>>           int index = trail.indexOf(previousCategoryId);
>>>> -            trail = trail.subList(0, index);
>>>> +            if (index < (trail.size() - 1)) {
>>>> +                for (int i = trail.size() - 1; i > index; i--) {
>>>> +                    String deadCat = trail.remove(i);
>>>> +                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i
>>>> + " catname: " + deadCat, module); +                }
>>>> +            }
>>>>       }
>>>> 
>>>>       // add the current category to the end of the list
>> 
>> 
> 
> 
> 


Re: svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
You bad guy ;o)

David did the same, but now we know the real culprit :D

Jacques

From: "Scott Gray" <sc...@hotwaxmedia.com>
No it was me http://svn.apache.org/viewvc?view=revision&revision=926856

On 14/04/2010, at 11:44 PM, Jacques Le Roux wrote:

> Actually it was David's change at r926987[11/26] and it has been merged in trunk later (but I did not find an entry for the 
> merge).
> Like I said I think the 1st change is not needed
>
> Thanks for your help
>
> Jacques
>
> Scott Gray wrote:
>> I think maybe you mean Scott's changes.  I'll take a look tomorrow.
>>
>> Regards
>> Scott
>>
>> On 14/04/2010, at 10:06 PM, jleroux@apache.org wrote:
>>
>>> Author: jleroux
>>> Date: Wed Apr 14 10:06:00 2010
>>> New Revision: 933902
>>>
>>> URL: http://svn.apache.org/viewvc?rev=933902&view=rev
>>> Log:
>>> Fix a bug reported by on user ML.
>>> After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed
>>> but as they are the same I preferred to revert both
>>>
>>> Modified:
>>>   ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>>
>>> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
>>> ============================================================================== ---
>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) +++
>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010 @@ -269,7 +269,12
>>>                @@ public class CategoryWorker { // if cur category is in crumb, remove everything after it and return
>>>                int cindex = trail.lastIndexOf(currentCategoryId);
>>>
>>> -                trail = trail.subList(0, cindex);
>>> +                if (cindex < (trail.size() - 1)) {
>>> +                    for (int i = trail.size() - 1; i > cindex; i--) {
>>> +                        String deadCat = trail.remove(i);
>>> +                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: "
>>> + i + " catname: " + deadCat, module); +                    }
>>> +                }
>>>                return trail;
>>>            } else {
>>>                // current category is not in the list, and no previous category was specified, go back to the beginning
>>> @@ -293,7 +298,12 @@ public class CategoryWorker {
>>>        } else {
>>>            // remove all categories after the previous category, preparing for adding the current category
>>>            int index = trail.indexOf(previousCategoryId);
>>> -            trail = trail.subList(0, index);
>>> +            if (index < (trail.size() - 1)) {
>>> +                for (int i = trail.size() - 1; i > index; i--) {
>>> +                    String deadCat = trail.remove(i);
>>> +                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i
>>> + " catname: " + deadCat, module); +                }
>>> +            }
>>>        }
>>>
>>>        // add the current category to the end of the list
>
>




Re: svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Posted by Scott Gray <sc...@hotwaxmedia.com>.
No it was me http://svn.apache.org/viewvc?view=revision&revision=926856

On 14/04/2010, at 11:44 PM, Jacques Le Roux wrote:

> Actually it was David's change at r926987[11/26] and it has been merged in trunk later (but I did not find an entry for the merge).
> Like I said I think the 1st change is not needed
> 
> Thanks for your help
> 
> Jacques
> 
> Scott Gray wrote:
>> I think maybe you mean Scott's changes.  I'll take a look tomorrow.
>> 
>> Regards
>> Scott
>> 
>> On 14/04/2010, at 10:06 PM, jleroux@apache.org wrote:
>> 
>>> Author: jleroux
>>> Date: Wed Apr 14 10:06:00 2010
>>> New Revision: 933902
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=933902&view=rev
>>> Log:
>>> Fix a bug reported by on user ML.
>>> After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed
>>> but as they are the same I preferred to revert both
>>> 
>>> Modified:
>>>   ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>> 
>>> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
>>> ============================================================================== ---
>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) +++
>>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010 @@ -269,7 +269,12
>>>                @@ public class CategoryWorker { // if cur category is in crumb, remove everything after it and return
>>>                int cindex = trail.lastIndexOf(currentCategoryId);
>>> 
>>> -                trail = trail.subList(0, cindex);
>>> +                if (cindex < (trail.size() - 1)) {
>>> +                    for (int i = trail.size() - 1; i > cindex; i--) {
>>> +                        String deadCat = trail.remove(i);
>>> +                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: "
>>> + i + " catname: " + deadCat, module); +                    }
>>> +                }
>>>                return trail;
>>>            } else {
>>>                // current category is not in the list, and no previous category was specified, go back to the beginning
>>> @@ -293,7 +298,12 @@ public class CategoryWorker {
>>>        } else {
>>>            // remove all categories after the previous category, preparing for adding the current category
>>>            int index = trail.indexOf(previousCategoryId);
>>> -            trail = trail.subList(0, index);
>>> +            if (index < (trail.size() - 1)) {
>>> +                for (int i = trail.size() - 1; i > index; i--) {
>>> +                    String deadCat = trail.remove(i);
>>> +                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i
>>> + " catname: " + deadCat, module); +                }
>>> +            }
>>>        }
>>> 
>>>        // add the current category to the end of the list 
> 
> 


Re: svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Actually it was David's change at r926987[11/26] and it has been merged in trunk later (but I did not find an entry for the merge).
Like I said I think the 1st change is not needed

Thanks for your help

Jacques

Scott Gray wrote:
> I think maybe you mean Scott's changes.  I'll take a look tomorrow.
>
> Regards
> Scott
>
> On 14/04/2010, at 10:06 PM, jleroux@apache.org wrote:
>
>> Author: jleroux
>> Date: Wed Apr 14 10:06:00 2010
>> New Revision: 933902
>>
>> URL: http://svn.apache.org/viewvc?rev=933902&view=rev
>> Log:
>> Fix a bug reported by on user ML.
>> After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed
>> but as they are the same I preferred to revert both
>>
>> Modified:
>>    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>>
>> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
>> ============================================================================== ---
>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) +++
>> ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010 @@ -269,7 +269,12
>>                 @@ public class CategoryWorker { // if cur category is in crumb, remove everything after it and return
>>                 int cindex = trail.lastIndexOf(currentCategoryId);
>>
>> -                trail = trail.subList(0, cindex);
>> +                if (cindex < (trail.size() - 1)) {
>> +                    for (int i = trail.size() - 1; i > cindex; i--) {
>> +                        String deadCat = trail.remove(i);
>> +                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: "
>> + i + " catname: " + deadCat, module); +                    }
>> +                }
>>                 return trail;
>>             } else {
>>                 // current category is not in the list, and no previous category was specified, go back to the beginning
>> @@ -293,7 +298,12 @@ public class CategoryWorker {
>>         } else {
>>             // remove all categories after the previous category, preparing for adding the current category
>>             int index = trail.indexOf(previousCategoryId);
>> -            trail = trail.subList(0, index);
>> +            if (index < (trail.size() - 1)) {
>> +                for (int i = trail.size() - 1; i > index; i--) {
>> +                    String deadCat = trail.remove(i);
>> +                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i
>> + " catname: " + deadCat, module); +                }
>> +            }
>>         }
>>
>>         // add the current category to the end of the list 



Re: svn commit: r933902 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java

Posted by Scott Gray <sc...@hotwaxmedia.com>.
I think maybe you mean Scott's changes.  I'll take a look tomorrow.

Regards
Scott

On 14/04/2010, at 10:06 PM, jleroux@apache.org wrote:

> Author: jleroux
> Date: Wed Apr 14 10:06:00 2010
> New Revision: 933902
> 
> URL: http://svn.apache.org/viewvc?rev=933902&view=rev
> Log:
> Fix a bug reported by on user ML.
> After some time spent on this I don't clearly see why David's changes are not working. I guess only the second would be needed but as they are the same I preferred to revert both
> 
> Modified:
>    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
> 
> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=933902&r1=933901&r2=933902&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original)
> +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Apr 14 10:06:00 2010
> @@ -269,7 +269,12 @@ public class CategoryWorker {
>                 // if cur category is in crumb, remove everything after it and return
>                 int cindex = trail.lastIndexOf(currentCategoryId);
> 
> -                trail = trail.subList(0, cindex);
> +                if (cindex < (trail.size() - 1)) {
> +                    for (int i = trail.size() - 1; i > cindex; i--) {
> +                        String deadCat = trail.remove(i);
> +                        //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i + " catname: " + deadCat, module);
> +                    }
> +                }
>                 return trail;
>             } else {
>                 // current category is not in the list, and no previous category was specified, go back to the beginning
> @@ -293,7 +298,12 @@ public class CategoryWorker {
>         } else {
>             // remove all categories after the previous category, preparing for adding the current category
>             int index = trail.indexOf(previousCategoryId);
> -            trail = trail.subList(0, index);
> +            if (index < (trail.size() - 1)) {
> +                for (int i = trail.size() - 1; i > index; i--) {
> +                    String deadCat = trail.remove(i);
> +                    //if (Debug.infoOn()) Debug.logInfo("[CategoryWorker.setTrail] Removed after current category index: " + i + " catname: " + deadCat, module);
> +                }
> +            }
>         }
> 
>         // add the current category to the end of the list
> 
>