I think in general it is not a good idea.

The code in question is:
in Target#execute
                Iterator it = children.iterator();
                Object o = it.next();
                if (o instanceof Task) {
                    Task task = (Task) o;
                    task.perform();
                } else {
                    RuntimeConfigurable r = (RuntimeConfigurable) o;
                    r.maybeConfigure(project);
                }

This was:
            Enumeration enum = children.elements();
            while (enum.hasMoreElements()) {
                Object o = enum.nextElement();
                if (o instanceof Task) {
                    Task task = (Task) o;
                    task.perform();
                } else {
                    RuntimeConfigurable r = (RuntimeConfigurable) o;
                    r.maybeConfigure(project);
                }

The first picks up the fact that children has been modified
while it is being iterated, and the second does not. (See
src.zip/../Vector#elements()).

I am not sure that that depending on an undocumented (I think)
feature of Vector/Enumeration is a good idea. So to support this feature
one would have to modify the way the task list of a target is
visitied.

Peter.

On Mon, 2003-07-07 at 08:37, Stefan Bodewig wrote:
> On 04 Jul 2003, peter reilly <[EMAIL PROTECTED]> wrote:
> 
> > The test code in question was inserting tasks
> > into the current target, and this does not
> > seem to be a good idea.
> 
> In general or just after the code change?
> 
> If we agree that adding tasks to the current target is no good idea in
> general (I'm not sure), we should document it - otherwise it might be
> better to revert that part of the Target changes as well as your
> changes to the test and fix the situation.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to