ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn Kruithof <...@apache.org>
Subject Re: svn commit: r393996 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
Date Fri, 14 Apr 2006 06:56:34 GMT
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.

What's the position of other committers on this?

Martijn


kevj@apache.org wrote:

>Author: kevj
>Date: Thu Apr 13 18:24:01 2006
>New Revision: 393996
>
>URL: http://svn.apache.org/viewcvs?rev=393996&view=rev
>Log:
>slight tweak while -> for (reduce scope of variable to just loop)
>
>Modified:
>    ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
>
>Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
>URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java?rev=393996&r1=393995&r2=393996&view=diff
>==============================================================================
>--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java (original)
>+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java Thu Apr 13 18:24:01
2006
>@@ -114,10 +114,9 @@
>      */
>     private void addPath(String path, boolean getJars, List libPathURLs)
>             throws MalformedURLException {
>-        StringTokenizer myTokenizer
>-            = new StringTokenizer(path, File.pathSeparator);
>-        while (myTokenizer.hasMoreElements()) {
>-            String elementName = myTokenizer.nextToken();
>+        for (StringTokenizer tzr = new StringTokenizer(path, File.pathSeparator); 
>+                tzr.hasMoreElements();) {
>+            String elementName = tzr.nextToken();
>             File element = new File(elementName);
>             if (elementName.indexOf("%") != -1 && !element.exists()) {
>                 continue;
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message