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 41086] New: - copy with filter fails on nested substitutions
Date Thu, 30 Nov 2006 17:32:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41086>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41086

           Summary: copy with filter fails on nested substitutions
           Product: Ant
           Version: 1.7.0RC1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: dlipofsky@gmail.com


This worked with Ant 1.6.5 but fails with 1.7.0RC1.

==> build.xml <==
<project name="test" default="test" basedir=".">
    <target name="test">
        <filter filtersfile="filter.properties" />
        <copy file="test.txt" tofile="filtered.txt"
              filtering="true" overwrite="true"/>
    </target>
</project>

==> filter.properties <==
a=aaa
b=bbb
c=@a@:@b@

==> test.txt <==
@a@
@b@
@c@

This is the output I get

$ ant -v
Apache Ant version 1.7.0RC1 compiled on November 5 2006
Buildfile: build.xml
Detected Java version: 1.4 in: C:\jdk1.4.2\jre
Detected OS: Windows XP
parsing buildfile C:\src\tmp\build.xml with URI = file:/C:/src/tmp/build.xml
Project base dir set to: C:\src\tmp
Build sequence for target(s) `test' is [test]
Complete build sequence is [test, ]

test:
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.
   [filter] Reading filters from C:\src\tmp\filter.properties
Reading filters from C:\src\tmp\filter.properties
     [copy] Copying 1 file to C:\src\tmp
     [copy] Copying C:\src\tmp\test.txt to C:\src\tmp\filtered.txt
Replacing: @a@ -> aaa
Replacing: @b@ -> bbb
Replacing: @a@ -> aaa

BUILD FAILED
C:\src\tmp\build.xml:4: java.lang.NullPointerException
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
        at org.apache.tools.ant.Task.perform(Task.java:342)
        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:1292)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1261)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1144)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
        at org.apache.tools.ant.types.FilterSet.replaceTokens(FilterSet.java:565)
        at org.apache.tools.ant.types.FilterSet.iReplaceTokens(FilterSet.java:525)
        at org.apache.tools.ant.types.FilterSet.replaceTokens(FilterSet.java:576)
        at org.apache.tools.ant.types.FilterSet.iReplaceTokens(FilterSet.java:525)
        at org.apache.tools.ant.types.FilterSet.replaceTokens(FilterSet.java:389)
        at
org.apache.tools.ant.types.FilterSetCollection.replaceTokens(FilterSetCollection.java:78)
        at
org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:311)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:507)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:322)
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:793)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:532)
        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:324)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        ... 11 more
--- Nested Exception ---
java.lang.NullPointerException
        at org.apache.tools.ant.types.FilterSet.replaceTokens(FilterSet.java:565)
        at org.apache.tools.ant.types.FilterSet.iReplaceTokens(FilterSet.java:525)
        at org.apache.tools.ant.types.FilterSet.replaceTokens(FilterSet.java:576)
        at org.apache.tools.ant.types.FilterSet.iReplaceTokens(FilterSet.java:525)
        at org.apache.tools.ant.types.FilterSet.replaceTokens(FilterSet.java:389)
        at
org.apache.tools.ant.types.FilterSetCollection.replaceTokens(FilterSetCollection.java:78)
        at
org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:311)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:507)
        at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:322)
        at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:793)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:532)
        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:324)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:342)
        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:1292)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1261)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1144)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

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

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


Mime
View raw message