ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 41368] Nested record tasks produces an empty output file
Date Wed, 05 Aug 2009 20:51:43 GMT

Chung, Gene-Sung <> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #5 from Chung, Gene-Sung <> 2009-08-05 13:51:40 PDT
This fix seems to cause some side effects which does not preserve the calling
hierarchical scoping for the record name while the original source code seems
to be intended to preserve it.

For instance, with this script:
    <target name="parent" depends="prepare">
        <record action="start" name="${parent.log}"/>
        <echo message="Parent target started"/>

        <antcall target="child">
            <param name="child.log" value="${recdir}/child-01.log"/>

        <record action="stop" name="${parent.log}"/>

    <target name="child">
        <record action="start" name="${child.log}"/>
        <echo message="Child target started - ${child.log}"/>
        <record action="stop" name="${parent.log}" append="yes"/>

        <echo message="Child target processing - ${child.log}"/>

        <record action="start" name="${parent.log}"/>
        <echo message="Child target ended - ${child.log}"/>
        <record action="stop" name="${child.log}"/>

the fix generate the following log entries for parent:
     [echo] Parent target started

     [echo] Child target started - recorder-out/child-01.log
     [echo] Child target processing - recorder-out/child-01.log (*)
     [echo] Child target ended - recorder-out/child-01.log
     [echo] Child target ended - recorder-out/child-01.log (*)

(*) seems to be errors.

Rather than the per-Project-object approach, it might be better to check the
project of RecorderEntry during the cleanup. (Assuming all the changes were revoked)
  import java.util.Iterator;
  import java.util.Map;

    private void cleanup() {
        Hashtable entries = (Hashtable)recorderEntries.clone();
        Iterator itEntries = entries.entrySet().iterator();
        while (itEntries.hasNext()) {
            Map.Entry entry = (Map.Entry);
            RecorderEntry re = (RecorderEntry)entry.getValue();
            if (re.getProject() == getProject())

    public Project getProject() {
        return project;

I have verified this with the ant scripts (record.xml and record2.xml) and the
above script.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message