ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r818143 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java
Date Wed, 23 Sep 2009 15:40:32 GMT
Author: bodewig
Date: Wed Sep 23 15:40:32 2009
New Revision: 818143

URL: http://svn.apache.org/viewvc?rev=818143&view=rev
Log:
improve logging

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java?rev=818143&r1=818142&r2=818143&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java Wed Sep 23 15:40:32 2009
@@ -105,11 +105,19 @@
                     dest = new File(destination, path);
                 } else {
                     FileNameMapper mapper = mapperElement.getImplementation();
-                    String[] d = mapper.mapFileName(r.getName());
-                    if (d == null || d.length != 1) {
+                    String[] d = mapper.mapFileName(source.toString());
+                    if (d == null) {
                         log("skipping " + r + " - mapper can't handle it",
                             Project.MSG_WARN);
                         continue;
+                    } else if (d.length == 0) {
+                        log("skipping " + r + " - mapper returns no file name",
+                            Project.MSG_WARN);
+                        continue;
+                    } else if (d.length > 1) {
+                        log("skipping " + r + " - mapper returns multiple file"
+                            + " names", Project.MSG_WARN);
+                        continue;
                     }
                     dest = new File(destination, d[0]);
                 }



Mime
View raw message