> 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
> @@ -288,11 +288,14 @@
>                  ((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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to