ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r592499 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Touch.java
Date Tue, 06 Nov 2007 17:45:56 GMT
Author: mbenson
Date: Tue Nov  6 09:45:55 2007
New Revision: 592499

URL: http://svn.apache.org/viewvc?rev=592499&view=rev
Log:
BZ 43799 / touch sees e.g. empty fs as unspecified args

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Touch.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Touch.java?rev=592499&r1=592498&r2=592499&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Touch.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Touch.java Tue Nov  6 09:45:55 2007
@@ -85,7 +85,7 @@
     private long millis = -1;
     private String dateTime;
     private Vector filesets = new Vector();
-    private Union resources = new Union();
+    private Union resources;
     private boolean dateTimeConfigured;
     private boolean mkdirs;
     private boolean verbose = true;
@@ -212,7 +212,8 @@
      * @param rc the collection to add.
      * @since Ant 1.7
      */
-    public void add(ResourceCollection rc) {
+    public synchronized void add(ResourceCollection rc) {
+        resources = resources == null ? new Union() : resources;
         resources.add(rc);
     }
 
@@ -222,7 +223,7 @@
      * @since Ant 1.6.3
      */
     protected synchronized void checkConfiguration() throws BuildException {
-        if (file == null && resources.size() == 0) {
+        if (file == null && resources == null) {
             throw new BuildException("Specify at least one source"
                                    + "--a file or resource collection.");
         }



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


Mime
View raw message