You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Alex Rosen <ar...@novell.com> on 2003/08/06 20:49:36 UTC

getExcludedFiles() and slowScan()

getExcludedFiles() performs a slowScan(), but looking at the JavaDoc, it
seems like it doesn't need to. That makes me wonder if it's the code
that's wrong or just the JavaDoc. (Or just my interpretation of the
JavaDoc.)

getExcludedFiles() says:

     * Returns the names of the files which matched at least one of
the
     * include patterns and at least one of the exclude patterns.
     * The names are relative to the base directory. This involves
     * performing a slow scan if one has not already been completed.

But slowScan() says:

     * Top level invocation for a slow scan. A slow scan builds up a
full
     * list of excluded/included files/directories, whereas a fast
scan
     * will only have full results for included files, as it ignores
     * directories which can't possibly hold any included
files/directories.

Doesn't this say exactly that getExcludedFiles() *doesn't* need to do a
slowScan()? A fast scan ignores directories which can't possibly hold
any included files/directories, but getExcludedFiles() says it doesn't
care about these because it will never return them.

Alex Rosen



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


Re: getExcludedFiles() and slowScan()

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 06 Aug 2003, Alex Rosen <ar...@novell.com> wrote:

> A fast scan ignores directories which can't possibly hold any
> included files/directories, but getExcludedFiles() says it doesn't
> care about these because it will never return them.

The fast scan will also exclude directories that are excluded.  It is
very well possible that these directories contain files that match an
include pattern as well (but the fast scan ignored them).

>>                                           whereas a fast scan
>>     * will only have full results for included files, as it ignores
>>     * directories which can't possibly hold any included files/directories.

leaves two options for directories that are ommitted by a fast scan:

(a) it is clear that the directory cannot hold any files matching an
include pattern - in this case you'd be correct as these files are not
part of the getExcludedFiles result either (but of
getNotIncludedFiles).

(b) it is clear that the directory will only hold files matching an
exclude pattern - this is why slowScan is necessary.

BTW, for Ant 1.5.x you'd be correct but the code in CVS HEAD has been
improved to add (b).

Stefan

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