ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r484850 - /ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java
Date Fri, 08 Dec 2006 23:43:20 GMT
Author: mbenson
Date: Fri Dec  8 15:43:18 2006
New Revision: 484850

URL: http://svn.apache.org/viewvc?view=rev&rev=484850
Log:
last minute; avoid NPE when attempting to map no-name resource. Bugzilla 39960.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java?view=diff&rev=484850&r1=484849&r2=484850
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java Fri Dec  8 15:43:18
2006
@@ -155,12 +155,19 @@
         Union result = new Union();
         for (Iterator iter = source.iterator(); iter.hasNext();) {
             Resource sr = (Resource) iter.next();
-            String[] targetnames = mapper.mapFileName(
-                sr.getName().replace('/', File.separatorChar));
+            String srName = sr.getName();
+            srName = srName == null
+                ? srName : srName.replace('/', File.separatorChar);
 
+            String[] targetnames = null;
+            try {
+                targetnames = mapper.mapFileName(srName);
+            } catch (Exception e) {
+		logTo.log("Caught " + e + " mapping resource " + sr,
+                    Project.MSG_VERBOSE);
+            }
             if (targetnames == null || targetnames.length == 0) {
-                logTo.log(sr.getName()
-                      + " skipped - don\'t know how to handle it",
+                logTo.log(sr + " skipped - don\'t know how to handle it",
                       Project.MSG_VERBOSE);
                 continue;
             }



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


Mime
View raw message