Author: mbenson
Date: Tue May  8 15:29:24 2007
New Revision: 536356

URL: http://svn.apache.org/viewvc?view=rev&rev=536356
Log:
guard against empty name oobe

Modified:
    
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java?view=diff&rev=536356&r1=536355&r2=536356
==============================================================================
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java 
(original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java 
Tue May  8 15:29:24 2007
@@ -128,8 +128,11 @@
      * @return the name of this resource.
      */
     public synchronized String getName() {
-        return isReference() ? ((Resource) getCheckedRef()).getName()
-            : getURL().getFile().substring(1);
+        if (isReference()) {
+            return ((Resource) getCheckedRef()).getName();
+        }
+        String name = getURL().getFile();
+        return "".equals(name) ? name : name.substring(1);
     }
 
     /**



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

Reply via email to