Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Developers List »

Merge 641903 from trunk to 1.7 branch?

Stefan Bodewig

2008-03-28

Replies:

Author LoginPost Reply
> Author: peterreilly
> Date: Thu Mar 27 10:09:53 2008
> New Revision: 641903
>
> URL: http://svn.apache.org/viewvc?rev=641903&view=rev
> Log:
> Bugzilla 44689: NPE with multiple targets and id's in task

IMHO the bug is serious enough to be fixed in 1.7.1 final and should
be merged into the branch.

> --- ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java
> (original)
> +++ ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Thu Mar 27 10:09:53 2008
> @@(protected) @@
>            ((Task) realThing).execute();
>         }
>       } finally {
> -        // Finished executing the task, null it to allow
> +        // Finished executing the task
> +        // null it (unless it has an ID) to allow
>         // GC do its job
>         // If this UE is used again, a new "realthing" will be made
> -        realThing = null;
> -        getWrapper().setProxy(null);
> +        if (getWrapper().getId() == null) {
> +           realThing = null;
> +           getWrapper().setProxy(null);
> +        }
>       }
>    }

Looks pretty save to me. This means we might be having a few
tasks/types living longer than needed, but it seems to be the only way
people can use ids in their build files and run multiple targets at
the same time.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@(protected)
For additional commands, e-mail: dev-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.