Bug 7552

Summary: Invalid task cache in targets
Product: Ant Reporter: paulkilroy
Component: CoreAssignee: Ant Notifications List <notifications>
Status: REOPENED ---    
Severity: critical CC: notifications
Priority: P2    
Version: 1.5   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description paulkilroy 2002-03-28 02:06:41 UTC
<project name="test" default="foo">

    <target name="bug">
        <jar destfile="foo.jar">
            <fileset dir="." includes="*.class"/>
        </jar>
        <delete file="foo.jar"/>
    </target>

    <target name="moo" depends="bug"/>

    <target name="foo" depends="bug"/>

</project>

I get the following error when I run "ant foo moo":
BUILD FAILED
/home/pkilroy/antbug/build.xml:4: You must specify the
jar file to create!


==================
[Conor]

Agreed. This bug arises from the tendency of many tasks to change, in their 
execute method, the state setup by the core using IntrospectionHelper. In this 
case it is the cleanup() method of Zip.java. In fact the cleanup method was 
changed as part of bug 4366
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4366

I'm not sure I understand the original bug report but it is probably a symptom 
of the same problem, the changing of the filesets in the execute() method. The 
fix, however, almost guarantees that the instance cannot be reused.

[...]

I think that we need to perhaps examine how all tasks preserve their state as 
I'm sure this is not limited to the Zip task.
Comment 1 Stefan Bodewig 2002-04-09 15:22:19 UTC
<zip> and <jar> are fixed in nightly build 2002-04-10.

I'm not closing this bug now as a reminder that all tasks need to be audited.
Comment 2 Stefan Bodewig 2002-04-12 15:09:53 UTC
All core tasks and <junit> are done for nightly build 2002-04-13.

I'm closing this bug as fixed, this is a lie, I know.  There may be optional
tasks that need to be adapted, but we can deal with them on a task by task basis.