Well I don't know why is it suggested so as in the mail by Paul,
But as I already mentioned :
- Forwarded Message -
From: Prince Sewani
To: "dev@ofbiz.apache.org"
Sent: Tuesday, March 20, 2012 5:46 PM
Subject: Re: loop code simplification
Well If we're talking
ses != null && typePurposes.hasNext()) {
>>>> (ContactMechWorker.java line 606)
>>>>
>>>> Can it be simplified to for(GenericValue contactMechTypePurpose :
>>>> theList) ? Or should I keep it like it is ?
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Erwan de FERRIERES
>>>> www.nereide.biz
>>>>
>>>
>>> -
>>> --
>>> Coherent Software Australia Pty Ltd
>>> http://www.cohsoft.com.au/
>>>
>>> Bonsai ERP, the all-inclusive ERP system
>>> http://www.bonsaierp.com.au/
>>>
>>> --
>>> View this message in context:
>>> http://ofbiz.135035.n4.nabble.com/loop-code-simplification-tp4487741p4488324.html
>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>
>
>
> --
> Erwan de FERRIERES
simplified to for(GenericValue contactMechTypePurpose :
>>> theList) ? Or should I keep it like it is ?
>>>
>>> Regards,
>>>
>>> --
>>> Erwan de FERRIERES
>>> www.nereide.biz
>>>
>>
>> -
>> --
>> Coherent Software Australia Pty Ltd
>> http://www.cohsoft.com.au/
>>
>> Bonsai ERP, the all-inclusive ERP system
>> http://www.bonsaierp.com.au/
>>
>> --
>> View this message in context:
>> http://ofbiz.135035.n4.nabble.com/loop-code-simplification-tp4487741p4488324.html
>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
--
Erwan de FERRIERES
t like it is ?
Regards,
--
Erwan de FERRIERES
www.nereide.biz
-
--
Coherent Software Australia Pty Ltd
http://www.cohsoft.com.au/
Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/
--
View this message in context:
http://ofbiz.135035.n4.nabble.com/loop-code-simplification-tp44
(Test.java:11)
but if I replace the ArrayList declaration with :
static ArrayList t = new ArrayList();
then the output will beĀ :
before===
after===
Hope this helps.
Regards
Prince
From: Paul Foxworthy
To: dev@ofbiz.apache.org
Sent: Tuesday, M
, the all-inclusive ERP system
http://www.bonsaierp.com.au/
--
View this message in context:
http://ofbiz.135035.n4.nabble.com/loop-code-simplification-tp4487741p4488324.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.
Hi,
I'm trying to remove a lot of iterators, and use the for-each syntax,
which exists since java 1.5.
During my journey, I found a lot of double tests for a while like this one:
while (typePurposes != null && typePurposes.hasNext()) {
(ContactMechWorker.java line 606)
Can it be simplified to