ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Glanville" <dic...@nortelnetworks.com>
Subject Bug in DirectoryScanner.scandir?
Date Wed, 09 Aug 2000 16:38:47 GMT
I've just recently started testing the Ant make tool that is part of the
Jakarta project.  It looks very promising.  However, I think I've come
across a little bug.

The file in question is org.apache.tools.ant.DirectoryScanner and the method
is scandir.  The first two lines go something like this:
        String[] newfiles = dir.list();
        for (int i = 0; i < newfiles.length; i++) {
I've been getting a null pointer exception in this method.  I believe that
dir.list() can actually return a null if the directory to be listed is
empty?  This is the case in my department's development tree (designers have
created the directories, but haven't actually submitted the code for it
yet).

A possible solution would be to place the following line:
	if ( newfiles == null ) return;
in between the two above lines.  Does this solve the situation?  It seems to
have solved mine.

If this question has asked already, apologies, but I've just joined this
group.

----------------------------------------------------------------------------
-----
Jay Dickon Glanville
P066 - SiteManager Development
613-765-1144 (ESN 395-1144)
MS: 045/55/A05
E-Mail: dickon@nortelnetworks.com


Mime
View raw message