ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <sflo...@nc.rr.com>
Subject Bug with basename?
Date Mon, 06 Jul 2009 17:37:01 GMT
All:

Without going into long drawn out explanation, I am getting an exception 
using the basename task as so:

<basename  file = "/tmp/foo/bar.txt"  property = "origProp"  suffix = ""/>


java.lang.StringIndexOutOfBoundsException: String index out of range: 0
         at java.lang.String.charAt(String.java:686)
         at 
org.apache.tools.ant.taskdefs.Basename.execute(Basename.java:100)
         at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
         at org.apache.tools.ant.Task.perform(Task.java:348)
         at org.apache.tools.ant.Target.execute(Target.java:357)
         at 
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
         at 
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
         at org.apache.tools.ant.Main.runBuild(Main.java:743)
         at org.apache.tools.ant.Main.startAnt(Main.java:217)
         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Yes - I know - suffix is empty ;)

However, I didn't expect to see any exception.  I've not looked at the 
code, but my guess is its a simple fix ;)


Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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


Mime
View raw message