ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Nagendra Kumar <Nagendra.R...@tejasoft.com>
Subject Re: FileSet with copy fails with NPE..
Date Wed, 10 Dec 2008 14:51:12 GMT

Hi Mark,

Thank you for quick reply.. I saw that listed in forum and thought I need to
set the project fileset..
However, the issue was to set project for copy taks it self.

To Ant Dev Team,

It was 3 hours of wasted time to figure this out.. 

Simple copy without fileset usage works fine without setting the project and
fails only when the fileset is added to copy task.

The actual cause with line 431 of org.apache.tools.ant.taskdefs.Copy

                        ds = fs.getDirectoryScanner(getProject());

Which inturn results in NPE in FileSet NPE during log at line 477 in
org.apache.tools.ant.types.AbstractFileSet

 p.log(getDataTypeName() + ": Setup scanner in dir " + dir
            + " with " + ps, Project.MSG_DEBUG);

In future, it would be nice if ant could do one or more of the following
changes in all such places, where it depends of project value should not be
null

1. Make sure proper asserts are done for getProject() method if it should
not be null at all
2. Or focus on Methods which depend on non null value of getProject() and 
should throw proper exception
3. AbstractFileSet could use getProject() of its own task rather than
depending on the parameter passed to it. Not sure, why the project is passed
as parameter..(may be I don't understand the need due to my currrent limited
understanding)

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
-A Competent Java Specialized Product Development Team. 




-- 
View this message in context: http://www.nabble.com/FileSet-with-copy-fails-with-NPE..-tp20935877p20936814.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


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


Mime
View raw message