You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2005/10/06 05:50:34 UTC

svn commit: r306520 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java

Author: bodewig
Date: Wed Oct  5 20:50:30 2005
New Revision: 306520

URL: http://svn.apache.org/viewcvs?rev=306520&view=rev
Log:
empty collection != no collection

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java?rev=306520&r1=306519&r2=306520&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java Wed Oct  5 20:50:30 2005
@@ -57,7 +57,7 @@
 
     protected Vector filesets = new Vector(); // contains AbstractFileSet
                                               // (both DirSet and FileSet)
-    private Union resources = new Union();
+    private Union resources = null;
     private boolean relative = false;
     private boolean parallel = false;
     private boolean forwardSlash = false;
@@ -112,6 +112,9 @@
      * @since Ant 1.7
      */
     public void add(ResourceCollection rc) {
+        if (resources == null) {
+            resources = new Union();
+        }
         resources.add(rc);
     }
 
@@ -294,7 +297,7 @@
             log("!! execon is deprecated. Use apply instead. !!");
         }
         super.checkConfiguration();
-        if (filesets.size() == 0 && resources.size() == 0) {
+        if (filesets.size() == 0 && resources == null) {
             throw new BuildException("no resources specified",
                                      getLocation());
         }
@@ -414,6 +417,7 @@
                 }
             }
         
+            if (resources != null) {
             Iterator iter = resources.iterator();
             while (iter.hasNext()) {
                 Resource res = (Resource) iter.next();
@@ -481,6 +485,7 @@
                     + totalDirs + " director"
                     + (totalDirs != 1 ? "ies" : "y") + ".",
                     verbose ? Project.MSG_INFO : Project.MSG_VERBOSE);
+            }
             }
         } catch (IOException e) {
             throw new BuildException("Execute failed: " + e, e, getLocation());



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