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
[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]