[kaffe] [gump] Ant failure if filtering is switched on during copy

Adam Heath doogie at brainfood.com
Fri Dec 10 13:56:04 PST 2004


On Fri, 10 Dec 2004, Davanum Srinivas wrote:

> Here's the build.xml that you can create the problem with. drop both build.xml and a.txt in a
> directory and run ant from that directory. It should create a b.txt with "ABCDEFG = 3.8.2".
>
> ============= build.xml ==============
> <project name="foo" default="bar" basedir=".">
>         <property name="version" value="3.8.2" />
>         <target name="bar">
>                 <filter token="version" value="${version}" />
>                 <copy
>                         file="a.txt"
>                         tofile="b.txt"
>                         filtering="on"
>                 />
>         </target>
> </project>
> ============= a.txt ==============
> ABCDEFG = @version@
> ==================================
>
> The source code in question is in Ant's copy task, first see doFileOperationsin Copy.java which in
> turn calls copyFile in FileUtils.java:
> http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs/Copy.java?view=markup
> http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/util/FileUtils.java?view=markup
>
> Notes:
> - Problems does not happen in IKVM, just with Kaffe.

I could duplicate this with kaffe HEAD, and the ant in debian.

I added a flush call to close in close() gnu.java.io.encode.Encoder to
fix it.

Previously, KaffeEncoder didn't do buffering, so this was never a problem.
However, that was discovered to be a serious performance problem.  Since the
java spec allows conversions to be buffered, I turned
KaffeEncoder/KaffeDecoder into buffering versions(huge speedup), but missed
this problem.

Fix is in cvs.




More information about the kaffe mailing list