You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by gl...@ca.ibm.com on 2000/07/05 14:52:27 UTC

Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant /taskdefs Copydir.java




I'm with Stefan on this one.  I'm not a big fan of "candy machine"
interfaces that depend on a flag to control behaviour.  The name copyFile
implies that its job is to copy a file, not to check if the new file
already exists and should only be overwritten if the original file is
newer.  If you want that behaviour, create a copyFileIfNewer method that
has the same signature, does the appropriate checking, then calls copyFile.
Its cleaner and keeps the intent of the method clear.

Glenn McAllister
TID - Software Developer - VisualAge for Java
IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey


Please respond to ant-dev@jakarta.apache.org

To:        ant-dev@jakarta.apache.org
cc:
Subject:        Re: cvs commit:
jakarta-ant/src/main/org/apache/tools/ant/taskdefs Copydir.java

>>>>> "DM" == David Maclean <da...@cm.co.za> writes:

 DM> Can it not be conditional depending on the parameter to copyFile
DM> (a boolean) so that tasks that want to make use of that feature
DM> may do so (e.g. Rmic) rather that duplicating the code in lots of
DM> tasks. The default is to ignore the check.

This is what I've done with my patch 8^), just with the check on by
default as this is the behavior we had before.

Stefan