ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r536356 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
Date Tue, 08 May 2007 22:29:26 GMT
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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message