ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47306] New: replacetokens fails if file/stream ends on @
Date Wed, 03 Jun 2009 07:19:44 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47306

           Summary: replacetokens fails if file/stream ends on @
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: martineigenbrodt@googlemail.com


I've used the copy task with a replacetokens filter. The File I'm coping ends
on  "@". This results in an exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:687)
        at
org.apache.tools.ant.filters.ReplaceTokens.getNextChar(ReplaceTokens.java:99)
        at
org.apache.tools.ant.filters.ReplaceTokens.read(ReplaceTokens.java:133)
        at
org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.java:83)
        at java.io.BufferedReader.read1(BufferedReader.java:185)
        at java.io.BufferedReader.read(BufferedReader.java:261)
        at
org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:358)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:475)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:304)
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:805)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:496)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        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.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        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)

Workaround: Add a char at the end of the file

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message