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=17883>.
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=17883

Custom task containers don't share property state across subtasks

           Summary: Custom task containers don't share property state across
                    subtasks
           Product: Ant
           Version: 1.5.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Other
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


I have a subclass of Task that implements TaskContainer.  When I iterate over 
the child tasks, the property values that are set don't seem to maintain their 
state for the next child task.

This is how my Ant task executes the subtasks:

        for (int i=0; i<fTasks.size(); i++) {
                Task task = (Task) fTasks.elementAt(i);
                task.perform();
        }

This is my small testcase:

<target name="testProps">
        <property name="joe" value="bob"/>
        <myTaskContainer>
                <echo message="${joe}"/>
                <property name="test" value="foo"/>
                <echo message="${test}"/>
        </myTaskContainer>
</target>

When I run this under Ant 1.4, the output is:

bob
foo

When I run this under Ant 1.5.2, the output is:

bob
${test}

This is a critical bug for us, since we rely on being able to set properties in 
container tasks.

Reply via email to