ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r531575 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java
Date Mon, 23 Apr 2007 19:48:44 GMT
Author: jkf
Date: Mon Apr 23 12:48:43 2007
New Revision: 531575

URL: http://svn.apache.org/viewvc?view=rev&rev=531575
Log:
pr 42179: Delete cannot handle (NPE) fileset without file or directory specified.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java?view=diff&rev=531575&r1=531574&r2=531575
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java Mon Apr 23 12:48:43
2007
@@ -562,12 +562,16 @@
                 fs = (FileSet) fs.clone();
                 fs.setProject(getProject());
             }
-            if (!fs.getDir().isDirectory()) {
-                handle("Directory does not exist:" + fs.getDir());
+            File fsDir = fs.getDir();
+            if (fsDir == null) {
+                throw new BuildException(
+                        "File or Resource without directory or file specified");
+            } else if (!fsDir.isDirectory()) {
+                handle("Directory does not exist:" + fsDir);
             } else {
                 resourcesToDelete.add(fs);
                 if (includeEmpty) {
-                    filesetDirs.add(new ReverseDirs(fs.getDir(), fs
+                    filesetDirs.add(new ReverseDirs(fsDir, fs
                             .getDirectoryScanner().getIncludedDirectories()));
                 }
             }



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


Mime
View raw message