Bug 42179 - NullPointerException when delete fileset has no dir attribute
Summary: NullPointerException when delete fileset has no dir attribute
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.0
Hardware: All All
: P4 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-20 16:49 UTC by Trevor Harmon
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments
Test case that causes NullPointerException (183 bytes, text/plain)
2007-04-20 16:50 UTC, Trevor Harmon
Details
Test case that causes NullPointerException (172 bytes, text/plain)
2007-04-20 16:51 UTC, Trevor Harmon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Harmon 2007-04-20 16:49:37 UTC
The attached build script causes a NullPointerException in Ant 1.7.0. It seems to be due to the lack of a 
dir attribute in the fileset.
Comment 1 Trevor Harmon 2007-04-20 16:50:18 UTC
Created attachment 20006 [details]
Test case that causes NullPointerException
Comment 2 Trevor Harmon 2007-04-20 16:51:10 UTC
Created attachment 20007 [details]
Test case that causes NullPointerException
Comment 3 J.M. (Martijn) Kruithof 2007-04-21 14:37:16 UTC
Thanks for the simple test case to reproduce the fault.

Either the file or the dir attribute are mandatory on a fileset, the error
message should be different though, and not just a NullPointerException

On the current head version of ant the error is caused by 

--- Nested Exception ---
java.lang.NullPointerException
        at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:565)
Comment 4 J.M. (Martijn) Kruithof 2007-04-23 12:50:23 UTC
The NPE is now avoided and a BuildException (still terminating the build) is
thrown instead.