ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12186] New: - Replacetokens filterchain fails with empty string as begin or end tokens
Date Fri, 30 Aug 2002 07:10:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12186>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12186

Replacetokens filterchain fails with empty string as begin or end tokens

           Summary: Replacetokens filterchain fails with empty string as
                    begin or end tokens
           Product: Ant
           Version: 1.5
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: Edwin_STEELE@rta.nsw.gov.au


When either or both of the begintoken or endtoken attributes are set to the 
empty string on the replacetokens filterchain, it falls in a heap.

I would use copy with filtersets instead, but it doesn't allow me to have empty 
begintoken or endtoken attributes.

Using the attached buildfile, running either of the targets gives:

E:\Construction>ant -verbose -buildfile e:\bug.xml bob
Apache Ant version 1.5 compiled on July 9 2002
Buildfile: e:\bug.xml
Detected Java version: 1.3 in: P:\jdk1.3.1\jre
Detected OS: Windows NT
parsing buildfile e:\bug.xml with URI = file:e:/bug.xml
Project base dir set to: E:\
Build sequence for target `bob' is [bob]
Complete build sequence is [bob, bob2]

bob:
Property ${TODAY} has not been set
     [copy] Copying 1 file to C:\temp
     [copy] Copying C:\autoexec.bat to C:\temp\junk.zzz

BUILD FAILED
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(String.java:516)
        at org.apache.tools.ant.filters.ReplaceTokens.initialize
(ReplaceTokens.java:274)
        at org.apache.tools.ant.filters.ReplaceTokens.read
(ReplaceTokens.java:133)
        at org.apache.tools.ant.filters.BaseFilterReader.read
(BaseFilterReader.java:123)
        at java.io.BufferedReader.fill(BufferedReader.java:139)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:367)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:225)
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:527)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:368)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 1 second

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


Mime
View raw message