Author: jkf
Date: Thu Aug 16 06:42:30 2007
New Revision: 566711

URL: http://svn.apache.org/viewvc?view=rev&rev=566711
Log:
Merge of Pr 43016 improved error reporting on nothing to compress.

Modified:
    
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Pack.java

Modified: 
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Pack.java
URL: 
http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Pack.java?view=diff&rev=566711&r1=566710&r2=566711
==============================================================================
--- 
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Pack.java
 (original)
+++ 
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Pack.java
 Thu Aug 16 06:42:30 2007
@@ -88,9 +88,14 @@
      * @param a the resource to pack as a single element Resource collection.
      */
     public void addConfigured(ResourceCollection a) {
+        if (a.size() == 0) {
+            throw new BuildException("No resource selected, " + getTaskName()
+                    + " needs exactly one resource.");
+        }
         if (a.size() != 1) {
-            throw new BuildException("only single argument resource 
collections"
-                                     + " are supported as archives");
+            throw new BuildException(getTaskName()
+                    + " cannot handle multiple resources at once. (" + a.size()
+                    + " resources were selected.)");
         }
         setSrcResource((Resource) a.iterator().next());
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to