ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Sort Order of DirectoryScanner Results (was Re: DirectoryScanner performance)
Date Fri, 19 Sep 2008 07:49:30 GMT
On Thu, 18 Sep 2008, Steve Loughran <> wrote:

> Kevin Jackson wrote:
> > That's a huge difference - what are we doing now in 1.7.1 that is
> > different from before?
> I think it tries to sort stuff less.
> This broke hadoop builds as their class structure was wrong

Once upon a time DirectoryScanner used to return files in a
predictable order - something like DFS where the files from
directories appear as directories are visited in DFS order.

The order of files coming from the same directory as well as
directories at the same height in the tree dependend on File.list and
likely was in lexicographic order.

This still is true if there is a basedir and DirectoryScanner decides
that it needs to scan the full tree, but starting with rev 274819
(i.e. <>,
which means Ant 1.6) this is not true if there are only include
patterns that don't start with wildcards.

In the later case only the directories that could be included will be
scanned and order of directories is undefined (they get added as keys
to a map and then scanned in iterator order of the map).

Given that this happened such a long time ago, we can savely assume
that in general order of files/directories returned by
DirectoryScanner is not defined.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message