ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn Kruithof ...@kruithof.xs4all.nl>
Subject Re: [patch] NioFileUtils, Java6FileUtils, FileUtilsAdapter + factory, build.xml (was Re: AW: Adding a methof to StringUtils)
Date Fri, 21 Apr 2006 06:45:23 GMT
Hi,

Adding setting the property using -D to ANT_OPTS should do.

5 things:

1) I saw you removed public members (constants) from FileUtils (Non 
backward compatible change, keeping everything BC also frustrates me 
sometimes, but still I think it is best not to break parts we do not 
know of.)

2) If the FileUtilsFactory is called from or implemented in 
FileUtils.getFileUtils() / FileUtils.newFileUtils(), every task is going 
to benefit.

3) Again / Still the actual copying has been moved to the ResourceUtils, 
how do we make sure that files addressed as resources also benefit from 
this change.

Regarding the changes in the Copy task:

4) Stringbuffer is not more efficient than concatenation using + in a 
single statement.

-            log("Copying " + fileCopyMap.size()
-                + " file" + (fileCopyMap.size() == 1 ? "" : "s")
-                + " to " + destDir.getAbsolutePath());
+            StringBuffer sb = new StringBuffer("Copying ")
+                .append(fileCopyMap.size())
+                .append(" file")
+                .append((fileCopyMap.size() == 1 ? "" : "s"))
+                .append(" to ")
+                .append(destDir.getAbsolutePath());

Why are you replacing the log statmenent with the StringBuffer.

It is less readable, and equivalent.

5) StringBuffer handling is incorrect for the second part, (you will 
concatenate all to filenames.)

Martijn



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


Mime
View raw message