Bug 7552 - Invalid task cache in targets
Summary: Invalid task cache in targets
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.5
Hardware: Other other
: P2 critical (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2002-03-28 02:06 UTC by paulkilroy
Modified: 2017-03-03 03:38 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
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"/>
        <delete file="foo.jar"/>

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

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


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


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

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.