ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kev Jackson <>
Subject Re: svn commit: r393996 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/
Date Fri, 14 Apr 2006 07:20:11 GMT
Martijn Kruithof wrote:

> Hi,
> I think the while construct is cleaner and more readable, and do not 
> see any real benefit of this code change.
> Especially against using the for loop is that when using the for loop 
> the step of the loop should take place in the third part of the for, 
> and not somewhere inside the for loop.
My reason for the change was that with the while construct, the scope of 
the tokenizer variable is larger than is necessary - ie it is only used 
within the loop, yet it is declared outside the loop.

The idiom I was using when making this change is similar to

for (Iterator i = list.iterator(); i.hasNext();) {
  Stuff s = (Stuff);

Which is fairly common usage - ignoring the last element of the for

> What's the position of other committers on this?
I'd be interested to hear other opinions too, after all I only changed 
the code as I (perhaps mistakenly) thought that having a larger than 
necessary scope is generally a bad thing

> Martijn

Thanks for the comments


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message