ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant DirectoryScanner.java
Date Wed, 02 Mar 2005 23:27:18 GMT
Hello Matt and others,

I had thought about this issue of optimizing pattern scanning.
DirectoryScanner used to be written so that if an exclude pattern looks like
foo/bar/** scanning stops in foo/bar.
Actually if an exclude pattern is like **/Test/**,
every time a directory Test is encountered it should not be scanned.
Not sure whether this change does exactly that.

I am not sure exactly what the semantics of isDeeper are ?

Cheers,

Antoine

mbenson@apache.org wrote:


>mbenson     2005/03/02 14:43:54
>
>  Modified:    src/main/org/apache/tools/ant DirectoryScanner.java
>  Log:
>  Stop scanning directories where we match the directory but know based
>  on the pattern that we will never match any of its contents.
>....   
>       /**
>  +     * Verify that a pattern specifies files deeper
>  +     * than the level of the specified file.
>  +     * @param pattern the pattern to check.
>  +     * @param name the name to check.
>  +     * @return whether the pattern is deeper than the name.
>  +     * @since Ant 1.6.3
>  +     */
>  +    private boolean isDeeper(String pattern, String name) {
>  +        Vector p = SelectorUtils.tokenizePath(pattern);
>  +        Vector n = SelectorUtils.tokenizePath(name);
>  +        return p.contains("**") || p.size() > n.size();
>  +    }
>  +
>  
>



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


Mime
View raw message